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.60.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_with_id`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum ChangePasswordWithIdError {
54    DefaultResponse(models::Errors),
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`check_change_password_using_id_with_id`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum CheckChangePasswordUsingIdWithIdError {
62    DefaultResponse(models::Errors),
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`comment_on_user_with_id`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum CommentOnUserWithIdError {
70    DefaultResponse(models::Errors),
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`complete_verify_identity_with_id`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CompleteVerifyIdentityWithIdError {
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_change_password`]
523#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum CreateUserChangePasswordError {
526    DefaultResponse(models::Errors),
527    UnknownValue(serde_json::Value),
528}
529
530/// struct for typed errors of method [`create_user_consent`]
531#[derive(Debug, Clone, Serialize, Deserialize)]
532#[serde(untagged)]
533pub enum CreateUserConsentError {
534    DefaultResponse(models::Errors),
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`create_user_consent_with_id`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum CreateUserConsentWithIdError {
542    DefaultResponse(models::Errors),
543    UnknownValue(serde_json::Value),
544}
545
546/// struct for typed errors of method [`create_user_link_with_id`]
547#[derive(Debug, Clone, Serialize, Deserialize)]
548#[serde(untagged)]
549pub enum CreateUserLinkWithIdError {
550    DefaultResponse(models::Errors),
551    UnknownValue(serde_json::Value),
552}
553
554/// struct for typed errors of method [`create_user_verify_email`]
555#[derive(Debug, Clone, Serialize, Deserialize)]
556#[serde(untagged)]
557pub enum CreateUserVerifyEmailError {
558    DefaultResponse(models::Errors),
559    UnknownValue(serde_json::Value),
560}
561
562/// struct for typed errors of method [`create_user_with_id`]
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum CreateUserWithIdError {
566    DefaultResponse(models::Errors),
567    UnknownValue(serde_json::Value),
568}
569
570/// struct for typed errors of method [`create_webhook`]
571#[derive(Debug, Clone, Serialize, Deserialize)]
572#[serde(untagged)]
573pub enum CreateWebhookError {
574    DefaultResponse(models::Errors),
575    UnknownValue(serde_json::Value),
576}
577
578/// struct for typed errors of method [`create_webhook_with_id`]
579#[derive(Debug, Clone, Serialize, Deserialize)]
580#[serde(untagged)]
581pub enum CreateWebhookWithIdError {
582    DefaultResponse(models::Errors),
583    UnknownValue(serde_json::Value),
584}
585
586/// struct for typed errors of method [`delete_api_key_with_id`]
587#[derive(Debug, Clone, Serialize, Deserialize)]
588#[serde(untagged)]
589pub enum DeleteApiKeyWithIdError {
590    DefaultResponse(models::Errors),
591    UnknownValue(serde_json::Value),
592}
593
594/// struct for typed errors of method [`delete_application_role_with_id`]
595#[derive(Debug, Clone, Serialize, Deserialize)]
596#[serde(untagged)]
597pub enum DeleteApplicationRoleWithIdError {
598    DefaultResponse(models::Errors),
599    UnknownValue(serde_json::Value),
600}
601
602/// struct for typed errors of method [`delete_application_with_id`]
603#[derive(Debug, Clone, Serialize, Deserialize)]
604#[serde(untagged)]
605pub enum DeleteApplicationWithIdError {
606    DefaultResponse(models::Errors),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`delete_connector_with_id`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum DeleteConnectorWithIdError {
614    DefaultResponse(models::Errors),
615    UnknownValue(serde_json::Value),
616}
617
618/// struct for typed errors of method [`delete_consent_with_id`]
619#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum DeleteConsentWithIdError {
622    DefaultResponse(models::Errors),
623    UnknownValue(serde_json::Value),
624}
625
626/// struct for typed errors of method [`delete_email_template_with_id`]
627#[derive(Debug, Clone, Serialize, Deserialize)]
628#[serde(untagged)]
629pub enum DeleteEmailTemplateWithIdError {
630    DefaultResponse(models::Errors),
631    UnknownValue(serde_json::Value),
632}
633
634/// struct for typed errors of method [`delete_entity_grant_with_id`]
635#[derive(Debug, Clone, Serialize, Deserialize)]
636#[serde(untagged)]
637pub enum DeleteEntityGrantWithIdError {
638    DefaultResponse(models::Errors),
639    UnknownValue(serde_json::Value),
640}
641
642/// struct for typed errors of method [`delete_entity_type_permission_with_id`]
643#[derive(Debug, Clone, Serialize, Deserialize)]
644#[serde(untagged)]
645pub enum DeleteEntityTypePermissionWithIdError {
646    DefaultResponse(models::Errors),
647    UnknownValue(serde_json::Value),
648}
649
650/// struct for typed errors of method [`delete_entity_type_with_id`]
651#[derive(Debug, Clone, Serialize, Deserialize)]
652#[serde(untagged)]
653pub enum DeleteEntityTypeWithIdError {
654    DefaultResponse(models::Errors),
655    UnknownValue(serde_json::Value),
656}
657
658/// struct for typed errors of method [`delete_entity_with_id`]
659#[derive(Debug, Clone, Serialize, Deserialize)]
660#[serde(untagged)]
661pub enum DeleteEntityWithIdError {
662    DefaultResponse(models::Errors),
663    UnknownValue(serde_json::Value),
664}
665
666/// struct for typed errors of method [`delete_form_field_with_id`]
667#[derive(Debug, Clone, Serialize, Deserialize)]
668#[serde(untagged)]
669pub enum DeleteFormFieldWithIdError {
670    DefaultResponse(models::Errors),
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`delete_form_with_id`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum DeleteFormWithIdError {
678    DefaultResponse(models::Errors),
679    UnknownValue(serde_json::Value),
680}
681
682/// struct for typed errors of method [`delete_group_members_with_id`]
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum DeleteGroupMembersWithIdError {
686    DefaultResponse(models::Errors),
687    UnknownValue(serde_json::Value),
688}
689
690/// struct for typed errors of method [`delete_group_with_id`]
691#[derive(Debug, Clone, Serialize, Deserialize)]
692#[serde(untagged)]
693pub enum DeleteGroupWithIdError {
694    DefaultResponse(models::Errors),
695    UnknownValue(serde_json::Value),
696}
697
698/// struct for typed errors of method [`delete_identity_provider_with_id`]
699#[derive(Debug, Clone, Serialize, Deserialize)]
700#[serde(untagged)]
701pub enum DeleteIdentityProviderWithIdError {
702    DefaultResponse(models::Errors),
703    UnknownValue(serde_json::Value),
704}
705
706/// struct for typed errors of method [`delete_ip_access_control_list_with_id`]
707#[derive(Debug, Clone, Serialize, Deserialize)]
708#[serde(untagged)]
709pub enum DeleteIpAccessControlListWithIdError {
710    DefaultResponse(models::Errors),
711    UnknownValue(serde_json::Value),
712}
713
714/// struct for typed errors of method [`delete_jwt_refresh`]
715#[derive(Debug, Clone, Serialize, Deserialize)]
716#[serde(untagged)]
717pub enum DeleteJwtRefreshError {
718    DefaultResponse(models::Errors),
719    UnknownValue(serde_json::Value),
720}
721
722/// struct for typed errors of method [`delete_key_with_id`]
723#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum DeleteKeyWithIdError {
726    DefaultResponse(models::Errors),
727    UnknownValue(serde_json::Value),
728}
729
730/// struct for typed errors of method [`delete_lambda_with_id`]
731#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum DeleteLambdaWithIdError {
734    DefaultResponse(models::Errors),
735    UnknownValue(serde_json::Value),
736}
737
738/// struct for typed errors of method [`delete_message_template_with_id`]
739#[derive(Debug, Clone, Serialize, Deserialize)]
740#[serde(untagged)]
741pub enum DeleteMessageTemplateWithIdError {
742    DefaultResponse(models::Errors),
743    UnknownValue(serde_json::Value),
744}
745
746/// struct for typed errors of method [`delete_messenger_with_id`]
747#[derive(Debug, Clone, Serialize, Deserialize)]
748#[serde(untagged)]
749pub enum DeleteMessengerWithIdError {
750    DefaultResponse(models::Errors),
751    UnknownValue(serde_json::Value),
752}
753
754/// struct for typed errors of method [`delete_o_auth_scope_with_id`]
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum DeleteOAuthScopeWithIdError {
758    DefaultResponse(models::Errors),
759    UnknownValue(serde_json::Value),
760}
761
762/// struct for typed errors of method [`delete_tenant_with_id`]
763#[derive(Debug, Clone, Serialize, Deserialize)]
764#[serde(untagged)]
765pub enum DeleteTenantWithIdError {
766    DefaultResponse(models::Errors),
767    UnknownValue(serde_json::Value),
768}
769
770/// struct for typed errors of method [`delete_theme_with_id`]
771#[derive(Debug, Clone, Serialize, Deserialize)]
772#[serde(untagged)]
773pub enum DeleteThemeWithIdError {
774    DefaultResponse(models::Errors),
775    UnknownValue(serde_json::Value),
776}
777
778/// struct for typed errors of method [`delete_user_action_reason_with_id`]
779#[derive(Debug, Clone, Serialize, Deserialize)]
780#[serde(untagged)]
781pub enum DeleteUserActionReasonWithIdError {
782    DefaultResponse(models::Errors),
783    UnknownValue(serde_json::Value),
784}
785
786/// struct for typed errors of method [`delete_user_action_with_id`]
787#[derive(Debug, Clone, Serialize, Deserialize)]
788#[serde(untagged)]
789pub enum DeleteUserActionWithIdError {
790    DefaultResponse(models::Errors),
791    UnknownValue(serde_json::Value),
792}
793
794/// struct for typed errors of method [`delete_user_bulk`]
795#[derive(Debug, Clone, Serialize, Deserialize)]
796#[serde(untagged)]
797pub enum DeleteUserBulkError {
798    DefaultResponse(models::Errors),
799    UnknownValue(serde_json::Value),
800}
801
802/// struct for typed errors of method [`delete_user_link_with_id`]
803#[derive(Debug, Clone, Serialize, Deserialize)]
804#[serde(untagged)]
805pub enum DeleteUserLinkWithIdError {
806    DefaultResponse(models::Errors),
807    UnknownValue(serde_json::Value),
808}
809
810/// struct for typed errors of method [`delete_user_registration_with_id`]
811#[derive(Debug, Clone, Serialize, Deserialize)]
812#[serde(untagged)]
813pub enum DeleteUserRegistrationWithIdError {
814    DefaultResponse(models::Errors),
815    UnknownValue(serde_json::Value),
816}
817
818/// struct for typed errors of method [`delete_user_two_factor_with_id`]
819#[derive(Debug, Clone, Serialize, Deserialize)]
820#[serde(untagged)]
821pub enum DeleteUserTwoFactorWithIdError {
822    DefaultResponse(models::Errors),
823    UnknownValue(serde_json::Value),
824}
825
826/// struct for typed errors of method [`delete_user_with_id`]
827#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum DeleteUserWithIdError {
830    DefaultResponse(models::Errors),
831    UnknownValue(serde_json::Value),
832}
833
834/// struct for typed errors of method [`delete_web_authn_credential_with_id`]
835#[derive(Debug, Clone, Serialize, Deserialize)]
836#[serde(untagged)]
837pub enum DeleteWebAuthnCredentialWithIdError {
838    DefaultResponse(models::Errors),
839    UnknownValue(serde_json::Value),
840}
841
842/// struct for typed errors of method [`delete_webhook_with_id`]
843#[derive(Debug, Clone, Serialize, Deserialize)]
844#[serde(untagged)]
845pub enum DeleteWebhookWithIdError {
846    DefaultResponse(models::Errors),
847    UnknownValue(serde_json::Value),
848}
849
850/// struct for typed errors of method [`enable_two_factor_with_id`]
851#[derive(Debug, Clone, Serialize, Deserialize)]
852#[serde(untagged)]
853pub enum EnableTwoFactorWithIdError {
854    DefaultResponse(models::Errors),
855    UnknownValue(serde_json::Value),
856}
857
858/// struct for typed errors of method [`exchange_refresh_token_for_jwt_with_id`]
859#[derive(Debug, Clone, Serialize, Deserialize)]
860#[serde(untagged)]
861pub enum ExchangeRefreshTokenForJwtWithIdError {
862    DefaultResponse(models::Errors),
863    UnknownValue(serde_json::Value),
864}
865
866/// struct for typed errors of method [`forgot_password_with_id`]
867#[derive(Debug, Clone, Serialize, Deserialize)]
868#[serde(untagged)]
869pub enum ForgotPasswordWithIdError {
870    DefaultResponse(models::Errors),
871    UnknownValue(serde_json::Value),
872}
873
874/// struct for typed errors of method [`generate_key`]
875#[derive(Debug, Clone, Serialize, Deserialize)]
876#[serde(untagged)]
877pub enum GenerateKeyError {
878    DefaultResponse(models::Errors),
879    UnknownValue(serde_json::Value),
880}
881
882/// struct for typed errors of method [`generate_key_with_id`]
883#[derive(Debug, Clone, Serialize, Deserialize)]
884#[serde(untagged)]
885pub enum GenerateKeyWithIdError {
886    DefaultResponse(models::Errors),
887    UnknownValue(serde_json::Value),
888}
889
890/// struct for typed errors of method [`generate_two_factor_recovery_codes_with_id`]
891#[derive(Debug, Clone, Serialize, Deserialize)]
892#[serde(untagged)]
893pub enum GenerateTwoFactorRecoveryCodesWithIdError {
894    DefaultResponse(models::Errors),
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`generate_two_factor_secret_using_jwt_with_id`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum GenerateTwoFactorSecretUsingJwtWithIdError {
902    DefaultResponse(),
903    UnknownValue(serde_json::Value),
904}
905
906/// struct for typed errors of method [`identity_provider_login_with_id`]
907#[derive(Debug, Clone, Serialize, Deserialize)]
908#[serde(untagged)]
909pub enum IdentityProviderLoginWithIdError {
910    DefaultResponse(models::Errors),
911    UnknownValue(serde_json::Value),
912}
913
914/// struct for typed errors of method [`import_key`]
915#[derive(Debug, Clone, Serialize, Deserialize)]
916#[serde(untagged)]
917pub enum ImportKeyError {
918    DefaultResponse(models::Errors),
919    UnknownValue(serde_json::Value),
920}
921
922/// struct for typed errors of method [`import_key_with_id`]
923#[derive(Debug, Clone, Serialize, Deserialize)]
924#[serde(untagged)]
925pub enum ImportKeyWithIdError {
926    DefaultResponse(models::Errors),
927    UnknownValue(serde_json::Value),
928}
929
930/// struct for typed errors of method [`import_refresh_tokens_with_id`]
931#[derive(Debug, Clone, Serialize, Deserialize)]
932#[serde(untagged)]
933pub enum ImportRefreshTokensWithIdError {
934    DefaultResponse(models::Errors),
935    UnknownValue(serde_json::Value),
936}
937
938/// struct for typed errors of method [`import_users_with_id`]
939#[derive(Debug, Clone, Serialize, Deserialize)]
940#[serde(untagged)]
941pub enum ImportUsersWithIdError {
942    DefaultResponse(models::Errors),
943    UnknownValue(serde_json::Value),
944}
945
946/// struct for typed errors of method [`import_web_authn_credential_with_id`]
947#[derive(Debug, Clone, Serialize, Deserialize)]
948#[serde(untagged)]
949pub enum ImportWebAuthnCredentialWithIdError {
950    DefaultResponse(models::Errors),
951    UnknownValue(serde_json::Value),
952}
953
954/// struct for typed errors of method [`issue_jwt_with_id`]
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(untagged)]
957pub enum IssueJwtWithIdError {
958    DefaultResponse(models::Errors),
959    UnknownValue(serde_json::Value),
960}
961
962/// struct for typed errors of method [`login_ping_with_id`]
963#[derive(Debug, Clone, Serialize, Deserialize)]
964#[serde(untagged)]
965pub enum LoginPingWithIdError {
966    DefaultResponse(models::Errors),
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`login_ping_with_request_with_id`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum LoginPingWithRequestWithIdError {
974    DefaultResponse(models::Errors),
975    UnknownValue(serde_json::Value),
976}
977
978/// struct for typed errors of method [`login_with_id`]
979#[derive(Debug, Clone, Serialize, Deserialize)]
980#[serde(untagged)]
981pub enum LoginWithIdError {
982    DefaultResponse(models::Errors),
983    UnknownValue(serde_json::Value),
984}
985
986/// struct for typed errors of method [`lookup_identity_provider_with_id`]
987#[derive(Debug, Clone, Serialize, Deserialize)]
988#[serde(untagged)]
989pub enum LookupIdentityProviderWithIdError {
990    DefaultResponse(),
991    UnknownValue(serde_json::Value),
992}
993
994/// struct for typed errors of method [`modify_action_with_id`]
995#[derive(Debug, Clone, Serialize, Deserialize)]
996#[serde(untagged)]
997pub enum ModifyActionWithIdError {
998    DefaultResponse(models::Errors),
999    UnknownValue(serde_json::Value),
1000}
1001
1002/// struct for typed errors of method [`passwordless_login_with_id`]
1003#[derive(Debug, Clone, Serialize, Deserialize)]
1004#[serde(untagged)]
1005pub enum PasswordlessLoginWithIdError {
1006    DefaultResponse(models::Errors),
1007    UnknownValue(serde_json::Value),
1008}
1009
1010/// struct for typed errors of method [`patch_api_key_with_id`]
1011#[derive(Debug, Clone, Serialize, Deserialize)]
1012#[serde(untagged)]
1013pub enum PatchApiKeyWithIdError {
1014    DefaultResponse(models::Errors),
1015    UnknownValue(serde_json::Value),
1016}
1017
1018/// struct for typed errors of method [`patch_application_role_with_id`]
1019#[derive(Debug, Clone, Serialize, Deserialize)]
1020#[serde(untagged)]
1021pub enum PatchApplicationRoleWithIdError {
1022    DefaultResponse(models::Errors),
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`patch_application_with_id`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum PatchApplicationWithIdError {
1030    DefaultResponse(models::Errors),
1031    UnknownValue(serde_json::Value),
1032}
1033
1034/// struct for typed errors of method [`patch_connector_with_id`]
1035#[derive(Debug, Clone, Serialize, Deserialize)]
1036#[serde(untagged)]
1037pub enum PatchConnectorWithIdError {
1038    DefaultResponse(models::Errors),
1039    UnknownValue(serde_json::Value),
1040}
1041
1042/// struct for typed errors of method [`patch_consent_with_id`]
1043#[derive(Debug, Clone, Serialize, Deserialize)]
1044#[serde(untagged)]
1045pub enum PatchConsentWithIdError {
1046    DefaultResponse(models::Errors),
1047    UnknownValue(serde_json::Value),
1048}
1049
1050/// struct for typed errors of method [`patch_email_template_with_id`]
1051#[derive(Debug, Clone, Serialize, Deserialize)]
1052#[serde(untagged)]
1053pub enum PatchEmailTemplateWithIdError {
1054    DefaultResponse(models::Errors),
1055    UnknownValue(serde_json::Value),
1056}
1057
1058/// struct for typed errors of method [`patch_entity_type_permission_with_id`]
1059#[derive(Debug, Clone, Serialize, Deserialize)]
1060#[serde(untagged)]
1061pub enum PatchEntityTypePermissionWithIdError {
1062    DefaultResponse(models::Errors),
1063    UnknownValue(serde_json::Value),
1064}
1065
1066/// struct for typed errors of method [`patch_entity_type_with_id`]
1067#[derive(Debug, Clone, Serialize, Deserialize)]
1068#[serde(untagged)]
1069pub enum PatchEntityTypeWithIdError {
1070    DefaultResponse(models::Errors),
1071    UnknownValue(serde_json::Value),
1072}
1073
1074/// struct for typed errors of method [`patch_entity_with_id`]
1075#[derive(Debug, Clone, Serialize, Deserialize)]
1076#[serde(untagged)]
1077pub enum PatchEntityWithIdError {
1078    DefaultResponse(models::Errors),
1079    UnknownValue(serde_json::Value),
1080}
1081
1082/// struct for typed errors of method [`patch_form_field_with_id`]
1083#[derive(Debug, Clone, Serialize, Deserialize)]
1084#[serde(untagged)]
1085pub enum PatchFormFieldWithIdError {
1086    DefaultResponse(models::Errors),
1087    UnknownValue(serde_json::Value),
1088}
1089
1090/// struct for typed errors of method [`patch_form_with_id`]
1091#[derive(Debug, Clone, Serialize, Deserialize)]
1092#[serde(untagged)]
1093pub enum PatchFormWithIdError {
1094    DefaultResponse(models::Errors),
1095    UnknownValue(serde_json::Value),
1096}
1097
1098/// struct for typed errors of method [`patch_group_with_id`]
1099#[derive(Debug, Clone, Serialize, Deserialize)]
1100#[serde(untagged)]
1101pub enum PatchGroupWithIdError {
1102    DefaultResponse(models::Errors),
1103    UnknownValue(serde_json::Value),
1104}
1105
1106/// struct for typed errors of method [`patch_identity_provider_with_id`]
1107#[derive(Debug, Clone, Serialize, Deserialize)]
1108#[serde(untagged)]
1109pub enum PatchIdentityProviderWithIdError {
1110    DefaultResponse(models::Errors),
1111    UnknownValue(serde_json::Value),
1112}
1113
1114/// struct for typed errors of method [`patch_integrations_with_id`]
1115#[derive(Debug, Clone, Serialize, Deserialize)]
1116#[serde(untagged)]
1117pub enum PatchIntegrationsWithIdError {
1118    DefaultResponse(models::Errors),
1119    UnknownValue(serde_json::Value),
1120}
1121
1122/// struct for typed errors of method [`patch_ip_access_control_list_with_id`]
1123#[derive(Debug, Clone, Serialize, Deserialize)]
1124#[serde(untagged)]
1125pub enum PatchIpAccessControlListWithIdError {
1126    DefaultResponse(models::Errors),
1127    UnknownValue(serde_json::Value),
1128}
1129
1130/// struct for typed errors of method [`patch_lambda_with_id`]
1131#[derive(Debug, Clone, Serialize, Deserialize)]
1132#[serde(untagged)]
1133pub enum PatchLambdaWithIdError {
1134    DefaultResponse(models::Errors),
1135    UnknownValue(serde_json::Value),
1136}
1137
1138/// struct for typed errors of method [`patch_message_template_with_id`]
1139#[derive(Debug, Clone, Serialize, Deserialize)]
1140#[serde(untagged)]
1141pub enum PatchMessageTemplateWithIdError {
1142    DefaultResponse(models::Errors),
1143    UnknownValue(serde_json::Value),
1144}
1145
1146/// struct for typed errors of method [`patch_messenger_with_id`]
1147#[derive(Debug, Clone, Serialize, Deserialize)]
1148#[serde(untagged)]
1149pub enum PatchMessengerWithIdError {
1150    DefaultResponse(models::Errors),
1151    UnknownValue(serde_json::Value),
1152}
1153
1154/// struct for typed errors of method [`patch_o_auth_scope_with_id`]
1155#[derive(Debug, Clone, Serialize, Deserialize)]
1156#[serde(untagged)]
1157pub enum PatchOAuthScopeWithIdError {
1158    DefaultResponse(models::Errors),
1159    UnknownValue(serde_json::Value),
1160}
1161
1162/// struct for typed errors of method [`patch_registration_with_id`]
1163#[derive(Debug, Clone, Serialize, Deserialize)]
1164#[serde(untagged)]
1165pub enum PatchRegistrationWithIdError {
1166    DefaultResponse(models::Errors),
1167    UnknownValue(serde_json::Value),
1168}
1169
1170/// struct for typed errors of method [`patch_system_configuration_with_id`]
1171#[derive(Debug, Clone, Serialize, Deserialize)]
1172#[serde(untagged)]
1173pub enum PatchSystemConfigurationWithIdError {
1174    DefaultResponse(models::Errors),
1175    UnknownValue(serde_json::Value),
1176}
1177
1178/// struct for typed errors of method [`patch_tenant_with_id`]
1179#[derive(Debug, Clone, Serialize, Deserialize)]
1180#[serde(untagged)]
1181pub enum PatchTenantWithIdError {
1182    DefaultResponse(models::Errors),
1183    UnknownValue(serde_json::Value),
1184}
1185
1186/// struct for typed errors of method [`patch_theme_with_id`]
1187#[derive(Debug, Clone, Serialize, Deserialize)]
1188#[serde(untagged)]
1189pub enum PatchThemeWithIdError {
1190    DefaultResponse(models::Errors),
1191    UnknownValue(serde_json::Value),
1192}
1193
1194/// struct for typed errors of method [`patch_user_action_reason_with_id`]
1195#[derive(Debug, Clone, Serialize, Deserialize)]
1196#[serde(untagged)]
1197pub enum PatchUserActionReasonWithIdError {
1198    DefaultResponse(models::Errors),
1199    UnknownValue(serde_json::Value),
1200}
1201
1202/// struct for typed errors of method [`patch_user_action_with_id`]
1203#[derive(Debug, Clone, Serialize, Deserialize)]
1204#[serde(untagged)]
1205pub enum PatchUserActionWithIdError {
1206    DefaultResponse(models::Errors),
1207    UnknownValue(serde_json::Value),
1208}
1209
1210/// struct for typed errors of method [`patch_user_consent_with_id`]
1211#[derive(Debug, Clone, Serialize, Deserialize)]
1212#[serde(untagged)]
1213pub enum PatchUserConsentWithIdError {
1214    DefaultResponse(models::Errors),
1215    UnknownValue(serde_json::Value),
1216}
1217
1218/// struct for typed errors of method [`patch_user_with_id`]
1219#[derive(Debug, Clone, Serialize, Deserialize)]
1220#[serde(untagged)]
1221pub enum PatchUserWithIdError {
1222    DefaultResponse(models::Errors),
1223    UnknownValue(serde_json::Value),
1224}
1225
1226/// struct for typed errors of method [`patch_webhook_with_id`]
1227#[derive(Debug, Clone, Serialize, Deserialize)]
1228#[serde(untagged)]
1229pub enum PatchWebhookWithIdError {
1230    DefaultResponse(models::Errors),
1231    UnknownValue(serde_json::Value),
1232}
1233
1234/// struct for typed errors of method [`reconcile_jwt_with_id`]
1235#[derive(Debug, Clone, Serialize, Deserialize)]
1236#[serde(untagged)]
1237pub enum ReconcileJwtWithIdError {
1238    DefaultResponse(models::Errors),
1239    UnknownValue(serde_json::Value),
1240}
1241
1242/// struct for typed errors of method [`register`]
1243#[derive(Debug, Clone, Serialize, Deserialize)]
1244#[serde(untagged)]
1245pub enum RegisterError {
1246    DefaultResponse(models::Errors),
1247    UnknownValue(serde_json::Value),
1248}
1249
1250/// struct for typed errors of method [`register_with_id`]
1251#[derive(Debug, Clone, Serialize, Deserialize)]
1252#[serde(untagged)]
1253pub enum RegisterWithIdError {
1254    DefaultResponse(models::Errors),
1255    UnknownValue(serde_json::Value),
1256}
1257
1258/// struct for typed errors of method [`reindex_with_id`]
1259#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum ReindexWithIdError {
1262    DefaultResponse(models::Errors),
1263    UnknownValue(serde_json::Value),
1264}
1265
1266/// struct for typed errors of method [`remove_user_from_family_with_id`]
1267#[derive(Debug, Clone, Serialize, Deserialize)]
1268#[serde(untagged)]
1269pub enum RemoveUserFromFamilyWithIdError {
1270    DefaultResponse(models::Errors),
1271    UnknownValue(serde_json::Value),
1272}
1273
1274/// struct for typed errors of method [`retrieve_action_with_id`]
1275#[derive(Debug, Clone, Serialize, Deserialize)]
1276#[serde(untagged)]
1277pub enum RetrieveActionWithIdError {
1278    DefaultResponse(models::Errors),
1279    UnknownValue(serde_json::Value),
1280}
1281
1282/// struct for typed errors of method [`retrieve_api_key_with_id`]
1283#[derive(Debug, Clone, Serialize, Deserialize)]
1284#[serde(untagged)]
1285pub enum RetrieveApiKeyWithIdError {
1286    DefaultResponse(models::Errors),
1287    UnknownValue(serde_json::Value),
1288}
1289
1290/// struct for typed errors of method [`retrieve_application`]
1291#[derive(Debug, Clone, Serialize, Deserialize)]
1292#[serde(untagged)]
1293pub enum RetrieveApplicationError {
1294    DefaultResponse(),
1295    UnknownValue(serde_json::Value),
1296}
1297
1298/// struct for typed errors of method [`retrieve_application_with_id`]
1299#[derive(Debug, Clone, Serialize, Deserialize)]
1300#[serde(untagged)]
1301pub enum RetrieveApplicationWithIdError {
1302    DefaultResponse(),
1303    UnknownValue(serde_json::Value),
1304}
1305
1306/// struct for typed errors of method [`retrieve_audit_log_with_id`]
1307#[derive(Debug, Clone, Serialize, Deserialize)]
1308#[serde(untagged)]
1309pub enum RetrieveAuditLogWithIdError {
1310    DefaultResponse(models::Errors),
1311    UnknownValue(serde_json::Value),
1312}
1313
1314/// struct for typed errors of method [`retrieve_connector_with_id`]
1315#[derive(Debug, Clone, Serialize, Deserialize)]
1316#[serde(untagged)]
1317pub enum RetrieveConnectorWithIdError {
1318    DefaultResponse(),
1319    UnknownValue(serde_json::Value),
1320}
1321
1322/// struct for typed errors of method [`retrieve_consent_with_id`]
1323#[derive(Debug, Clone, Serialize, Deserialize)]
1324#[serde(untagged)]
1325pub enum RetrieveConsentWithIdError {
1326    DefaultResponse(),
1327    UnknownValue(serde_json::Value),
1328}
1329
1330/// struct for typed errors of method [`retrieve_daily_active_report_with_id`]
1331#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum RetrieveDailyActiveReportWithIdError {
1334    DefaultResponse(models::Errors),
1335    UnknownValue(serde_json::Value),
1336}
1337
1338/// struct for typed errors of method [`retrieve_device_user_code`]
1339#[derive(Debug, Clone, Serialize, Deserialize)]
1340#[serde(untagged)]
1341pub enum RetrieveDeviceUserCodeError {
1342    DefaultResponse(),
1343    UnknownValue(serde_json::Value),
1344}
1345
1346/// struct for typed errors of method [`retrieve_email_template`]
1347#[derive(Debug, Clone, Serialize, Deserialize)]
1348#[serde(untagged)]
1349pub enum RetrieveEmailTemplateError {
1350    DefaultResponse(),
1351    UnknownValue(serde_json::Value),
1352}
1353
1354/// struct for typed errors of method [`retrieve_email_template_preview_with_id`]
1355#[derive(Debug, Clone, Serialize, Deserialize)]
1356#[serde(untagged)]
1357pub enum RetrieveEmailTemplatePreviewWithIdError {
1358    DefaultResponse(models::Errors),
1359    UnknownValue(serde_json::Value),
1360}
1361
1362/// struct for typed errors of method [`retrieve_email_template_with_id`]
1363#[derive(Debug, Clone, Serialize, Deserialize)]
1364#[serde(untagged)]
1365pub enum RetrieveEmailTemplateWithIdError {
1366    DefaultResponse(),
1367    UnknownValue(serde_json::Value),
1368}
1369
1370/// struct for typed errors of method [`retrieve_entity_grant_with_id`]
1371#[derive(Debug, Clone, Serialize, Deserialize)]
1372#[serde(untagged)]
1373pub enum RetrieveEntityGrantWithIdError {
1374    DefaultResponse(models::Errors),
1375    UnknownValue(serde_json::Value),
1376}
1377
1378/// struct for typed errors of method [`retrieve_entity_type_with_id`]
1379#[derive(Debug, Clone, Serialize, Deserialize)]
1380#[serde(untagged)]
1381pub enum RetrieveEntityTypeWithIdError {
1382    DefaultResponse(models::Errors),
1383    UnknownValue(serde_json::Value),
1384}
1385
1386/// struct for typed errors of method [`retrieve_entity_with_id`]
1387#[derive(Debug, Clone, Serialize, Deserialize)]
1388#[serde(untagged)]
1389pub enum RetrieveEntityWithIdError {
1390    DefaultResponse(models::Errors),
1391    UnknownValue(serde_json::Value),
1392}
1393
1394/// struct for typed errors of method [`retrieve_event_log_with_id`]
1395#[derive(Debug, Clone, Serialize, Deserialize)]
1396#[serde(untagged)]
1397pub enum RetrieveEventLogWithIdError {
1398    DefaultResponse(models::Errors),
1399    UnknownValue(serde_json::Value),
1400}
1401
1402/// struct for typed errors of method [`retrieve_families_with_id`]
1403#[derive(Debug, Clone, Serialize, Deserialize)]
1404#[serde(untagged)]
1405pub enum RetrieveFamiliesWithIdError {
1406    DefaultResponse(),
1407    UnknownValue(serde_json::Value),
1408}
1409
1410/// struct for typed errors of method [`retrieve_family_members_by_family_id_with_id`]
1411#[derive(Debug, Clone, Serialize, Deserialize)]
1412#[serde(untagged)]
1413pub enum RetrieveFamilyMembersByFamilyIdWithIdError {
1414    DefaultResponse(),
1415    UnknownValue(serde_json::Value),
1416}
1417
1418/// struct for typed errors of method [`retrieve_form_field_with_id`]
1419#[derive(Debug, Clone, Serialize, Deserialize)]
1420#[serde(untagged)]
1421pub enum RetrieveFormFieldWithIdError {
1422    DefaultResponse(),
1423    UnknownValue(serde_json::Value),
1424}
1425
1426/// struct for typed errors of method [`retrieve_form_with_id`]
1427#[derive(Debug, Clone, Serialize, Deserialize)]
1428#[serde(untagged)]
1429pub enum RetrieveFormWithIdError {
1430    DefaultResponse(),
1431    UnknownValue(serde_json::Value),
1432}
1433
1434/// struct for typed errors of method [`retrieve_group_with_id`]
1435#[derive(Debug, Clone, Serialize, Deserialize)]
1436#[serde(untagged)]
1437pub enum RetrieveGroupWithIdError {
1438    DefaultResponse(models::Errors),
1439    UnknownValue(serde_json::Value),
1440}
1441
1442/// struct for typed errors of method [`retrieve_identity_provider_by_type_with_id`]
1443#[derive(Debug, Clone, Serialize, Deserialize)]
1444#[serde(untagged)]
1445pub enum RetrieveIdentityProviderByTypeWithIdError {
1446    DefaultResponse(models::Errors),
1447    UnknownValue(serde_json::Value),
1448}
1449
1450/// struct for typed errors of method [`retrieve_identity_provider_link`]
1451#[derive(Debug, Clone, Serialize, Deserialize)]
1452#[serde(untagged)]
1453pub enum RetrieveIdentityProviderLinkError {
1454    DefaultResponse(models::Errors),
1455    UnknownValue(serde_json::Value),
1456}
1457
1458/// struct for typed errors of method [`retrieve_identity_provider_with_id`]
1459#[derive(Debug, Clone, Serialize, Deserialize)]
1460#[serde(untagged)]
1461pub enum RetrieveIdentityProviderWithIdError {
1462    DefaultResponse(models::Errors),
1463    UnknownValue(serde_json::Value),
1464}
1465
1466/// struct for typed errors of method [`retrieve_ip_access_control_list_with_id`]
1467#[derive(Debug, Clone, Serialize, Deserialize)]
1468#[serde(untagged)]
1469pub enum RetrieveIpAccessControlListWithIdError {
1470    DefaultResponse(),
1471    UnknownValue(serde_json::Value),
1472}
1473
1474/// struct for typed errors of method [`retrieve_json_web_key_set_with_id`]
1475#[derive(Debug, Clone, Serialize, Deserialize)]
1476#[serde(untagged)]
1477pub enum RetrieveJsonWebKeySetWithIdError {
1478    DefaultResponse(),
1479    UnknownValue(serde_json::Value),
1480}
1481
1482/// struct for typed errors of method [`retrieve_jwt_public_key`]
1483#[derive(Debug, Clone, Serialize, Deserialize)]
1484#[serde(untagged)]
1485pub enum RetrieveJwtPublicKeyError {
1486    DefaultResponse(),
1487    UnknownValue(serde_json::Value),
1488}
1489
1490/// struct for typed errors of method [`retrieve_key_with_id`]
1491#[derive(Debug, Clone, Serialize, Deserialize)]
1492#[serde(untagged)]
1493pub enum RetrieveKeyWithIdError {
1494    DefaultResponse(models::Errors),
1495    UnknownValue(serde_json::Value),
1496}
1497
1498/// struct for typed errors of method [`retrieve_keys_with_id`]
1499#[derive(Debug, Clone, Serialize, Deserialize)]
1500#[serde(untagged)]
1501pub enum RetrieveKeysWithIdError {
1502    DefaultResponse(),
1503    UnknownValue(serde_json::Value),
1504}
1505
1506/// struct for typed errors of method [`retrieve_lambda_with_id`]
1507#[derive(Debug, Clone, Serialize, Deserialize)]
1508#[serde(untagged)]
1509pub enum RetrieveLambdaWithIdError {
1510    DefaultResponse(models::Errors),
1511    UnknownValue(serde_json::Value),
1512}
1513
1514/// struct for typed errors of method [`retrieve_lambdas_by_type_with_id`]
1515#[derive(Debug, Clone, Serialize, Deserialize)]
1516#[serde(untagged)]
1517pub enum RetrieveLambdasByTypeWithIdError {
1518    DefaultResponse(),
1519    UnknownValue(serde_json::Value),
1520}
1521
1522/// struct for typed errors of method [`retrieve_message_template`]
1523#[derive(Debug, Clone, Serialize, Deserialize)]
1524#[serde(untagged)]
1525pub enum RetrieveMessageTemplateError {
1526    DefaultResponse(),
1527    UnknownValue(serde_json::Value),
1528}
1529
1530/// struct for typed errors of method [`retrieve_message_template_preview_with_id`]
1531#[derive(Debug, Clone, Serialize, Deserialize)]
1532#[serde(untagged)]
1533pub enum RetrieveMessageTemplatePreviewWithIdError {
1534    DefaultResponse(models::Errors),
1535    UnknownValue(serde_json::Value),
1536}
1537
1538/// struct for typed errors of method [`retrieve_message_template_with_id`]
1539#[derive(Debug, Clone, Serialize, Deserialize)]
1540#[serde(untagged)]
1541pub enum RetrieveMessageTemplateWithIdError {
1542    DefaultResponse(),
1543    UnknownValue(serde_json::Value),
1544}
1545
1546/// struct for typed errors of method [`retrieve_messenger_with_id`]
1547#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(untagged)]
1549pub enum RetrieveMessengerWithIdError {
1550    DefaultResponse(),
1551    UnknownValue(serde_json::Value),
1552}
1553
1554/// struct for typed errors of method [`retrieve_monthly_active_report_with_id`]
1555#[derive(Debug, Clone, Serialize, Deserialize)]
1556#[serde(untagged)]
1557pub enum RetrieveMonthlyActiveReportWithIdError {
1558    DefaultResponse(models::Errors),
1559    UnknownValue(serde_json::Value),
1560}
1561
1562/// struct for typed errors of method [`retrieve_o_auth_scope_with_id`]
1563#[derive(Debug, Clone, Serialize, Deserialize)]
1564#[serde(untagged)]
1565pub enum RetrieveOAuthScopeWithIdError {
1566    DefaultResponse(models::Errors),
1567    UnknownValue(serde_json::Value),
1568}
1569
1570/// struct for typed errors of method [`retrieve_oauth_configuration_with_id`]
1571#[derive(Debug, Clone, Serialize, Deserialize)]
1572#[serde(untagged)]
1573pub enum RetrieveOauthConfigurationWithIdError {
1574    DefaultResponse(models::Errors),
1575    UnknownValue(serde_json::Value),
1576}
1577
1578/// struct for typed errors of method [`retrieve_open_id_configuration_with_id`]
1579#[derive(Debug, Clone, Serialize, Deserialize)]
1580#[serde(untagged)]
1581pub enum RetrieveOpenIdConfigurationWithIdError {
1582    DefaultResponse(),
1583    UnknownValue(serde_json::Value),
1584}
1585
1586/// struct for typed errors of method [`retrieve_password_validation_rules_with_id`]
1587#[derive(Debug, Clone, Serialize, Deserialize)]
1588#[serde(untagged)]
1589pub enum RetrievePasswordValidationRulesWithIdError {
1590    DefaultResponse(),
1591    UnknownValue(serde_json::Value),
1592}
1593
1594/// struct for typed errors of method [`retrieve_password_validation_rules_with_tenant_id_with_id`]
1595#[derive(Debug, Clone, Serialize, Deserialize)]
1596#[serde(untagged)]
1597pub enum RetrievePasswordValidationRulesWithTenantIdWithIdError {
1598    DefaultResponse(),
1599    UnknownValue(serde_json::Value),
1600}
1601
1602/// struct for typed errors of method [`retrieve_pending_children_with_id`]
1603#[derive(Debug, Clone, Serialize, Deserialize)]
1604#[serde(untagged)]
1605pub enum RetrievePendingChildrenWithIdError {
1606    DefaultResponse(models::Errors),
1607    UnknownValue(serde_json::Value),
1608}
1609
1610/// struct for typed errors of method [`retrieve_pending_link_with_id`]
1611#[derive(Debug, Clone, Serialize, Deserialize)]
1612#[serde(untagged)]
1613pub enum RetrievePendingLinkWithIdError {
1614    DefaultResponse(models::Errors),
1615    UnknownValue(serde_json::Value),
1616}
1617
1618/// struct for typed errors of method [`retrieve_reactor_metrics_with_id`]
1619#[derive(Debug, Clone, Serialize, Deserialize)]
1620#[serde(untagged)]
1621pub enum RetrieveReactorMetricsWithIdError {
1622    DefaultResponse(),
1623    UnknownValue(serde_json::Value),
1624}
1625
1626/// struct for typed errors of method [`retrieve_refresh_token_by_id_with_id`]
1627#[derive(Debug, Clone, Serialize, Deserialize)]
1628#[serde(untagged)]
1629pub enum RetrieveRefreshTokenByIdWithIdError {
1630    DefaultResponse(models::Errors),
1631    UnknownValue(serde_json::Value),
1632}
1633
1634/// struct for typed errors of method [`retrieve_refresh_tokens_with_id`]
1635#[derive(Debug, Clone, Serialize, Deserialize)]
1636#[serde(untagged)]
1637pub enum RetrieveRefreshTokensWithIdError {
1638    DefaultResponse(models::Errors),
1639    UnknownValue(serde_json::Value),
1640}
1641
1642/// struct for typed errors of method [`retrieve_registration_report_with_id`]
1643#[derive(Debug, Clone, Serialize, Deserialize)]
1644#[serde(untagged)]
1645pub enum RetrieveRegistrationReportWithIdError {
1646    DefaultResponse(models::Errors),
1647    UnknownValue(serde_json::Value),
1648}
1649
1650/// struct for typed errors of method [`retrieve_registration_with_id`]
1651#[derive(Debug, Clone, Serialize, Deserialize)]
1652#[serde(untagged)]
1653pub enum RetrieveRegistrationWithIdError {
1654    DefaultResponse(models::Errors),
1655    UnknownValue(serde_json::Value),
1656}
1657
1658/// struct for typed errors of method [`retrieve_report_login`]
1659#[derive(Debug, Clone, Serialize, Deserialize)]
1660#[serde(untagged)]
1661pub enum RetrieveReportLoginError {
1662    DefaultResponse(models::Errors),
1663    UnknownValue(serde_json::Value),
1664}
1665
1666/// struct for typed errors of method [`retrieve_status`]
1667#[derive(Debug, Clone, Serialize, Deserialize)]
1668#[serde(untagged)]
1669pub enum RetrieveStatusError {
1670    DefaultResponse(),
1671    UnknownValue(serde_json::Value),
1672}
1673
1674/// struct for typed errors of method [`retrieve_system_health_with_id`]
1675#[derive(Debug, Clone, Serialize, Deserialize)]
1676#[serde(untagged)]
1677pub enum RetrieveSystemHealthWithIdError {
1678    DefaultResponse(),
1679    UnknownValue(serde_json::Value),
1680}
1681
1682/// struct for typed errors of method [`retrieve_tenant_with_id`]
1683#[derive(Debug, Clone, Serialize, Deserialize)]
1684#[serde(untagged)]
1685pub enum RetrieveTenantWithIdError {
1686    DefaultResponse(models::Errors),
1687    UnknownValue(serde_json::Value),
1688}
1689
1690/// struct for typed errors of method [`retrieve_theme_with_id`]
1691#[derive(Debug, Clone, Serialize, Deserialize)]
1692#[serde(untagged)]
1693pub enum RetrieveThemeWithIdError {
1694    DefaultResponse(models::Errors),
1695    UnknownValue(serde_json::Value),
1696}
1697
1698/// struct for typed errors of method [`retrieve_total_report_with_id`]
1699#[derive(Debug, Clone, Serialize, Deserialize)]
1700#[serde(untagged)]
1701pub enum RetrieveTotalReportWithIdError {
1702    DefaultResponse(),
1703    UnknownValue(serde_json::Value),
1704}
1705
1706/// struct for typed errors of method [`retrieve_two_factor_recovery_codes_with_id`]
1707#[derive(Debug, Clone, Serialize, Deserialize)]
1708#[serde(untagged)]
1709pub enum RetrieveTwoFactorRecoveryCodesWithIdError {
1710    DefaultResponse(models::Errors),
1711    UnknownValue(serde_json::Value),
1712}
1713
1714/// struct for typed errors of method [`retrieve_two_factor_status_with_id`]
1715#[derive(Debug, Clone, Serialize, Deserialize)]
1716#[serde(untagged)]
1717pub enum RetrieveTwoFactorStatusWithIdError {
1718    DefaultResponse(models::Errors),
1719    UnknownValue(serde_json::Value),
1720}
1721
1722/// struct for typed errors of method [`retrieve_user`]
1723#[derive(Debug, Clone, Serialize, Deserialize)]
1724#[serde(untagged)]
1725pub enum RetrieveUserError {
1726    DefaultResponse(models::Errors),
1727    UnknownValue(serde_json::Value),
1728}
1729
1730/// struct for typed errors of method [`retrieve_user_action`]
1731#[derive(Debug, Clone, Serialize, Deserialize)]
1732#[serde(untagged)]
1733pub enum RetrieveUserActionError {
1734    DefaultResponse(),
1735    UnknownValue(serde_json::Value),
1736}
1737
1738/// struct for typed errors of method [`retrieve_user_action_reason`]
1739#[derive(Debug, Clone, Serialize, Deserialize)]
1740#[serde(untagged)]
1741pub enum RetrieveUserActionReasonError {
1742    DefaultResponse(),
1743    UnknownValue(serde_json::Value),
1744}
1745
1746/// struct for typed errors of method [`retrieve_user_action_reason_with_id`]
1747#[derive(Debug, Clone, Serialize, Deserialize)]
1748#[serde(untagged)]
1749pub enum RetrieveUserActionReasonWithIdError {
1750    DefaultResponse(),
1751    UnknownValue(serde_json::Value),
1752}
1753
1754/// struct for typed errors of method [`retrieve_user_action_with_id`]
1755#[derive(Debug, Clone, Serialize, Deserialize)]
1756#[serde(untagged)]
1757pub enum RetrieveUserActionWithIdError {
1758    DefaultResponse(),
1759    UnknownValue(serde_json::Value),
1760}
1761
1762/// struct for typed errors of method [`retrieve_user_actioning`]
1763#[derive(Debug, Clone, Serialize, Deserialize)]
1764#[serde(untagged)]
1765pub enum RetrieveUserActioningError {
1766    DefaultResponse(models::Errors),
1767    UnknownValue(serde_json::Value),
1768}
1769
1770/// struct for typed errors of method [`retrieve_user_change_password`]
1771#[derive(Debug, Clone, Serialize, Deserialize)]
1772#[serde(untagged)]
1773pub enum RetrieveUserChangePasswordError {
1774    DefaultResponse(models::Errors),
1775    UnknownValue(serde_json::Value),
1776}
1777
1778/// struct for typed errors of method [`retrieve_user_comments_with_id`]
1779#[derive(Debug, Clone, Serialize, Deserialize)]
1780#[serde(untagged)]
1781pub enum RetrieveUserCommentsWithIdError {
1782    DefaultResponse(models::Errors),
1783    UnknownValue(serde_json::Value),
1784}
1785
1786/// struct for typed errors of method [`retrieve_user_consent_with_id`]
1787#[derive(Debug, Clone, Serialize, Deserialize)]
1788#[serde(untagged)]
1789pub enum RetrieveUserConsentWithIdError {
1790    DefaultResponse(),
1791    UnknownValue(serde_json::Value),
1792}
1793
1794/// struct for typed errors of method [`retrieve_user_consents_with_id`]
1795#[derive(Debug, Clone, Serialize, Deserialize)]
1796#[serde(untagged)]
1797pub enum RetrieveUserConsentsWithIdError {
1798    DefaultResponse(),
1799    UnknownValue(serde_json::Value),
1800}
1801
1802/// struct for typed errors of method [`retrieve_user_info_from_access_token_with_id`]
1803#[derive(Debug, Clone, Serialize, Deserialize)]
1804#[serde(untagged)]
1805pub enum RetrieveUserInfoFromAccessTokenWithIdError {
1806    DefaultResponse(models::OAuthError),
1807    UnknownValue(serde_json::Value),
1808}
1809
1810/// struct for typed errors of method [`retrieve_user_recent_login`]
1811#[derive(Debug, Clone, Serialize, Deserialize)]
1812#[serde(untagged)]
1813pub enum RetrieveUserRecentLoginError {
1814    DefaultResponse(models::Errors),
1815    UnknownValue(serde_json::Value),
1816}
1817
1818/// struct for typed errors of method [`retrieve_user_with_id`]
1819#[derive(Debug, Clone, Serialize, Deserialize)]
1820#[serde(untagged)]
1821pub enum RetrieveUserWithIdError {
1822    DefaultResponse(models::Errors),
1823    UnknownValue(serde_json::Value),
1824}
1825
1826/// struct for typed errors of method [`retrieve_version_with_id`]
1827#[derive(Debug, Clone, Serialize, Deserialize)]
1828#[serde(untagged)]
1829pub enum RetrieveVersionWithIdError {
1830    DefaultResponse(models::Errors),
1831    UnknownValue(serde_json::Value),
1832}
1833
1834/// struct for typed errors of method [`retrieve_web_authn_credential_with_id`]
1835#[derive(Debug, Clone, Serialize, Deserialize)]
1836#[serde(untagged)]
1837pub enum RetrieveWebAuthnCredentialWithIdError {
1838    DefaultResponse(models::Errors),
1839    UnknownValue(serde_json::Value),
1840}
1841
1842/// struct for typed errors of method [`retrieve_web_authn_credentials_for_user_with_id`]
1843#[derive(Debug, Clone, Serialize, Deserialize)]
1844#[serde(untagged)]
1845pub enum RetrieveWebAuthnCredentialsForUserWithIdError {
1846    DefaultResponse(models::Errors),
1847    UnknownValue(serde_json::Value),
1848}
1849
1850/// struct for typed errors of method [`retrieve_webhook`]
1851#[derive(Debug, Clone, Serialize, Deserialize)]
1852#[serde(untagged)]
1853pub enum RetrieveWebhookError {
1854    DefaultResponse(),
1855    UnknownValue(serde_json::Value),
1856}
1857
1858/// struct for typed errors of method [`retrieve_webhook_attempt_log_with_id`]
1859#[derive(Debug, Clone, Serialize, Deserialize)]
1860#[serde(untagged)]
1861pub enum RetrieveWebhookAttemptLogWithIdError {
1862    DefaultResponse(models::Errors),
1863    UnknownValue(serde_json::Value),
1864}
1865
1866/// struct for typed errors of method [`retrieve_webhook_event_log_with_id`]
1867#[derive(Debug, Clone, Serialize, Deserialize)]
1868#[serde(untagged)]
1869pub enum RetrieveWebhookEventLogWithIdError {
1870    DefaultResponse(models::Errors),
1871    UnknownValue(serde_json::Value),
1872}
1873
1874/// struct for typed errors of method [`retrieve_webhook_with_id`]
1875#[derive(Debug, Clone, Serialize, Deserialize)]
1876#[serde(untagged)]
1877pub enum RetrieveWebhookWithIdError {
1878    DefaultResponse(),
1879    UnknownValue(serde_json::Value),
1880}
1881
1882/// struct for typed errors of method [`revoke_refresh_token_by_id_with_id`]
1883#[derive(Debug, Clone, Serialize, Deserialize)]
1884#[serde(untagged)]
1885pub enum RevokeRefreshTokenByIdWithIdError {
1886    DefaultResponse(models::Errors),
1887    UnknownValue(serde_json::Value),
1888}
1889
1890/// struct for typed errors of method [`revoke_user_consent_with_id`]
1891#[derive(Debug, Clone, Serialize, Deserialize)]
1892#[serde(untagged)]
1893pub enum RevokeUserConsentWithIdError {
1894    DefaultResponse(),
1895    UnknownValue(serde_json::Value),
1896}
1897
1898/// struct for typed errors of method [`search_applications_with_id`]
1899#[derive(Debug, Clone, Serialize, Deserialize)]
1900#[serde(untagged)]
1901pub enum SearchApplicationsWithIdError {
1902    DefaultResponse(models::Errors),
1903    UnknownValue(serde_json::Value),
1904}
1905
1906/// struct for typed errors of method [`search_audit_logs_with_id`]
1907#[derive(Debug, Clone, Serialize, Deserialize)]
1908#[serde(untagged)]
1909pub enum SearchAuditLogsWithIdError {
1910    DefaultResponse(models::Errors),
1911    UnknownValue(serde_json::Value),
1912}
1913
1914/// struct for typed errors of method [`search_consents_with_id`]
1915#[derive(Debug, Clone, Serialize, Deserialize)]
1916#[serde(untagged)]
1917pub enum SearchConsentsWithIdError {
1918    DefaultResponse(models::Errors),
1919    UnknownValue(serde_json::Value),
1920}
1921
1922/// struct for typed errors of method [`search_email_templates_with_id`]
1923#[derive(Debug, Clone, Serialize, Deserialize)]
1924#[serde(untagged)]
1925pub enum SearchEmailTemplatesWithIdError {
1926    DefaultResponse(models::Errors),
1927    UnknownValue(serde_json::Value),
1928}
1929
1930/// struct for typed errors of method [`search_entities_by_ids_with_id`]
1931#[derive(Debug, Clone, Serialize, Deserialize)]
1932#[serde(untagged)]
1933pub enum SearchEntitiesByIdsWithIdError {
1934    DefaultResponse(models::Errors),
1935    UnknownValue(serde_json::Value),
1936}
1937
1938/// struct for typed errors of method [`search_entities_with_id`]
1939#[derive(Debug, Clone, Serialize, Deserialize)]
1940#[serde(untagged)]
1941pub enum SearchEntitiesWithIdError {
1942    DefaultResponse(models::Errors),
1943    UnknownValue(serde_json::Value),
1944}
1945
1946/// struct for typed errors of method [`search_entity_grants_with_id`]
1947#[derive(Debug, Clone, Serialize, Deserialize)]
1948#[serde(untagged)]
1949pub enum SearchEntityGrantsWithIdError {
1950    DefaultResponse(models::Errors),
1951    UnknownValue(serde_json::Value),
1952}
1953
1954/// struct for typed errors of method [`search_entity_types_with_id`]
1955#[derive(Debug, Clone, Serialize, Deserialize)]
1956#[serde(untagged)]
1957pub enum SearchEntityTypesWithIdError {
1958    DefaultResponse(models::Errors),
1959    UnknownValue(serde_json::Value),
1960}
1961
1962/// struct for typed errors of method [`search_event_logs_with_id`]
1963#[derive(Debug, Clone, Serialize, Deserialize)]
1964#[serde(untagged)]
1965pub enum SearchEventLogsWithIdError {
1966    DefaultResponse(models::Errors),
1967    UnknownValue(serde_json::Value),
1968}
1969
1970/// struct for typed errors of method [`search_group_members_with_id`]
1971#[derive(Debug, Clone, Serialize, Deserialize)]
1972#[serde(untagged)]
1973pub enum SearchGroupMembersWithIdError {
1974    DefaultResponse(models::Errors),
1975    UnknownValue(serde_json::Value),
1976}
1977
1978/// struct for typed errors of method [`search_groups_with_id`]
1979#[derive(Debug, Clone, Serialize, Deserialize)]
1980#[serde(untagged)]
1981pub enum SearchGroupsWithIdError {
1982    DefaultResponse(models::Errors),
1983    UnknownValue(serde_json::Value),
1984}
1985
1986/// struct for typed errors of method [`search_identity_providers_with_id`]
1987#[derive(Debug, Clone, Serialize, Deserialize)]
1988#[serde(untagged)]
1989pub enum SearchIdentityProvidersWithIdError {
1990    DefaultResponse(models::Errors),
1991    UnknownValue(serde_json::Value),
1992}
1993
1994/// struct for typed errors of method [`search_ip_access_control_lists_with_id`]
1995#[derive(Debug, Clone, Serialize, Deserialize)]
1996#[serde(untagged)]
1997pub enum SearchIpAccessControlListsWithIdError {
1998    DefaultResponse(models::Errors),
1999    UnknownValue(serde_json::Value),
2000}
2001
2002/// struct for typed errors of method [`search_keys_with_id`]
2003#[derive(Debug, Clone, Serialize, Deserialize)]
2004#[serde(untagged)]
2005pub enum SearchKeysWithIdError {
2006    DefaultResponse(models::Errors),
2007    UnknownValue(serde_json::Value),
2008}
2009
2010/// struct for typed errors of method [`search_lambdas_with_id`]
2011#[derive(Debug, Clone, Serialize, Deserialize)]
2012#[serde(untagged)]
2013pub enum SearchLambdasWithIdError {
2014    DefaultResponse(models::Errors),
2015    UnknownValue(serde_json::Value),
2016}
2017
2018/// struct for typed errors of method [`search_login_records_with_id`]
2019#[derive(Debug, Clone, Serialize, Deserialize)]
2020#[serde(untagged)]
2021pub enum SearchLoginRecordsWithIdError {
2022    DefaultResponse(models::Errors),
2023    UnknownValue(serde_json::Value),
2024}
2025
2026/// struct for typed errors of method [`search_tenants_with_id`]
2027#[derive(Debug, Clone, Serialize, Deserialize)]
2028#[serde(untagged)]
2029pub enum SearchTenantsWithIdError {
2030    DefaultResponse(models::Errors),
2031    UnknownValue(serde_json::Value),
2032}
2033
2034/// struct for typed errors of method [`search_themes_with_id`]
2035#[derive(Debug, Clone, Serialize, Deserialize)]
2036#[serde(untagged)]
2037pub enum SearchThemesWithIdError {
2038    DefaultResponse(models::Errors),
2039    UnknownValue(serde_json::Value),
2040}
2041
2042/// struct for typed errors of method [`search_user_comments_with_id`]
2043#[derive(Debug, Clone, Serialize, Deserialize)]
2044#[serde(untagged)]
2045pub enum SearchUserCommentsWithIdError {
2046    DefaultResponse(models::Errors),
2047    UnknownValue(serde_json::Value),
2048}
2049
2050/// struct for typed errors of method [`search_users_by_ids_with_id`]
2051#[derive(Debug, Clone, Serialize, Deserialize)]
2052#[serde(untagged)]
2053pub enum SearchUsersByIdsWithIdError {
2054    DefaultResponse(models::Errors),
2055    UnknownValue(serde_json::Value),
2056}
2057
2058/// struct for typed errors of method [`search_users_by_query_with_id`]
2059#[derive(Debug, Clone, Serialize, Deserialize)]
2060#[serde(untagged)]
2061pub enum SearchUsersByQueryWithIdError {
2062    DefaultResponse(models::Errors),
2063    UnknownValue(serde_json::Value),
2064}
2065
2066/// struct for typed errors of method [`search_webhook_event_logs_with_id`]
2067#[derive(Debug, Clone, Serialize, Deserialize)]
2068#[serde(untagged)]
2069pub enum SearchWebhookEventLogsWithIdError {
2070    DefaultResponse(models::Errors),
2071    UnknownValue(serde_json::Value),
2072}
2073
2074/// struct for typed errors of method [`search_webhooks_with_id`]
2075#[derive(Debug, Clone, Serialize, Deserialize)]
2076#[serde(untagged)]
2077pub enum SearchWebhooksWithIdError {
2078    DefaultResponse(models::Errors),
2079    UnknownValue(serde_json::Value),
2080}
2081
2082/// struct for typed errors of method [`send_email_with_id`]
2083#[derive(Debug, Clone, Serialize, Deserialize)]
2084#[serde(untagged)]
2085pub enum SendEmailWithIdError {
2086    DefaultResponse(models::Errors),
2087    UnknownValue(serde_json::Value),
2088}
2089
2090/// struct for typed errors of method [`send_family_request_email_with_id`]
2091#[derive(Debug, Clone, Serialize, Deserialize)]
2092#[serde(untagged)]
2093pub enum SendFamilyRequestEmailWithIdError {
2094    DefaultResponse(models::Errors),
2095    UnknownValue(serde_json::Value),
2096}
2097
2098/// struct for typed errors of method [`send_passwordless_code_with_id`]
2099#[derive(Debug, Clone, Serialize, Deserialize)]
2100#[serde(untagged)]
2101pub enum SendPasswordlessCodeWithIdError {
2102    DefaultResponse(models::Errors),
2103    UnknownValue(serde_json::Value),
2104}
2105
2106/// struct for typed errors of method [`send_two_factor_code_for_enable_disable_with_id`]
2107#[derive(Debug, Clone, Serialize, Deserialize)]
2108#[serde(untagged)]
2109pub enum SendTwoFactorCodeForEnableDisableWithIdError {
2110    DefaultResponse(models::Errors),
2111    UnknownValue(serde_json::Value),
2112}
2113
2114/// struct for typed errors of method [`send_two_factor_code_for_login_using_method_with_id`]
2115#[derive(Debug, Clone, Serialize, Deserialize)]
2116#[serde(untagged)]
2117pub enum SendTwoFactorCodeForLoginUsingMethodWithIdError {
2118    DefaultResponse(models::Errors),
2119    UnknownValue(serde_json::Value),
2120}
2121
2122/// struct for typed errors of method [`send_verify_identity_with_id`]
2123#[derive(Debug, Clone, Serialize, Deserialize)]
2124#[serde(untagged)]
2125pub enum SendVerifyIdentityWithIdError {
2126    DefaultResponse(models::Errors),
2127    UnknownValue(serde_json::Value),
2128}
2129
2130/// struct for typed errors of method [`start_identity_provider_login_with_id`]
2131#[derive(Debug, Clone, Serialize, Deserialize)]
2132#[serde(untagged)]
2133pub enum StartIdentityProviderLoginWithIdError {
2134    DefaultResponse(models::Errors),
2135    UnknownValue(serde_json::Value),
2136}
2137
2138/// struct for typed errors of method [`start_passwordless_login_with_id`]
2139#[derive(Debug, Clone, Serialize, Deserialize)]
2140#[serde(untagged)]
2141pub enum StartPasswordlessLoginWithIdError {
2142    DefaultResponse(models::Errors),
2143    UnknownValue(serde_json::Value),
2144}
2145
2146/// struct for typed errors of method [`start_two_factor_login_with_id`]
2147#[derive(Debug, Clone, Serialize, Deserialize)]
2148#[serde(untagged)]
2149pub enum StartTwoFactorLoginWithIdError {
2150    DefaultResponse(models::Errors),
2151    UnknownValue(serde_json::Value),
2152}
2153
2154/// struct for typed errors of method [`start_verify_identity_with_id`]
2155#[derive(Debug, Clone, Serialize, Deserialize)]
2156#[serde(untagged)]
2157pub enum StartVerifyIdentityWithIdError {
2158    DefaultResponse(models::Errors),
2159    UnknownValue(serde_json::Value),
2160}
2161
2162/// struct for typed errors of method [`start_web_authn_login_with_id`]
2163#[derive(Debug, Clone, Serialize, Deserialize)]
2164#[serde(untagged)]
2165pub enum StartWebAuthnLoginWithIdError {
2166    DefaultResponse(models::Errors),
2167    UnknownValue(serde_json::Value),
2168}
2169
2170/// struct for typed errors of method [`start_web_authn_registration_with_id`]
2171#[derive(Debug, Clone, Serialize, Deserialize)]
2172#[serde(untagged)]
2173pub enum StartWebAuthnRegistrationWithIdError {
2174    DefaultResponse(models::Errors),
2175    UnknownValue(serde_json::Value),
2176}
2177
2178/// struct for typed errors of method [`two_factor_login_with_id`]
2179#[derive(Debug, Clone, Serialize, Deserialize)]
2180#[serde(untagged)]
2181pub enum TwoFactorLoginWithIdError {
2182    DefaultResponse(models::Errors),
2183    UnknownValue(serde_json::Value),
2184}
2185
2186/// struct for typed errors of method [`update_api_key_with_id`]
2187#[derive(Debug, Clone, Serialize, Deserialize)]
2188#[serde(untagged)]
2189pub enum UpdateApiKeyWithIdError {
2190    DefaultResponse(models::Errors),
2191    UnknownValue(serde_json::Value),
2192}
2193
2194/// struct for typed errors of method [`update_application_role_with_id`]
2195#[derive(Debug, Clone, Serialize, Deserialize)]
2196#[serde(untagged)]
2197pub enum UpdateApplicationRoleWithIdError {
2198    DefaultResponse(models::Errors),
2199    UnknownValue(serde_json::Value),
2200}
2201
2202/// struct for typed errors of method [`update_application_with_id`]
2203#[derive(Debug, Clone, Serialize, Deserialize)]
2204#[serde(untagged)]
2205pub enum UpdateApplicationWithIdError {
2206    DefaultResponse(models::Errors),
2207    UnknownValue(serde_json::Value),
2208}
2209
2210/// struct for typed errors of method [`update_connector_with_id`]
2211#[derive(Debug, Clone, Serialize, Deserialize)]
2212#[serde(untagged)]
2213pub enum UpdateConnectorWithIdError {
2214    DefaultResponse(models::Errors),
2215    UnknownValue(serde_json::Value),
2216}
2217
2218/// struct for typed errors of method [`update_consent_with_id`]
2219#[derive(Debug, Clone, Serialize, Deserialize)]
2220#[serde(untagged)]
2221pub enum UpdateConsentWithIdError {
2222    DefaultResponse(models::Errors),
2223    UnknownValue(serde_json::Value),
2224}
2225
2226/// struct for typed errors of method [`update_email_template_with_id`]
2227#[derive(Debug, Clone, Serialize, Deserialize)]
2228#[serde(untagged)]
2229pub enum UpdateEmailTemplateWithIdError {
2230    DefaultResponse(models::Errors),
2231    UnknownValue(serde_json::Value),
2232}
2233
2234/// struct for typed errors of method [`update_entity_type_permission_with_id`]
2235#[derive(Debug, Clone, Serialize, Deserialize)]
2236#[serde(untagged)]
2237pub enum UpdateEntityTypePermissionWithIdError {
2238    DefaultResponse(models::Errors),
2239    UnknownValue(serde_json::Value),
2240}
2241
2242/// struct for typed errors of method [`update_entity_type_with_id`]
2243#[derive(Debug, Clone, Serialize, Deserialize)]
2244#[serde(untagged)]
2245pub enum UpdateEntityTypeWithIdError {
2246    DefaultResponse(models::Errors),
2247    UnknownValue(serde_json::Value),
2248}
2249
2250/// struct for typed errors of method [`update_entity_with_id`]
2251#[derive(Debug, Clone, Serialize, Deserialize)]
2252#[serde(untagged)]
2253pub enum UpdateEntityWithIdError {
2254    DefaultResponse(models::Errors),
2255    UnknownValue(serde_json::Value),
2256}
2257
2258/// struct for typed errors of method [`update_form_field_with_id`]
2259#[derive(Debug, Clone, Serialize, Deserialize)]
2260#[serde(untagged)]
2261pub enum UpdateFormFieldWithIdError {
2262    DefaultResponse(models::Errors),
2263    UnknownValue(serde_json::Value),
2264}
2265
2266/// struct for typed errors of method [`update_form_with_id`]
2267#[derive(Debug, Clone, Serialize, Deserialize)]
2268#[serde(untagged)]
2269pub enum UpdateFormWithIdError {
2270    DefaultResponse(models::Errors),
2271    UnknownValue(serde_json::Value),
2272}
2273
2274/// struct for typed errors of method [`update_group_members_with_id`]
2275#[derive(Debug, Clone, Serialize, Deserialize)]
2276#[serde(untagged)]
2277pub enum UpdateGroupMembersWithIdError {
2278    DefaultResponse(models::Errors),
2279    UnknownValue(serde_json::Value),
2280}
2281
2282/// struct for typed errors of method [`update_group_with_id`]
2283#[derive(Debug, Clone, Serialize, Deserialize)]
2284#[serde(untagged)]
2285pub enum UpdateGroupWithIdError {
2286    DefaultResponse(models::Errors),
2287    UnknownValue(serde_json::Value),
2288}
2289
2290/// struct for typed errors of method [`update_identity_provider_with_id`]
2291#[derive(Debug, Clone, Serialize, Deserialize)]
2292#[serde(untagged)]
2293pub enum UpdateIdentityProviderWithIdError {
2294    DefaultResponse(models::Errors),
2295    UnknownValue(serde_json::Value),
2296}
2297
2298/// struct for typed errors of method [`update_integrations_with_id`]
2299#[derive(Debug, Clone, Serialize, Deserialize)]
2300#[serde(untagged)]
2301pub enum UpdateIntegrationsWithIdError {
2302    DefaultResponse(models::Errors),
2303    UnknownValue(serde_json::Value),
2304}
2305
2306/// struct for typed errors of method [`update_ip_access_control_list_with_id`]
2307#[derive(Debug, Clone, Serialize, Deserialize)]
2308#[serde(untagged)]
2309pub enum UpdateIpAccessControlListWithIdError {
2310    DefaultResponse(models::Errors),
2311    UnknownValue(serde_json::Value),
2312}
2313
2314/// struct for typed errors of method [`update_key_with_id`]
2315#[derive(Debug, Clone, Serialize, Deserialize)]
2316#[serde(untagged)]
2317pub enum UpdateKeyWithIdError {
2318    DefaultResponse(models::Errors),
2319    UnknownValue(serde_json::Value),
2320}
2321
2322/// struct for typed errors of method [`update_lambda_with_id`]
2323#[derive(Debug, Clone, Serialize, Deserialize)]
2324#[serde(untagged)]
2325pub enum UpdateLambdaWithIdError {
2326    DefaultResponse(models::Errors),
2327    UnknownValue(serde_json::Value),
2328}
2329
2330/// struct for typed errors of method [`update_message_template_with_id`]
2331#[derive(Debug, Clone, Serialize, Deserialize)]
2332#[serde(untagged)]
2333pub enum UpdateMessageTemplateWithIdError {
2334    DefaultResponse(models::Errors),
2335    UnknownValue(serde_json::Value),
2336}
2337
2338/// struct for typed errors of method [`update_messenger_with_id`]
2339#[derive(Debug, Clone, Serialize, Deserialize)]
2340#[serde(untagged)]
2341pub enum UpdateMessengerWithIdError {
2342    DefaultResponse(models::Errors),
2343    UnknownValue(serde_json::Value),
2344}
2345
2346/// struct for typed errors of method [`update_o_auth_scope_with_id`]
2347#[derive(Debug, Clone, Serialize, Deserialize)]
2348#[serde(untagged)]
2349pub enum UpdateOAuthScopeWithIdError {
2350    DefaultResponse(models::Errors),
2351    UnknownValue(serde_json::Value),
2352}
2353
2354/// struct for typed errors of method [`update_registration_with_id`]
2355#[derive(Debug, Clone, Serialize, Deserialize)]
2356#[serde(untagged)]
2357pub enum UpdateRegistrationWithIdError {
2358    DefaultResponse(models::Errors),
2359    UnknownValue(serde_json::Value),
2360}
2361
2362/// struct for typed errors of method [`update_system_configuration_with_id`]
2363#[derive(Debug, Clone, Serialize, Deserialize)]
2364#[serde(untagged)]
2365pub enum UpdateSystemConfigurationWithIdError {
2366    DefaultResponse(models::Errors),
2367    UnknownValue(serde_json::Value),
2368}
2369
2370/// struct for typed errors of method [`update_tenant_with_id`]
2371#[derive(Debug, Clone, Serialize, Deserialize)]
2372#[serde(untagged)]
2373pub enum UpdateTenantWithIdError {
2374    DefaultResponse(models::Errors),
2375    UnknownValue(serde_json::Value),
2376}
2377
2378/// struct for typed errors of method [`update_theme_with_id`]
2379#[derive(Debug, Clone, Serialize, Deserialize)]
2380#[serde(untagged)]
2381pub enum UpdateThemeWithIdError {
2382    DefaultResponse(models::Errors),
2383    UnknownValue(serde_json::Value),
2384}
2385
2386/// struct for typed errors of method [`update_user_action_reason_with_id`]
2387#[derive(Debug, Clone, Serialize, Deserialize)]
2388#[serde(untagged)]
2389pub enum UpdateUserActionReasonWithIdError {
2390    DefaultResponse(models::Errors),
2391    UnknownValue(serde_json::Value),
2392}
2393
2394/// struct for typed errors of method [`update_user_action_with_id`]
2395#[derive(Debug, Clone, Serialize, Deserialize)]
2396#[serde(untagged)]
2397pub enum UpdateUserActionWithIdError {
2398    DefaultResponse(models::Errors),
2399    UnknownValue(serde_json::Value),
2400}
2401
2402/// struct for typed errors of method [`update_user_consent_with_id`]
2403#[derive(Debug, Clone, Serialize, Deserialize)]
2404#[serde(untagged)]
2405pub enum UpdateUserConsentWithIdError {
2406    DefaultResponse(models::Errors),
2407    UnknownValue(serde_json::Value),
2408}
2409
2410/// struct for typed errors of method [`update_user_family_with_id`]
2411#[derive(Debug, Clone, Serialize, Deserialize)]
2412#[serde(untagged)]
2413pub enum UpdateUserFamilyWithIdError {
2414    DefaultResponse(models::Errors),
2415    UnknownValue(serde_json::Value),
2416}
2417
2418/// struct for typed errors of method [`update_user_verify_email`]
2419#[derive(Debug, Clone, Serialize, Deserialize)]
2420#[serde(untagged)]
2421pub enum UpdateUserVerifyEmailError {
2422    DefaultResponse(models::Errors),
2423    UnknownValue(serde_json::Value),
2424}
2425
2426/// struct for typed errors of method [`update_user_verify_registration`]
2427#[derive(Debug, Clone, Serialize, Deserialize)]
2428#[serde(untagged)]
2429pub enum UpdateUserVerifyRegistrationError {
2430    DefaultResponse(models::Errors),
2431    UnknownValue(serde_json::Value),
2432}
2433
2434/// struct for typed errors of method [`update_user_with_id`]
2435#[derive(Debug, Clone, Serialize, Deserialize)]
2436#[serde(untagged)]
2437pub enum UpdateUserWithIdError {
2438    DefaultResponse(models::Errors),
2439    UnknownValue(serde_json::Value),
2440}
2441
2442/// struct for typed errors of method [`update_webhook_with_id`]
2443#[derive(Debug, Clone, Serialize, Deserialize)]
2444#[serde(untagged)]
2445pub enum UpdateWebhookWithIdError {
2446    DefaultResponse(models::Errors),
2447    UnknownValue(serde_json::Value),
2448}
2449
2450/// struct for typed errors of method [`upsert_entity_grant_with_id`]
2451#[derive(Debug, Clone, Serialize, Deserialize)]
2452#[serde(untagged)]
2453pub enum UpsertEntityGrantWithIdError {
2454    DefaultResponse(models::Errors),
2455    UnknownValue(serde_json::Value),
2456}
2457
2458/// struct for typed errors of method [`validate_device_with_id`]
2459#[derive(Debug, Clone, Serialize, Deserialize)]
2460#[serde(untagged)]
2461pub enum ValidateDeviceWithIdError {
2462    DefaultResponse(),
2463    UnknownValue(serde_json::Value),
2464}
2465
2466/// struct for typed errors of method [`validate_jwt_with_id`]
2467#[derive(Debug, Clone, Serialize, Deserialize)]
2468#[serde(untagged)]
2469pub enum ValidateJwtWithIdError {
2470    DefaultResponse(),
2471    UnknownValue(serde_json::Value),
2472}
2473
2474/// struct for typed errors of method [`vend_jwt_with_id`]
2475#[derive(Debug, Clone, Serialize, Deserialize)]
2476#[serde(untagged)]
2477pub enum VendJwtWithIdError {
2478    DefaultResponse(models::Errors),
2479    UnknownValue(serde_json::Value),
2480}
2481
2482/// struct for typed errors of method [`verify_identity_with_id`]
2483#[derive(Debug, Clone, Serialize, Deserialize)]
2484#[serde(untagged)]
2485pub enum VerifyIdentityWithIdError {
2486    DefaultResponse(models::Errors),
2487    UnknownValue(serde_json::Value),
2488}
2489
2490/// struct for typed errors of method [`verify_user_registration_with_id`]
2491#[derive(Debug, Clone, Serialize, Deserialize)]
2492#[serde(untagged)]
2493pub enum VerifyUserRegistrationWithIdError {
2494    DefaultResponse(models::Errors),
2495    UnknownValue(serde_json::Value),
2496}
2497
2498
2499/// 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.
2500pub async fn action_user_with_id(configuration: &configuration::Configuration, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<ActionUserWithIdError>> {
2501    // add a prefix to parameters to efficiently prevent name collisions
2502    let p_body_action_request = action_request;
2503
2504    let uri_str = format!("{}/api/user/action", configuration.base_path);
2505    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2506
2507    if let Some(ref user_agent) = configuration.user_agent {
2508        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2509    }
2510    if let Some(ref apikey) = configuration.api_key {
2511        let key = apikey.key.clone();
2512        let value = match apikey.prefix {
2513            Some(ref prefix) => format!("{} {}", prefix, key),
2514            None => key,
2515        };
2516        req_builder = req_builder.header("Authorization", value);
2517    };
2518    req_builder = req_builder.json(&p_body_action_request);
2519
2520    let req = req_builder.build()?;
2521    let resp = configuration.client.execute(req).await?;
2522
2523    let status = resp.status();
2524    let content_type = resp
2525        .headers()
2526        .get("content-type")
2527        .and_then(|v| v.to_str().ok())
2528        .unwrap_or("application/octet-stream");
2529    let content_type = super::ContentType::from(content_type);
2530
2531    if !status.is_client_error() && !status.is_server_error() {
2532        let content = resp.text().await?;
2533        match content_type {
2534            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2535            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
2536            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`")))),
2537        }
2538    } else {
2539        let content = resp.text().await?;
2540        let entity: Option<ActionUserWithIdError> = serde_json::from_str(&content).ok();
2541        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2542    }
2543}
2544
2545/// Activates the FusionAuth Reactor using a license Id and optionally a license text (for air-gapped deployments)
2546pub async fn activate_reactor_with_id(configuration: &configuration::Configuration, reactor_request: Option<models::ReactorRequest>) -> Result<(), Error<ActivateReactorWithIdError>> {
2547    // add a prefix to parameters to efficiently prevent name collisions
2548    let p_body_reactor_request = reactor_request;
2549
2550    let uri_str = format!("{}/api/reactor", configuration.base_path);
2551    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2552
2553    if let Some(ref user_agent) = configuration.user_agent {
2554        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2555    }
2556    if let Some(ref apikey) = configuration.api_key {
2557        let key = apikey.key.clone();
2558        let value = match apikey.prefix {
2559            Some(ref prefix) => format!("{} {}", prefix, key),
2560            None => key,
2561        };
2562        req_builder = req_builder.header("Authorization", value);
2563    };
2564    req_builder = req_builder.json(&p_body_reactor_request);
2565
2566    let req = req_builder.build()?;
2567    let resp = configuration.client.execute(req).await?;
2568
2569    let status = resp.status();
2570
2571    if !status.is_client_error() && !status.is_server_error() {
2572        Ok(())
2573    } else {
2574        let content = resp.text().await?;
2575        let entity: Option<ActivateReactorWithIdError> = serde_json::from_str(&content).ok();
2576        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2577    }
2578}
2579
2580/// Approve a device grant.
2581pub async fn approve_device_with_id(configuration: &configuration::Configuration, ) -> Result<models::DeviceApprovalResponse, Error<ApproveDeviceWithIdError>> {
2582
2583    let uri_str = format!("{}/oauth2/device/approve", configuration.base_path);
2584    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2585
2586    if let Some(ref user_agent) = configuration.user_agent {
2587        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2588    }
2589    if let Some(ref apikey) = configuration.api_key {
2590        let key = apikey.key.clone();
2591        let value = match apikey.prefix {
2592            Some(ref prefix) => format!("{} {}", prefix, key),
2593            None => key,
2594        };
2595        req_builder = req_builder.header("Authorization", value);
2596    };
2597
2598    let req = req_builder.build()?;
2599    let resp = configuration.client.execute(req).await?;
2600
2601    let status = resp.status();
2602    let content_type = resp
2603        .headers()
2604        .get("content-type")
2605        .and_then(|v| v.to_str().ok())
2606        .unwrap_or("application/octet-stream");
2607    let content_type = super::ContentType::from(content_type);
2608
2609    if !status.is_client_error() && !status.is_server_error() {
2610        let content = resp.text().await?;
2611        match content_type {
2612            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2613            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceApprovalResponse`"))),
2614            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`")))),
2615        }
2616    } else {
2617        let content = resp.text().await?;
2618        let entity: Option<ApproveDeviceWithIdError> = serde_json::from_str(&content).ok();
2619        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2620    }
2621}
2622
2623/// Cancels the user action.
2624pub async fn cancel_action_with_id(configuration: &configuration::Configuration, action_id: &str, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<CancelActionWithIdError>> {
2625    // add a prefix to parameters to efficiently prevent name collisions
2626    let p_path_action_id = action_id;
2627    let p_body_action_request = action_request;
2628
2629    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_path_action_id));
2630    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2631
2632    if let Some(ref user_agent) = configuration.user_agent {
2633        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2634    }
2635    if let Some(ref apikey) = configuration.api_key {
2636        let key = apikey.key.clone();
2637        let value = match apikey.prefix {
2638            Some(ref prefix) => format!("{} {}", prefix, key),
2639            None => key,
2640        };
2641        req_builder = req_builder.header("Authorization", value);
2642    };
2643    req_builder = req_builder.json(&p_body_action_request);
2644
2645    let req = req_builder.build()?;
2646    let resp = configuration.client.execute(req).await?;
2647
2648    let status = resp.status();
2649    let content_type = resp
2650        .headers()
2651        .get("content-type")
2652        .and_then(|v| v.to_str().ok())
2653        .unwrap_or("application/octet-stream");
2654    let content_type = super::ContentType::from(content_type);
2655
2656    if !status.is_client_error() && !status.is_server_error() {
2657        let content = resp.text().await?;
2658        match content_type {
2659            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2660            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
2661            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`")))),
2662        }
2663    } else {
2664        let content = resp.text().await?;
2665        let entity: Option<CancelActionWithIdError> = serde_json::from_str(&content).ok();
2666        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2667    }
2668}
2669
2670/// 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.
2671pub async fn change_password_with_id(configuration: &configuration::Configuration, change_password_id: &str, change_password_request: Option<models::ChangePasswordRequest>) -> Result<models::ChangePasswordResponse, Error<ChangePasswordWithIdError>> {
2672    // add a prefix to parameters to efficiently prevent name collisions
2673    let p_path_change_password_id = change_password_id;
2674    let p_body_change_password_request = change_password_request;
2675
2676    let uri_str = format!("{}/api/user/change-password/{changePasswordId}", configuration.base_path, changePasswordId=crate::apis::urlencode(p_path_change_password_id));
2677    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2678
2679    if let Some(ref user_agent) = configuration.user_agent {
2680        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2681    }
2682    if let Some(ref apikey) = configuration.api_key {
2683        let key = apikey.key.clone();
2684        let value = match apikey.prefix {
2685            Some(ref prefix) => format!("{} {}", prefix, key),
2686            None => key,
2687        };
2688        req_builder = req_builder.header("Authorization", value);
2689    };
2690    req_builder = req_builder.json(&p_body_change_password_request);
2691
2692    let req = req_builder.build()?;
2693    let resp = configuration.client.execute(req).await?;
2694
2695    let status = resp.status();
2696    let content_type = resp
2697        .headers()
2698        .get("content-type")
2699        .and_then(|v| v.to_str().ok())
2700        .unwrap_or("application/octet-stream");
2701    let content_type = super::ContentType::from(content_type);
2702
2703    if !status.is_client_error() && !status.is_server_error() {
2704        let content = resp.text().await?;
2705        match content_type {
2706            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2707            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangePasswordResponse`"))),
2708            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`")))),
2709        }
2710    } else {
2711        let content = resp.text().await?;
2712        let entity: Option<ChangePasswordWithIdError> = serde_json::from_str(&content).ok();
2713        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2714    }
2715}
2716
2717/// 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.
2718pub async fn check_change_password_using_id_with_id(configuration: &configuration::Configuration, change_password_id: &str) -> Result<(), Error<CheckChangePasswordUsingIdWithIdError>> {
2719    // add a prefix to parameters to efficiently prevent name collisions
2720    let p_path_change_password_id = change_password_id;
2721
2722    let uri_str = format!("{}/api/user/change-password/{changePasswordId}", configuration.base_path, changePasswordId=crate::apis::urlencode(p_path_change_password_id));
2723    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2724
2725    if let Some(ref user_agent) = configuration.user_agent {
2726        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2727    }
2728    if let Some(ref apikey) = configuration.api_key {
2729        let key = apikey.key.clone();
2730        let value = match apikey.prefix {
2731            Some(ref prefix) => format!("{} {}", prefix, key),
2732            None => key,
2733        };
2734        req_builder = req_builder.header("Authorization", value);
2735    };
2736
2737    let req = req_builder.build()?;
2738    let resp = configuration.client.execute(req).await?;
2739
2740    let status = resp.status();
2741
2742    if !status.is_client_error() && !status.is_server_error() {
2743        Ok(())
2744    } else {
2745        let content = resp.text().await?;
2746        let entity: Option<CheckChangePasswordUsingIdWithIdError> = serde_json::from_str(&content).ok();
2747        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2748    }
2749}
2750
2751/// Adds a comment to the user's account.
2752pub 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>> {
2753    // add a prefix to parameters to efficiently prevent name collisions
2754    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
2755    let p_body_user_comment_request = user_comment_request;
2756
2757    let uri_str = format!("{}/api/user/comment", configuration.base_path);
2758    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2759
2760    if let Some(ref user_agent) = configuration.user_agent {
2761        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2762    }
2763    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
2764        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
2765    }
2766    if let Some(ref apikey) = configuration.api_key {
2767        let key = apikey.key.clone();
2768        let value = match apikey.prefix {
2769            Some(ref prefix) => format!("{} {}", prefix, key),
2770            None => key,
2771        };
2772        req_builder = req_builder.header("Authorization", value);
2773    };
2774    req_builder = req_builder.json(&p_body_user_comment_request);
2775
2776    let req = req_builder.build()?;
2777    let resp = configuration.client.execute(req).await?;
2778
2779    let status = resp.status();
2780    let content_type = resp
2781        .headers()
2782        .get("content-type")
2783        .and_then(|v| v.to_str().ok())
2784        .unwrap_or("application/octet-stream");
2785    let content_type = super::ContentType::from(content_type);
2786
2787    if !status.is_client_error() && !status.is_server_error() {
2788        let content = resp.text().await?;
2789        match content_type {
2790            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2791            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentResponse`"))),
2792            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`")))),
2793        }
2794    } else {
2795        let content = resp.text().await?;
2796        let entity: Option<CommentOnUserWithIdError> = serde_json::from_str(&content).ok();
2797        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2798    }
2799}
2800
2801/// Completes verification of an identity using verification codes from the Verify Start API.
2802pub async fn complete_verify_identity_with_id(configuration: &configuration::Configuration, verify_complete_request: Option<models::VerifyCompleteRequest>) -> Result<models::VerifyCompleteResponse, Error<CompleteVerifyIdentityWithIdError>> {
2803    // add a prefix to parameters to efficiently prevent name collisions
2804    let p_body_verify_complete_request = verify_complete_request;
2805
2806    let uri_str = format!("{}/api/identity/verify/complete", configuration.base_path);
2807    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2808
2809    if let Some(ref user_agent) = configuration.user_agent {
2810        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2811    }
2812    if let Some(ref apikey) = configuration.api_key {
2813        let key = apikey.key.clone();
2814        let value = match apikey.prefix {
2815            Some(ref prefix) => format!("{} {}", prefix, key),
2816            None => key,
2817        };
2818        req_builder = req_builder.header("Authorization", value);
2819    };
2820    req_builder = req_builder.json(&p_body_verify_complete_request);
2821
2822    let req = req_builder.build()?;
2823    let resp = configuration.client.execute(req).await?;
2824
2825    let status = resp.status();
2826    let content_type = resp
2827        .headers()
2828        .get("content-type")
2829        .and_then(|v| v.to_str().ok())
2830        .unwrap_or("application/octet-stream");
2831    let content_type = super::ContentType::from(content_type);
2832
2833    if !status.is_client_error() && !status.is_server_error() {
2834        let content = resp.text().await?;
2835        match content_type {
2836            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2837            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyCompleteResponse`"))),
2838            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::VerifyCompleteResponse`")))),
2839        }
2840    } else {
2841        let content = resp.text().await?;
2842        let entity: Option<CompleteVerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
2843        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2844    }
2845}
2846
2847/// Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
2848pub async fn complete_web_authn_assertion_with_id(configuration: &configuration::Configuration, web_authn_login_request: Option<models::WebAuthnLoginRequest>) -> Result<models::WebAuthnAssertResponse, Error<CompleteWebAuthnAssertionWithIdError>> {
2849    // add a prefix to parameters to efficiently prevent name collisions
2850    let p_body_web_authn_login_request = web_authn_login_request;
2851
2852    let uri_str = format!("{}/api/webauthn/assert", configuration.base_path);
2853    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2854
2855    if let Some(ref user_agent) = configuration.user_agent {
2856        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2857    }
2858    if let Some(ref apikey) = configuration.api_key {
2859        let key = apikey.key.clone();
2860        let value = match apikey.prefix {
2861            Some(ref prefix) => format!("{} {}", prefix, key),
2862            None => key,
2863        };
2864        req_builder = req_builder.header("Authorization", value);
2865    };
2866    req_builder = req_builder.json(&p_body_web_authn_login_request);
2867
2868    let req = req_builder.build()?;
2869    let resp = configuration.client.execute(req).await?;
2870
2871    let status = resp.status();
2872    let content_type = resp
2873        .headers()
2874        .get("content-type")
2875        .and_then(|v| v.to_str().ok())
2876        .unwrap_or("application/octet-stream");
2877    let content_type = super::ContentType::from(content_type);
2878
2879    if !status.is_client_error() && !status.is_server_error() {
2880        let content = resp.text().await?;
2881        match content_type {
2882            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2883            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnAssertResponse`"))),
2884            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`")))),
2885        }
2886    } else {
2887        let content = resp.text().await?;
2888        let entity: Option<CompleteWebAuthnAssertionWithIdError> = serde_json::from_str(&content).ok();
2889        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2890    }
2891}
2892
2893/// Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
2894pub async fn complete_web_authn_login_with_id(configuration: &configuration::Configuration, web_authn_login_request: Option<models::WebAuthnLoginRequest>) -> Result<models::LoginResponse, Error<CompleteWebAuthnLoginWithIdError>> {
2895    // add a prefix to parameters to efficiently prevent name collisions
2896    let p_body_web_authn_login_request = web_authn_login_request;
2897
2898    let uri_str = format!("{}/api/webauthn/login", configuration.base_path);
2899    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2900
2901    if let Some(ref user_agent) = configuration.user_agent {
2902        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2903    }
2904    if let Some(ref apikey) = configuration.api_key {
2905        let key = apikey.key.clone();
2906        let value = match apikey.prefix {
2907            Some(ref prefix) => format!("{} {}", prefix, key),
2908            None => key,
2909        };
2910        req_builder = req_builder.header("Authorization", value);
2911    };
2912    req_builder = req_builder.json(&p_body_web_authn_login_request);
2913
2914    let req = req_builder.build()?;
2915    let resp = configuration.client.execute(req).await?;
2916
2917    let status = resp.status();
2918    let content_type = resp
2919        .headers()
2920        .get("content-type")
2921        .and_then(|v| v.to_str().ok())
2922        .unwrap_or("application/octet-stream");
2923    let content_type = super::ContentType::from(content_type);
2924
2925    if !status.is_client_error() && !status.is_server_error() {
2926        let content = resp.text().await?;
2927        match content_type {
2928            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2929            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
2930            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`")))),
2931        }
2932    } else {
2933        let content = resp.text().await?;
2934        let entity: Option<CompleteWebAuthnLoginWithIdError> = serde_json::from_str(&content).ok();
2935        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2936    }
2937}
2938
2939/// Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
2940pub async fn complete_web_authn_registration_with_id(configuration: &configuration::Configuration, web_authn_register_complete_request: Option<models::WebAuthnRegisterCompleteRequest>) -> Result<models::WebAuthnRegisterCompleteResponse, Error<CompleteWebAuthnRegistrationWithIdError>> {
2941    // add a prefix to parameters to efficiently prevent name collisions
2942    let p_body_web_authn_register_complete_request = web_authn_register_complete_request;
2943
2944    let uri_str = format!("{}/api/webauthn/register/complete", configuration.base_path);
2945    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2946
2947    if let Some(ref user_agent) = configuration.user_agent {
2948        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2949    }
2950    if let Some(ref apikey) = configuration.api_key {
2951        let key = apikey.key.clone();
2952        let value = match apikey.prefix {
2953            Some(ref prefix) => format!("{} {}", prefix, key),
2954            None => key,
2955        };
2956        req_builder = req_builder.header("Authorization", value);
2957    };
2958    req_builder = req_builder.json(&p_body_web_authn_register_complete_request);
2959
2960    let req = req_builder.build()?;
2961    let resp = configuration.client.execute(req).await?;
2962
2963    let status = resp.status();
2964    let content_type = resp
2965        .headers()
2966        .get("content-type")
2967        .and_then(|v| v.to_str().ok())
2968        .unwrap_or("application/octet-stream");
2969    let content_type = super::ContentType::from(content_type);
2970
2971    if !status.is_client_error() && !status.is_server_error() {
2972        let content = resp.text().await?;
2973        match content_type {
2974            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2975            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnRegisterCompleteResponse`"))),
2976            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`")))),
2977        }
2978    } else {
2979        let content = resp.text().await?;
2980        let entity: Option<CompleteWebAuthnRegistrationWithIdError> = serde_json::from_str(&content).ok();
2981        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2982    }
2983}
2984
2985/// 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.
2986pub async fn create_api_key(configuration: &configuration::Configuration, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<CreateApiKeyError>> {
2987    // add a prefix to parameters to efficiently prevent name collisions
2988    let p_body_api_key_request = api_key_request;
2989
2990    let uri_str = format!("{}/api/api-key", configuration.base_path);
2991    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2992
2993    if let Some(ref user_agent) = configuration.user_agent {
2994        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2995    }
2996    if let Some(ref apikey) = configuration.api_key {
2997        let key = apikey.key.clone();
2998        let value = match apikey.prefix {
2999            Some(ref prefix) => format!("{} {}", prefix, key),
3000            None => key,
3001        };
3002        req_builder = req_builder.header("Authorization", value);
3003    };
3004    req_builder = req_builder.json(&p_body_api_key_request);
3005
3006    let req = req_builder.build()?;
3007    let resp = configuration.client.execute(req).await?;
3008
3009    let status = resp.status();
3010    let content_type = resp
3011        .headers()
3012        .get("content-type")
3013        .and_then(|v| v.to_str().ok())
3014        .unwrap_or("application/octet-stream");
3015    let content_type = super::ContentType::from(content_type);
3016
3017    if !status.is_client_error() && !status.is_server_error() {
3018        let content = resp.text().await?;
3019        match content_type {
3020            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3021            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
3022            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`")))),
3023        }
3024    } else {
3025        let content = resp.text().await?;
3026        let entity: Option<CreateApiKeyError> = serde_json::from_str(&content).ok();
3027        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3028    }
3029}
3030
3031/// 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.
3032pub async fn create_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<CreateApiKeyWithIdError>> {
3033    // add a prefix to parameters to efficiently prevent name collisions
3034    let p_path_key_id = key_id;
3035    let p_body_api_key_request = api_key_request;
3036
3037    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
3038    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3039
3040    if let Some(ref user_agent) = configuration.user_agent {
3041        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3042    }
3043    if let Some(ref apikey) = configuration.api_key {
3044        let key = apikey.key.clone();
3045        let value = match apikey.prefix {
3046            Some(ref prefix) => format!("{} {}", prefix, key),
3047            None => key,
3048        };
3049        req_builder = req_builder.header("Authorization", value);
3050    };
3051    req_builder = req_builder.json(&p_body_api_key_request);
3052
3053    let req = req_builder.build()?;
3054    let resp = configuration.client.execute(req).await?;
3055
3056    let status = resp.status();
3057    let content_type = resp
3058        .headers()
3059        .get("content-type")
3060        .and_then(|v| v.to_str().ok())
3061        .unwrap_or("application/octet-stream");
3062    let content_type = super::ContentType::from(content_type);
3063
3064    if !status.is_client_error() && !status.is_server_error() {
3065        let content = resp.text().await?;
3066        match content_type {
3067            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3068            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
3069            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`")))),
3070        }
3071    } else {
3072        let content = resp.text().await?;
3073        let entity: Option<CreateApiKeyWithIdError> = serde_json::from_str(&content).ok();
3074        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3075    }
3076}
3077
3078/// Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
3079pub async fn create_application(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationError>> {
3080    // add a prefix to parameters to efficiently prevent name collisions
3081    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3082    let p_body_application_request = application_request;
3083
3084    let uri_str = format!("{}/api/application", configuration.base_path);
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_header_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_body_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<CreateApplicationError> = 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(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationRoleError>> {
3130    // add a prefix to parameters to efficiently prevent name collisions
3131    let p_path_application_id = application_id;
3132    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3133    let p_body_application_request = application_request;
3134
3135    let uri_str = format!("{}/api/application/{applicationId}/role", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
3136    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3137
3138    if let Some(ref user_agent) = configuration.user_agent {
3139        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3140    }
3141    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3142        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3143    }
3144    if let Some(ref apikey) = configuration.api_key {
3145        let key = apikey.key.clone();
3146        let value = match apikey.prefix {
3147            Some(ref prefix) => format!("{} {}", prefix, key),
3148            None => key,
3149        };
3150        req_builder = req_builder.header("Authorization", value);
3151    };
3152    req_builder = req_builder.json(&p_body_application_request);
3153
3154    let req = req_builder.build()?;
3155    let resp = configuration.client.execute(req).await?;
3156
3157    let status = resp.status();
3158    let content_type = resp
3159        .headers()
3160        .get("content-type")
3161        .and_then(|v| v.to_str().ok())
3162        .unwrap_or("application/octet-stream");
3163    let content_type = super::ContentType::from(content_type);
3164
3165    if !status.is_client_error() && !status.is_server_error() {
3166        let content = resp.text().await?;
3167        match content_type {
3168            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3169            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3170            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`")))),
3171        }
3172    } else {
3173        let content = resp.text().await?;
3174        let entity: Option<CreateApplicationRoleError> = serde_json::from_str(&content).ok();
3175        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3176    }
3177}
3178
3179/// 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.
3180pub 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>> {
3181    // add a prefix to parameters to efficiently prevent name collisions
3182    let p_path_application_id = application_id;
3183    let p_path_role_id = role_id;
3184    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3185    let p_body_application_request = application_request;
3186
3187    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), roleId=crate::apis::urlencode(p_path_role_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_header_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_body_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<CreateApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
3227        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3228    }
3229}
3230
3231/// Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
3232pub 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>> {
3233    // add a prefix to parameters to efficiently prevent name collisions
3234    let p_path_application_id = application_id;
3235    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3236    let p_body_application_request = application_request;
3237
3238    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
3239    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3240
3241    if let Some(ref user_agent) = configuration.user_agent {
3242        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3243    }
3244    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3245        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3246    }
3247    if let Some(ref apikey) = configuration.api_key {
3248        let key = apikey.key.clone();
3249        let value = match apikey.prefix {
3250            Some(ref prefix) => format!("{} {}", prefix, key),
3251            None => key,
3252        };
3253        req_builder = req_builder.header("Authorization", value);
3254    };
3255    req_builder = req_builder.json(&p_body_application_request);
3256
3257    let req = req_builder.build()?;
3258    let resp = configuration.client.execute(req).await?;
3259
3260    let status = resp.status();
3261    let content_type = resp
3262        .headers()
3263        .get("content-type")
3264        .and_then(|v| v.to_str().ok())
3265        .unwrap_or("application/octet-stream");
3266    let content_type = super::ContentType::from(content_type);
3267
3268    if !status.is_client_error() && !status.is_server_error() {
3269        let content = resp.text().await?;
3270        match content_type {
3271            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3272            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3273            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`")))),
3274        }
3275    } else {
3276        let content = resp.text().await?;
3277        let entity: Option<CreateApplicationWithIdError> = serde_json::from_str(&content).ok();
3278        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3279    }
3280}
3281
3282/// 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.
3283pub async fn create_audit_log_with_id(configuration: &configuration::Configuration, audit_log_request: Option<models::AuditLogRequest>) -> Result<models::AuditLogResponse, Error<CreateAuditLogWithIdError>> {
3284    // add a prefix to parameters to efficiently prevent name collisions
3285    let p_body_audit_log_request = audit_log_request;
3286
3287    let uri_str = format!("{}/api/system/audit-log", configuration.base_path);
3288    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3289
3290    if let Some(ref user_agent) = configuration.user_agent {
3291        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3292    }
3293    if let Some(ref apikey) = configuration.api_key {
3294        let key = apikey.key.clone();
3295        let value = match apikey.prefix {
3296            Some(ref prefix) => format!("{} {}", prefix, key),
3297            None => key,
3298        };
3299        req_builder = req_builder.header("Authorization", value);
3300    };
3301    req_builder = req_builder.json(&p_body_audit_log_request);
3302
3303    let req = req_builder.build()?;
3304    let resp = configuration.client.execute(req).await?;
3305
3306    let status = resp.status();
3307    let content_type = resp
3308        .headers()
3309        .get("content-type")
3310        .and_then(|v| v.to_str().ok())
3311        .unwrap_or("application/octet-stream");
3312    let content_type = super::ContentType::from(content_type);
3313
3314    if !status.is_client_error() && !status.is_server_error() {
3315        let content = resp.text().await?;
3316        match content_type {
3317            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3318            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogResponse`"))),
3319            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`")))),
3320        }
3321    } else {
3322        let content = resp.text().await?;
3323        let entity: Option<CreateAuditLogWithIdError> = serde_json::from_str(&content).ok();
3324        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3325    }
3326}
3327
3328/// Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
3329pub async fn create_connector(configuration: &configuration::Configuration, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<CreateConnectorError>> {
3330    // add a prefix to parameters to efficiently prevent name collisions
3331    let p_body_connector_request = connector_request;
3332
3333    let uri_str = format!("{}/api/connector", configuration.base_path);
3334    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3335
3336    if let Some(ref user_agent) = configuration.user_agent {
3337        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3338    }
3339    if let Some(ref apikey) = configuration.api_key {
3340        let key = apikey.key.clone();
3341        let value = match apikey.prefix {
3342            Some(ref prefix) => format!("{} {}", prefix, key),
3343            None => key,
3344        };
3345        req_builder = req_builder.header("Authorization", value);
3346    };
3347    req_builder = req_builder.json(&p_body_connector_request);
3348
3349    let req = req_builder.build()?;
3350    let resp = configuration.client.execute(req).await?;
3351
3352    let status = resp.status();
3353    let content_type = resp
3354        .headers()
3355        .get("content-type")
3356        .and_then(|v| v.to_str().ok())
3357        .unwrap_or("application/octet-stream");
3358    let content_type = super::ContentType::from(content_type);
3359
3360    if !status.is_client_error() && !status.is_server_error() {
3361        let content = resp.text().await?;
3362        match content_type {
3363            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3364            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
3365            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`")))),
3366        }
3367    } else {
3368        let content = resp.text().await?;
3369        let entity: Option<CreateConnectorError> = serde_json::from_str(&content).ok();
3370        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3371    }
3372}
3373
3374/// Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
3375pub async fn create_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<CreateConnectorWithIdError>> {
3376    // add a prefix to parameters to efficiently prevent name collisions
3377    let p_path_connector_id = connector_id;
3378    let p_body_connector_request = connector_request;
3379
3380    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
3381    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3382
3383    if let Some(ref user_agent) = configuration.user_agent {
3384        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3385    }
3386    if let Some(ref apikey) = configuration.api_key {
3387        let key = apikey.key.clone();
3388        let value = match apikey.prefix {
3389            Some(ref prefix) => format!("{} {}", prefix, key),
3390            None => key,
3391        };
3392        req_builder = req_builder.header("Authorization", value);
3393    };
3394    req_builder = req_builder.json(&p_body_connector_request);
3395
3396    let req = req_builder.build()?;
3397    let resp = configuration.client.execute(req).await?;
3398
3399    let status = resp.status();
3400    let content_type = resp
3401        .headers()
3402        .get("content-type")
3403        .and_then(|v| v.to_str().ok())
3404        .unwrap_or("application/octet-stream");
3405    let content_type = super::ContentType::from(content_type);
3406
3407    if !status.is_client_error() && !status.is_server_error() {
3408        let content = resp.text().await?;
3409        match content_type {
3410            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3411            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
3412            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`")))),
3413        }
3414    } else {
3415        let content = resp.text().await?;
3416        let entity: Option<CreateConnectorWithIdError> = serde_json::from_str(&content).ok();
3417        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3418    }
3419}
3420
3421/// Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
3422pub async fn create_consent(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, consent_request: Option<models::ConsentRequest>) -> Result<models::ConsentResponse, Error<CreateConsentError>> {
3423    // add a prefix to parameters to efficiently prevent name collisions
3424    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3425    let p_body_consent_request = consent_request;
3426
3427    let uri_str = format!("{}/api/consent", configuration.base_path);
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_header_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_body_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<CreateConsentError> = serde_json::from_str(&content).ok();
3467        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3468    }
3469}
3470
3471/// Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
3472pub 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>> {
3473    // add a prefix to parameters to efficiently prevent name collisions
3474    let p_path_consent_id = consent_id;
3475    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3476    let p_body_consent_request = consent_request;
3477
3478    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
3479    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3480
3481    if let Some(ref user_agent) = configuration.user_agent {
3482        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3483    }
3484    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3485        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3486    }
3487    if let Some(ref apikey) = configuration.api_key {
3488        let key = apikey.key.clone();
3489        let value = match apikey.prefix {
3490            Some(ref prefix) => format!("{} {}", prefix, key),
3491            None => key,
3492        };
3493        req_builder = req_builder.header("Authorization", value);
3494    };
3495    req_builder = req_builder.json(&p_body_consent_request);
3496
3497    let req = req_builder.build()?;
3498    let resp = configuration.client.execute(req).await?;
3499
3500    let status = resp.status();
3501    let content_type = resp
3502        .headers()
3503        .get("content-type")
3504        .and_then(|v| v.to_str().ok())
3505        .unwrap_or("application/octet-stream");
3506    let content_type = super::ContentType::from(content_type);
3507
3508    if !status.is_client_error() && !status.is_server_error() {
3509        let content = resp.text().await?;
3510        match content_type {
3511            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3512            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
3513            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`")))),
3514        }
3515    } else {
3516        let content = resp.text().await?;
3517        let entity: Option<CreateConsentWithIdError> = serde_json::from_str(&content).ok();
3518        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3519    }
3520}
3521
3522/// Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
3523pub 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>> {
3524    // add a prefix to parameters to efficiently prevent name collisions
3525    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3526    let p_body_email_template_request = email_template_request;
3527
3528    let uri_str = format!("{}/api/email/template", configuration.base_path);
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_header_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_body_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<CreateEmailTemplateError> = serde_json::from_str(&content).ok();
3568        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3569    }
3570}
3571
3572/// Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
3573pub 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>> {
3574    // add a prefix to parameters to efficiently prevent name collisions
3575    let p_path_email_template_id = email_template_id;
3576    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3577    let p_body_email_template_request = email_template_request;
3578
3579    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
3580    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3581
3582    if let Some(ref user_agent) = configuration.user_agent {
3583        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3584    }
3585    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3586        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3587    }
3588    if let Some(ref apikey) = configuration.api_key {
3589        let key = apikey.key.clone();
3590        let value = match apikey.prefix {
3591            Some(ref prefix) => format!("{} {}", prefix, key),
3592            None => key,
3593        };
3594        req_builder = req_builder.header("Authorization", value);
3595    };
3596    req_builder = req_builder.json(&p_body_email_template_request);
3597
3598    let req = req_builder.build()?;
3599    let resp = configuration.client.execute(req).await?;
3600
3601    let status = resp.status();
3602    let content_type = resp
3603        .headers()
3604        .get("content-type")
3605        .and_then(|v| v.to_str().ok())
3606        .unwrap_or("application/octet-stream");
3607    let content_type = super::ContentType::from(content_type);
3608
3609    if !status.is_client_error() && !status.is_server_error() {
3610        let content = resp.text().await?;
3611        match content_type {
3612            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3613            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
3614            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`")))),
3615        }
3616    } else {
3617        let content = resp.text().await?;
3618        let entity: Option<CreateEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
3619        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3620    }
3621}
3622
3623/// Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
3624pub async fn create_entity(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, entity_request: Option<models::EntityRequest>) -> Result<models::EntityResponse, Error<CreateEntityError>> {
3625    // add a prefix to parameters to efficiently prevent name collisions
3626    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3627    let p_body_entity_request = entity_request;
3628
3629    let uri_str = format!("{}/api/entity", configuration.base_path);
3630    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3631
3632    if let Some(ref user_agent) = configuration.user_agent {
3633        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3634    }
3635    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3636        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3637    }
3638    if let Some(ref apikey) = configuration.api_key {
3639        let key = apikey.key.clone();
3640        let value = match apikey.prefix {
3641            Some(ref prefix) => format!("{} {}", prefix, key),
3642            None => key,
3643        };
3644        req_builder = req_builder.header("Authorization", value);
3645    };
3646    req_builder = req_builder.json(&p_body_entity_request);
3647
3648    let req = req_builder.build()?;
3649    let resp = configuration.client.execute(req).await?;
3650
3651    let status = resp.status();
3652    let content_type = resp
3653        .headers()
3654        .get("content-type")
3655        .and_then(|v| v.to_str().ok())
3656        .unwrap_or("application/octet-stream");
3657    let content_type = super::ContentType::from(content_type);
3658
3659    if !status.is_client_error() && !status.is_server_error() {
3660        let content = resp.text().await?;
3661        match content_type {
3662            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3663            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
3664            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`")))),
3665        }
3666    } else {
3667        let content = resp.text().await?;
3668        let entity: Option<CreateEntityError> = serde_json::from_str(&content).ok();
3669        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3670    }
3671}
3672
3673/// Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
3674pub async fn create_entity_type(configuration: &configuration::Configuration, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypeError>> {
3675    // add a prefix to parameters to efficiently prevent name collisions
3676    let p_body_entity_type_request = entity_type_request;
3677
3678    let uri_str = format!("{}/api/entity/type", configuration.base_path);
3679    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3680
3681    if let Some(ref user_agent) = configuration.user_agent {
3682        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3683    }
3684    if let Some(ref apikey) = configuration.api_key {
3685        let key = apikey.key.clone();
3686        let value = match apikey.prefix {
3687            Some(ref prefix) => format!("{} {}", prefix, key),
3688            None => key,
3689        };
3690        req_builder = req_builder.header("Authorization", value);
3691    };
3692    req_builder = req_builder.json(&p_body_entity_type_request);
3693
3694    let req = req_builder.build()?;
3695    let resp = configuration.client.execute(req).await?;
3696
3697    let status = resp.status();
3698    let content_type = resp
3699        .headers()
3700        .get("content-type")
3701        .and_then(|v| v.to_str().ok())
3702        .unwrap_or("application/octet-stream");
3703    let content_type = super::ContentType::from(content_type);
3704
3705    if !status.is_client_error() && !status.is_server_error() {
3706        let content = resp.text().await?;
3707        match content_type {
3708            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3709            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3710            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`")))),
3711        }
3712    } else {
3713        let content = resp.text().await?;
3714        let entity: Option<CreateEntityTypeError> = serde_json::from_str(&content).ok();
3715        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3716    }
3717}
3718
3719/// 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.
3720pub async fn create_entity_type_permission(configuration: &configuration::Configuration, entity_type_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypePermissionError>> {
3721    // add a prefix to parameters to efficiently prevent name collisions
3722    let p_path_entity_type_id = entity_type_id;
3723    let p_body_entity_type_request = entity_type_request;
3724
3725    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
3726    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3727
3728    if let Some(ref user_agent) = configuration.user_agent {
3729        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3730    }
3731    if let Some(ref apikey) = configuration.api_key {
3732        let key = apikey.key.clone();
3733        let value = match apikey.prefix {
3734            Some(ref prefix) => format!("{} {}", prefix, key),
3735            None => key,
3736        };
3737        req_builder = req_builder.header("Authorization", value);
3738    };
3739    req_builder = req_builder.json(&p_body_entity_type_request);
3740
3741    let req = req_builder.build()?;
3742    let resp = configuration.client.execute(req).await?;
3743
3744    let status = resp.status();
3745    let content_type = resp
3746        .headers()
3747        .get("content-type")
3748        .and_then(|v| v.to_str().ok())
3749        .unwrap_or("application/octet-stream");
3750    let content_type = super::ContentType::from(content_type);
3751
3752    if !status.is_client_error() && !status.is_server_error() {
3753        let content = resp.text().await?;
3754        match content_type {
3755            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3756            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3757            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`")))),
3758        }
3759    } else {
3760        let content = resp.text().await?;
3761        let entity: Option<CreateEntityTypePermissionError> = serde_json::from_str(&content).ok();
3762        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3763    }
3764}
3765
3766/// 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.
3767pub 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>> {
3768    // add a prefix to parameters to efficiently prevent name collisions
3769    let p_path_entity_type_id = entity_type_id;
3770    let p_path_permission_id = permission_id;
3771    let p_body_entity_type_request = entity_type_request;
3772
3773    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id), permissionId=crate::apis::urlencode(p_path_permission_id));
3774    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3775
3776    if let Some(ref user_agent) = configuration.user_agent {
3777        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3778    }
3779    if let Some(ref apikey) = configuration.api_key {
3780        let key = apikey.key.clone();
3781        let value = match apikey.prefix {
3782            Some(ref prefix) => format!("{} {}", prefix, key),
3783            None => key,
3784        };
3785        req_builder = req_builder.header("Authorization", value);
3786    };
3787    req_builder = req_builder.json(&p_body_entity_type_request);
3788
3789    let req = req_builder.build()?;
3790    let resp = configuration.client.execute(req).await?;
3791
3792    let status = resp.status();
3793    let content_type = resp
3794        .headers()
3795        .get("content-type")
3796        .and_then(|v| v.to_str().ok())
3797        .unwrap_or("application/octet-stream");
3798    let content_type = super::ContentType::from(content_type);
3799
3800    if !status.is_client_error() && !status.is_server_error() {
3801        let content = resp.text().await?;
3802        match content_type {
3803            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3804            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3805            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`")))),
3806        }
3807    } else {
3808        let content = resp.text().await?;
3809        let entity: Option<CreateEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
3810        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3811    }
3812}
3813
3814/// Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
3815pub 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>> {
3816    // add a prefix to parameters to efficiently prevent name collisions
3817    let p_path_entity_type_id = entity_type_id;
3818    let p_body_entity_type_request = entity_type_request;
3819
3820    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
3821    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3822
3823    if let Some(ref user_agent) = configuration.user_agent {
3824        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
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_body_entity_type_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::EntityTypeResponse`"))),
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::EntityTypeResponse`")))),
3853        }
3854    } else {
3855        let content = resp.text().await?;
3856        let entity: Option<CreateEntityTypeWithIdError> = serde_json::from_str(&content).ok();
3857        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3858    }
3859}
3860
3861/// Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
3862pub 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>> {
3863    // add a prefix to parameters to efficiently prevent name collisions
3864    let p_path_entity_id = entity_id;
3865    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3866    let p_body_entity_request = entity_request;
3867
3868    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
3869    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3870
3871    if let Some(ref user_agent) = configuration.user_agent {
3872        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3873    }
3874    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3875        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3876    }
3877    if let Some(ref apikey) = configuration.api_key {
3878        let key = apikey.key.clone();
3879        let value = match apikey.prefix {
3880            Some(ref prefix) => format!("{} {}", prefix, key),
3881            None => key,
3882        };
3883        req_builder = req_builder.header("Authorization", value);
3884    };
3885    req_builder = req_builder.json(&p_body_entity_request);
3886
3887    let req = req_builder.build()?;
3888    let resp = configuration.client.execute(req).await?;
3889
3890    let status = resp.status();
3891    let content_type = resp
3892        .headers()
3893        .get("content-type")
3894        .and_then(|v| v.to_str().ok())
3895        .unwrap_or("application/octet-stream");
3896    let content_type = super::ContentType::from(content_type);
3897
3898    if !status.is_client_error() && !status.is_server_error() {
3899        let content = resp.text().await?;
3900        match content_type {
3901            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3902            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
3903            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`")))),
3904        }
3905    } else {
3906        let content = resp.text().await?;
3907        let entity: Option<CreateEntityWithIdError> = serde_json::from_str(&content).ok();
3908        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3909    }
3910}
3911
3912/// 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.
3913pub async fn create_family(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, family_request: Option<models::FamilyRequest>) -> Result<models::FamilyResponse, Error<CreateFamilyError>> {
3914    // add a prefix to parameters to efficiently prevent name collisions
3915    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3916    let p_body_family_request = family_request;
3917
3918    let uri_str = format!("{}/api/user/family", configuration.base_path);
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_header_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_body_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<CreateFamilyError> = serde_json::from_str(&content).ok();
3958        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3959    }
3960}
3961
3962/// 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.
3963pub 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>> {
3964    // add a prefix to parameters to efficiently prevent name collisions
3965    let p_path_family_id = family_id;
3966    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3967    let p_body_family_request = family_request;
3968
3969    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_id));
3970    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3971
3972    if let Some(ref user_agent) = configuration.user_agent {
3973        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3974    }
3975    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3976        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3977    }
3978    if let Some(ref apikey) = configuration.api_key {
3979        let key = apikey.key.clone();
3980        let value = match apikey.prefix {
3981            Some(ref prefix) => format!("{} {}", prefix, key),
3982            None => key,
3983        };
3984        req_builder = req_builder.header("Authorization", value);
3985    };
3986    req_builder = req_builder.json(&p_body_family_request);
3987
3988    let req = req_builder.build()?;
3989    let resp = configuration.client.execute(req).await?;
3990
3991    let status = resp.status();
3992    let content_type = resp
3993        .headers()
3994        .get("content-type")
3995        .and_then(|v| v.to_str().ok())
3996        .unwrap_or("application/octet-stream");
3997    let content_type = super::ContentType::from(content_type);
3998
3999    if !status.is_client_error() && !status.is_server_error() {
4000        let content = resp.text().await?;
4001        match content_type {
4002            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4003            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
4004            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`")))),
4005        }
4006    } else {
4007        let content = resp.text().await?;
4008        let entity: Option<CreateFamilyWithIdError> = serde_json::from_str(&content).ok();
4009        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4010    }
4011}
4012
4013/// Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
4014pub async fn create_form(configuration: &configuration::Configuration, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<CreateFormError>> {
4015    // add a prefix to parameters to efficiently prevent name collisions
4016    let p_body_form_request = form_request;
4017
4018    let uri_str = format!("{}/api/form", configuration.base_path);
4019    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4020
4021    if let Some(ref user_agent) = configuration.user_agent {
4022        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4023    }
4024    if let Some(ref apikey) = configuration.api_key {
4025        let key = apikey.key.clone();
4026        let value = match apikey.prefix {
4027            Some(ref prefix) => format!("{} {}", prefix, key),
4028            None => key,
4029        };
4030        req_builder = req_builder.header("Authorization", value);
4031    };
4032    req_builder = req_builder.json(&p_body_form_request);
4033
4034    let req = req_builder.build()?;
4035    let resp = configuration.client.execute(req).await?;
4036
4037    let status = resp.status();
4038    let content_type = resp
4039        .headers()
4040        .get("content-type")
4041        .and_then(|v| v.to_str().ok())
4042        .unwrap_or("application/octet-stream");
4043    let content_type = super::ContentType::from(content_type);
4044
4045    if !status.is_client_error() && !status.is_server_error() {
4046        let content = resp.text().await?;
4047        match content_type {
4048            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4049            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
4050            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`")))),
4051        }
4052    } else {
4053        let content = resp.text().await?;
4054        let entity: Option<CreateFormError> = serde_json::from_str(&content).ok();
4055        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4056    }
4057}
4058
4059/// Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
4060pub async fn create_form_field(configuration: &configuration::Configuration, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<CreateFormFieldError>> {
4061    // add a prefix to parameters to efficiently prevent name collisions
4062    let p_body_form_field_request = form_field_request;
4063
4064    let uri_str = format!("{}/api/form/field", configuration.base_path);
4065    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4066
4067    if let Some(ref user_agent) = configuration.user_agent {
4068        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4069    }
4070    if let Some(ref apikey) = configuration.api_key {
4071        let key = apikey.key.clone();
4072        let value = match apikey.prefix {
4073            Some(ref prefix) => format!("{} {}", prefix, key),
4074            None => key,
4075        };
4076        req_builder = req_builder.header("Authorization", value);
4077    };
4078    req_builder = req_builder.json(&p_body_form_field_request);
4079
4080    let req = req_builder.build()?;
4081    let resp = configuration.client.execute(req).await?;
4082
4083    let status = resp.status();
4084    let content_type = resp
4085        .headers()
4086        .get("content-type")
4087        .and_then(|v| v.to_str().ok())
4088        .unwrap_or("application/octet-stream");
4089    let content_type = super::ContentType::from(content_type);
4090
4091    if !status.is_client_error() && !status.is_server_error() {
4092        let content = resp.text().await?;
4093        match content_type {
4094            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4095            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
4096            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`")))),
4097        }
4098    } else {
4099        let content = resp.text().await?;
4100        let entity: Option<CreateFormFieldError> = serde_json::from_str(&content).ok();
4101        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4102    }
4103}
4104
4105/// Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
4106pub async fn create_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<CreateFormFieldWithIdError>> {
4107    // add a prefix to parameters to efficiently prevent name collisions
4108    let p_path_field_id = field_id;
4109    let p_body_form_field_request = form_field_request;
4110
4111    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
4112    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4113
4114    if let Some(ref user_agent) = configuration.user_agent {
4115        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4116    }
4117    if let Some(ref apikey) = configuration.api_key {
4118        let key = apikey.key.clone();
4119        let value = match apikey.prefix {
4120            Some(ref prefix) => format!("{} {}", prefix, key),
4121            None => key,
4122        };
4123        req_builder = req_builder.header("Authorization", value);
4124    };
4125    req_builder = req_builder.json(&p_body_form_field_request);
4126
4127    let req = req_builder.build()?;
4128    let resp = configuration.client.execute(req).await?;
4129
4130    let status = resp.status();
4131    let content_type = resp
4132        .headers()
4133        .get("content-type")
4134        .and_then(|v| v.to_str().ok())
4135        .unwrap_or("application/octet-stream");
4136    let content_type = super::ContentType::from(content_type);
4137
4138    if !status.is_client_error() && !status.is_server_error() {
4139        let content = resp.text().await?;
4140        match content_type {
4141            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4142            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
4143            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`")))),
4144        }
4145    } else {
4146        let content = resp.text().await?;
4147        let entity: Option<CreateFormFieldWithIdError> = serde_json::from_str(&content).ok();
4148        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4149    }
4150}
4151
4152/// Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
4153pub async fn create_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<CreateFormWithIdError>> {
4154    // add a prefix to parameters to efficiently prevent name collisions
4155    let p_path_form_id = form_id;
4156    let p_body_form_request = form_request;
4157
4158    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
4159    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4160
4161    if let Some(ref user_agent) = configuration.user_agent {
4162        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4163    }
4164    if let Some(ref apikey) = configuration.api_key {
4165        let key = apikey.key.clone();
4166        let value = match apikey.prefix {
4167            Some(ref prefix) => format!("{} {}", prefix, key),
4168            None => key,
4169        };
4170        req_builder = req_builder.header("Authorization", value);
4171    };
4172    req_builder = req_builder.json(&p_body_form_request);
4173
4174    let req = req_builder.build()?;
4175    let resp = configuration.client.execute(req).await?;
4176
4177    let status = resp.status();
4178    let content_type = resp
4179        .headers()
4180        .get("content-type")
4181        .and_then(|v| v.to_str().ok())
4182        .unwrap_or("application/octet-stream");
4183    let content_type = super::ContentType::from(content_type);
4184
4185    if !status.is_client_error() && !status.is_server_error() {
4186        let content = resp.text().await?;
4187        match content_type {
4188            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4189            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
4190            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`")))),
4191        }
4192    } else {
4193        let content = resp.text().await?;
4194        let entity: Option<CreateFormWithIdError> = serde_json::from_str(&content).ok();
4195        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4196    }
4197}
4198
4199/// Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
4200pub async fn create_group(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, group_request: Option<models::GroupRequest>) -> Result<models::GroupResponse, Error<CreateGroupError>> {
4201    // add a prefix to parameters to efficiently prevent name collisions
4202    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4203    let p_body_group_request = group_request;
4204
4205    let uri_str = format!("{}/api/group", configuration.base_path);
4206    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4207
4208    if let Some(ref user_agent) = configuration.user_agent {
4209        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4210    }
4211    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4212        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4213    }
4214    if let Some(ref apikey) = configuration.api_key {
4215        let key = apikey.key.clone();
4216        let value = match apikey.prefix {
4217            Some(ref prefix) => format!("{} {}", prefix, key),
4218            None => key,
4219        };
4220        req_builder = req_builder.header("Authorization", value);
4221    };
4222    req_builder = req_builder.json(&p_body_group_request);
4223
4224    let req = req_builder.build()?;
4225    let resp = configuration.client.execute(req).await?;
4226
4227    let status = resp.status();
4228    let content_type = resp
4229        .headers()
4230        .get("content-type")
4231        .and_then(|v| v.to_str().ok())
4232        .unwrap_or("application/octet-stream");
4233    let content_type = super::ContentType::from(content_type);
4234
4235    if !status.is_client_error() && !status.is_server_error() {
4236        let content = resp.text().await?;
4237        match content_type {
4238            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4239            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
4240            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`")))),
4241        }
4242    } else {
4243        let content = resp.text().await?;
4244        let entity: Option<CreateGroupError> = serde_json::from_str(&content).ok();
4245        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4246    }
4247}
4248
4249/// Creates a member in a group.
4250pub async fn create_group_members_with_id(configuration: &configuration::Configuration, member_request: Option<models::MemberRequest>) -> Result<models::MemberResponse, Error<CreateGroupMembersWithIdError>> {
4251    // add a prefix to parameters to efficiently prevent name collisions
4252    let p_body_member_request = member_request;
4253
4254    let uri_str = format!("{}/api/group/member", configuration.base_path);
4255    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4256
4257    if let Some(ref user_agent) = configuration.user_agent {
4258        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
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_body_member_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::MemberResponse`"))),
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::MemberResponse`")))),
4287        }
4288    } else {
4289        let content = resp.text().await?;
4290        let entity: Option<CreateGroupMembersWithIdError> = serde_json::from_str(&content).ok();
4291        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4292    }
4293}
4294
4295/// Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
4296pub 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>> {
4297    // add a prefix to parameters to efficiently prevent name collisions
4298    let p_path_group_id = group_id;
4299    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4300    let p_body_group_request = group_request;
4301
4302    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
4303    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4304
4305    if let Some(ref user_agent) = configuration.user_agent {
4306        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4307    }
4308    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4309        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4310    }
4311    if let Some(ref apikey) = configuration.api_key {
4312        let key = apikey.key.clone();
4313        let value = match apikey.prefix {
4314            Some(ref prefix) => format!("{} {}", prefix, key),
4315            None => key,
4316        };
4317        req_builder = req_builder.header("Authorization", value);
4318    };
4319    req_builder = req_builder.json(&p_body_group_request);
4320
4321    let req = req_builder.build()?;
4322    let resp = configuration.client.execute(req).await?;
4323
4324    let status = resp.status();
4325    let content_type = resp
4326        .headers()
4327        .get("content-type")
4328        .and_then(|v| v.to_str().ok())
4329        .unwrap_or("application/octet-stream");
4330    let content_type = super::ContentType::from(content_type);
4331
4332    if !status.is_client_error() && !status.is_server_error() {
4333        let content = resp.text().await?;
4334        match content_type {
4335            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4336            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
4337            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`")))),
4338        }
4339    } else {
4340        let content = resp.text().await?;
4341        let entity: Option<CreateGroupWithIdError> = serde_json::from_str(&content).ok();
4342        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4343    }
4344}
4345
4346/// Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
4347pub async fn create_identity_provider(configuration: &configuration::Configuration, identity_provider_request: Option<models::IdentityProviderRequest>) -> Result<models::IdentityProviderResponse, Error<CreateIdentityProviderError>> {
4348    // add a prefix to parameters to efficiently prevent name collisions
4349    let p_body_identity_provider_request = identity_provider_request;
4350
4351    let uri_str = format!("{}/api/identity-provider", configuration.base_path);
4352    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4353
4354    if let Some(ref user_agent) = configuration.user_agent {
4355        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4356    }
4357    if let Some(ref apikey) = configuration.api_key {
4358        let key = apikey.key.clone();
4359        let value = match apikey.prefix {
4360            Some(ref prefix) => format!("{} {}", prefix, key),
4361            None => key,
4362        };
4363        req_builder = req_builder.header("Authorization", value);
4364    };
4365    req_builder = req_builder.json(&p_body_identity_provider_request);
4366
4367    let req = req_builder.build()?;
4368    let resp = configuration.client.execute(req).await?;
4369
4370    let status = resp.status();
4371    let content_type = resp
4372        .headers()
4373        .get("content-type")
4374        .and_then(|v| v.to_str().ok())
4375        .unwrap_or("application/octet-stream");
4376    let content_type = super::ContentType::from(content_type);
4377
4378    if !status.is_client_error() && !status.is_server_error() {
4379        let content = resp.text().await?;
4380        match content_type {
4381            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4382            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
4383            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`")))),
4384        }
4385    } else {
4386        let content = resp.text().await?;
4387        let entity: Option<CreateIdentityProviderError> = serde_json::from_str(&content).ok();
4388        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4389    }
4390}
4391
4392/// Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
4393pub 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>> {
4394    // add a prefix to parameters to efficiently prevent name collisions
4395    let p_path_identity_provider_id = identity_provider_id;
4396    let p_body_identity_provider_request = identity_provider_request;
4397
4398    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
4399    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4400
4401    if let Some(ref user_agent) = configuration.user_agent {
4402        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4403    }
4404    if let Some(ref apikey) = configuration.api_key {
4405        let key = apikey.key.clone();
4406        let value = match apikey.prefix {
4407            Some(ref prefix) => format!("{} {}", prefix, key),
4408            None => key,
4409        };
4410        req_builder = req_builder.header("Authorization", value);
4411    };
4412    req_builder = req_builder.json(&p_body_identity_provider_request);
4413
4414    let req = req_builder.build()?;
4415    let resp = configuration.client.execute(req).await?;
4416
4417    let status = resp.status();
4418    let content_type = resp
4419        .headers()
4420        .get("content-type")
4421        .and_then(|v| v.to_str().ok())
4422        .unwrap_or("application/octet-stream");
4423    let content_type = super::ContentType::from(content_type);
4424
4425    if !status.is_client_error() && !status.is_server_error() {
4426        let content = resp.text().await?;
4427        match content_type {
4428            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4429            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
4430            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`")))),
4431        }
4432    } else {
4433        let content = resp.text().await?;
4434        let entity: Option<CreateIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
4435        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4436    }
4437}
4438
4439/// Inspect an access token issued as the result of the Client Credentials Grant. OR 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.
4440pub async fn create_introspect(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<CreateIntrospectError>> {
4441
4442    let uri_str = format!("{}/oauth2/introspect", configuration.base_path);
4443    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4444
4445    if let Some(ref user_agent) = configuration.user_agent {
4446        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4447    }
4448    if let Some(ref apikey) = configuration.api_key {
4449        let key = apikey.key.clone();
4450        let value = match apikey.prefix {
4451            Some(ref prefix) => format!("{} {}", prefix, key),
4452            None => key,
4453        };
4454        req_builder = req_builder.header("Authorization", value);
4455    };
4456
4457    let req = req_builder.build()?;
4458    let resp = configuration.client.execute(req).await?;
4459
4460    let status = resp.status();
4461    let content_type = resp
4462        .headers()
4463        .get("content-type")
4464        .and_then(|v| v.to_str().ok())
4465        .unwrap_or("application/octet-stream");
4466    let content_type = super::ContentType::from(content_type);
4467
4468    if !status.is_client_error() && !status.is_server_error() {
4469        let content = resp.text().await?;
4470        match content_type {
4471            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4472            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4473            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`")))),
4474        }
4475    } else {
4476        let content = resp.text().await?;
4477        let entity: Option<CreateIntrospectError> = serde_json::from_str(&content).ok();
4478        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4479    }
4480}
4481
4482/// 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.
4483pub async fn create_ip_access_control_list(configuration: &configuration::Configuration, ip_access_control_list_request: Option<models::IpAccessControlListRequest>) -> Result<models::IpAccessControlListResponse, Error<CreateIpAccessControlListError>> {
4484    // add a prefix to parameters to efficiently prevent name collisions
4485    let p_body_ip_access_control_list_request = ip_access_control_list_request;
4486
4487    let uri_str = format!("{}/api/ip-acl", configuration.base_path);
4488    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4489
4490    if let Some(ref user_agent) = configuration.user_agent {
4491        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4492    }
4493    if let Some(ref apikey) = configuration.api_key {
4494        let key = apikey.key.clone();
4495        let value = match apikey.prefix {
4496            Some(ref prefix) => format!("{} {}", prefix, key),
4497            None => key,
4498        };
4499        req_builder = req_builder.header("Authorization", value);
4500    };
4501    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
4502
4503    let req = req_builder.build()?;
4504    let resp = configuration.client.execute(req).await?;
4505
4506    let status = resp.status();
4507    let content_type = resp
4508        .headers()
4509        .get("content-type")
4510        .and_then(|v| v.to_str().ok())
4511        .unwrap_or("application/octet-stream");
4512    let content_type = super::ContentType::from(content_type);
4513
4514    if !status.is_client_error() && !status.is_server_error() {
4515        let content = resp.text().await?;
4516        match content_type {
4517            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4518            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
4519            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`")))),
4520        }
4521    } else {
4522        let content = resp.text().await?;
4523        let entity: Option<CreateIpAccessControlListError> = serde_json::from_str(&content).ok();
4524        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4525    }
4526}
4527
4528/// 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.
4529pub 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>> {
4530    // add a prefix to parameters to efficiently prevent name collisions
4531    let p_path_access_control_list_id = access_control_list_id;
4532    let p_body_ip_access_control_list_request = ip_access_control_list_request;
4533
4534    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_path_access_control_list_id));
4535    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4536
4537    if let Some(ref user_agent) = configuration.user_agent {
4538        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4539    }
4540    if let Some(ref apikey) = configuration.api_key {
4541        let key = apikey.key.clone();
4542        let value = match apikey.prefix {
4543            Some(ref prefix) => format!("{} {}", prefix, key),
4544            None => key,
4545        };
4546        req_builder = req_builder.header("Authorization", value);
4547    };
4548    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
4549
4550    let req = req_builder.build()?;
4551    let resp = configuration.client.execute(req).await?;
4552
4553    let status = resp.status();
4554    let content_type = resp
4555        .headers()
4556        .get("content-type")
4557        .and_then(|v| v.to_str().ok())
4558        .unwrap_or("application/octet-stream");
4559    let content_type = super::ContentType::from(content_type);
4560
4561    if !status.is_client_error() && !status.is_server_error() {
4562        let content = resp.text().await?;
4563        match content_type {
4564            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4565            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
4566            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`")))),
4567        }
4568    } else {
4569        let content = resp.text().await?;
4570        let entity: Option<CreateIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
4571        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4572    }
4573}
4574
4575/// Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
4576pub async fn create_lambda(configuration: &configuration::Configuration, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<CreateLambdaError>> {
4577    // add a prefix to parameters to efficiently prevent name collisions
4578    let p_body_lambda_request = lambda_request;
4579
4580    let uri_str = format!("{}/api/lambda", configuration.base_path);
4581    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4582
4583    if let Some(ref user_agent) = configuration.user_agent {
4584        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4585    }
4586    if let Some(ref apikey) = configuration.api_key {
4587        let key = apikey.key.clone();
4588        let value = match apikey.prefix {
4589            Some(ref prefix) => format!("{} {}", prefix, key),
4590            None => key,
4591        };
4592        req_builder = req_builder.header("Authorization", value);
4593    };
4594    req_builder = req_builder.json(&p_body_lambda_request);
4595
4596    let req = req_builder.build()?;
4597    let resp = configuration.client.execute(req).await?;
4598
4599    let status = resp.status();
4600    let content_type = resp
4601        .headers()
4602        .get("content-type")
4603        .and_then(|v| v.to_str().ok())
4604        .unwrap_or("application/octet-stream");
4605    let content_type = super::ContentType::from(content_type);
4606
4607    if !status.is_client_error() && !status.is_server_error() {
4608        let content = resp.text().await?;
4609        match content_type {
4610            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4611            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
4612            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`")))),
4613        }
4614    } else {
4615        let content = resp.text().await?;
4616        let entity: Option<CreateLambdaError> = serde_json::from_str(&content).ok();
4617        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4618    }
4619}
4620
4621/// Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
4622pub async fn create_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<CreateLambdaWithIdError>> {
4623    // add a prefix to parameters to efficiently prevent name collisions
4624    let p_path_lambda_id = lambda_id;
4625    let p_body_lambda_request = lambda_request;
4626
4627    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
4628    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4629
4630    if let Some(ref user_agent) = configuration.user_agent {
4631        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4632    }
4633    if let Some(ref apikey) = configuration.api_key {
4634        let key = apikey.key.clone();
4635        let value = match apikey.prefix {
4636            Some(ref prefix) => format!("{} {}", prefix, key),
4637            None => key,
4638        };
4639        req_builder = req_builder.header("Authorization", value);
4640    };
4641    req_builder = req_builder.json(&p_body_lambda_request);
4642
4643    let req = req_builder.build()?;
4644    let resp = configuration.client.execute(req).await?;
4645
4646    let status = resp.status();
4647    let content_type = resp
4648        .headers()
4649        .get("content-type")
4650        .and_then(|v| v.to_str().ok())
4651        .unwrap_or("application/octet-stream");
4652    let content_type = super::ContentType::from(content_type);
4653
4654    if !status.is_client_error() && !status.is_server_error() {
4655        let content = resp.text().await?;
4656        match content_type {
4657            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4658            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
4659            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`")))),
4660        }
4661    } else {
4662        let content = resp.text().await?;
4663        let entity: Option<CreateLambdaWithIdError> = serde_json::from_str(&content).ok();
4664        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4665    }
4666}
4667
4668/// 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. 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 does nothing if the request does not contain an access token or refresh token cookies.
4669pub async fn create_logout(configuration: &configuration::Configuration, global: Option<&str>, refresh_token: Option<&str>, logout_request: Option<models::LogoutRequest>) -> Result<(), Error<CreateLogoutError>> {
4670    // add a prefix to parameters to efficiently prevent name collisions
4671    let p_query_global = global;
4672    let p_query_refresh_token = refresh_token;
4673    let p_body_logout_request = logout_request;
4674
4675    let uri_str = format!("{}/api/logout", configuration.base_path);
4676    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4677
4678    if let Some(ref param_value) = p_query_global {
4679        req_builder = req_builder.query(&[("global", &param_value.to_string())]);
4680    }
4681    if let Some(ref param_value) = p_query_refresh_token {
4682        req_builder = req_builder.query(&[("refreshToken", &param_value.to_string())]);
4683    }
4684    if let Some(ref user_agent) = configuration.user_agent {
4685        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4686    }
4687    if let Some(ref apikey) = configuration.api_key {
4688        let key = apikey.key.clone();
4689        let value = match apikey.prefix {
4690            Some(ref prefix) => format!("{} {}", prefix, key),
4691            None => key,
4692        };
4693        req_builder = req_builder.header("Authorization", value);
4694    };
4695    req_builder = req_builder.json(&p_body_logout_request);
4696
4697    let req = req_builder.build()?;
4698    let resp = configuration.client.execute(req).await?;
4699
4700    let status = resp.status();
4701
4702    if !status.is_client_error() && !status.is_server_error() {
4703        Ok(())
4704    } else {
4705        let content = resp.text().await?;
4706        let entity: Option<CreateLogoutError> = serde_json::from_str(&content).ok();
4707        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4708    }
4709}
4710
4711/// Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
4712pub async fn create_message_template(configuration: &configuration::Configuration, message_template_request: Option<models::MessageTemplateRequest>) -> Result<models::MessageTemplateResponse, Error<CreateMessageTemplateError>> {
4713    // add a prefix to parameters to efficiently prevent name collisions
4714    let p_body_message_template_request = message_template_request;
4715
4716    let uri_str = format!("{}/api/message/template", configuration.base_path);
4717    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4718
4719    if let Some(ref user_agent) = configuration.user_agent {
4720        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4721    }
4722    if let Some(ref apikey) = configuration.api_key {
4723        let key = apikey.key.clone();
4724        let value = match apikey.prefix {
4725            Some(ref prefix) => format!("{} {}", prefix, key),
4726            None => key,
4727        };
4728        req_builder = req_builder.header("Authorization", value);
4729    };
4730    req_builder = req_builder.json(&p_body_message_template_request);
4731
4732    let req = req_builder.build()?;
4733    let resp = configuration.client.execute(req).await?;
4734
4735    let status = resp.status();
4736    let content_type = resp
4737        .headers()
4738        .get("content-type")
4739        .and_then(|v| v.to_str().ok())
4740        .unwrap_or("application/octet-stream");
4741    let content_type = super::ContentType::from(content_type);
4742
4743    if !status.is_client_error() && !status.is_server_error() {
4744        let content = resp.text().await?;
4745        match content_type {
4746            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4747            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
4748            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`")))),
4749        }
4750    } else {
4751        let content = resp.text().await?;
4752        let entity: Option<CreateMessageTemplateError> = serde_json::from_str(&content).ok();
4753        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4754    }
4755}
4756
4757/// Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
4758pub 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>> {
4759    // add a prefix to parameters to efficiently prevent name collisions
4760    let p_path_message_template_id = message_template_id;
4761    let p_body_message_template_request = message_template_request;
4762
4763    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
4764    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4765
4766    if let Some(ref user_agent) = configuration.user_agent {
4767        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4768    }
4769    if let Some(ref apikey) = configuration.api_key {
4770        let key = apikey.key.clone();
4771        let value = match apikey.prefix {
4772            Some(ref prefix) => format!("{} {}", prefix, key),
4773            None => key,
4774        };
4775        req_builder = req_builder.header("Authorization", value);
4776    };
4777    req_builder = req_builder.json(&p_body_message_template_request);
4778
4779    let req = req_builder.build()?;
4780    let resp = configuration.client.execute(req).await?;
4781
4782    let status = resp.status();
4783    let content_type = resp
4784        .headers()
4785        .get("content-type")
4786        .and_then(|v| v.to_str().ok())
4787        .unwrap_or("application/octet-stream");
4788    let content_type = super::ContentType::from(content_type);
4789
4790    if !status.is_client_error() && !status.is_server_error() {
4791        let content = resp.text().await?;
4792        match content_type {
4793            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4794            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
4795            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`")))),
4796        }
4797    } else {
4798        let content = resp.text().await?;
4799        let entity: Option<CreateMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
4800        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4801    }
4802}
4803
4804/// Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
4805pub async fn create_messenger(configuration: &configuration::Configuration, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<CreateMessengerError>> {
4806    // add a prefix to parameters to efficiently prevent name collisions
4807    let p_body_messenger_request = messenger_request;
4808
4809    let uri_str = format!("{}/api/messenger", configuration.base_path);
4810    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4811
4812    if let Some(ref user_agent) = configuration.user_agent {
4813        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4814    }
4815    if let Some(ref apikey) = configuration.api_key {
4816        let key = apikey.key.clone();
4817        let value = match apikey.prefix {
4818            Some(ref prefix) => format!("{} {}", prefix, key),
4819            None => key,
4820        };
4821        req_builder = req_builder.header("Authorization", value);
4822    };
4823    req_builder = req_builder.json(&p_body_messenger_request);
4824
4825    let req = req_builder.build()?;
4826    let resp = configuration.client.execute(req).await?;
4827
4828    let status = resp.status();
4829    let content_type = resp
4830        .headers()
4831        .get("content-type")
4832        .and_then(|v| v.to_str().ok())
4833        .unwrap_or("application/octet-stream");
4834    let content_type = super::ContentType::from(content_type);
4835
4836    if !status.is_client_error() && !status.is_server_error() {
4837        let content = resp.text().await?;
4838        match content_type {
4839            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4840            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
4841            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`")))),
4842        }
4843    } else {
4844        let content = resp.text().await?;
4845        let entity: Option<CreateMessengerError> = serde_json::from_str(&content).ok();
4846        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4847    }
4848}
4849
4850/// Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
4851pub async fn create_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<CreateMessengerWithIdError>> {
4852    // add a prefix to parameters to efficiently prevent name collisions
4853    let p_path_messenger_id = messenger_id;
4854    let p_body_messenger_request = messenger_request;
4855
4856    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
4857    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4858
4859    if let Some(ref user_agent) = configuration.user_agent {
4860        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
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_body_messenger_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::MessengerResponse`"))),
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::MessengerResponse`")))),
4889        }
4890    } else {
4891        let content = resp.text().await?;
4892        let entity: Option<CreateMessengerWithIdError> = 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(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>> {
4899    // add a prefix to parameters to efficiently prevent name collisions
4900    let p_path_application_id = application_id;
4901    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4902    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
4903
4904    let uri_str = format!("{}/api/application/{applicationId}/scope", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
4905    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4906
4907    if let Some(ref user_agent) = configuration.user_agent {
4908        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4909    }
4910    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4911        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4912    }
4913    if let Some(ref apikey) = configuration.api_key {
4914        let key = apikey.key.clone();
4915        let value = match apikey.prefix {
4916            Some(ref prefix) => format!("{} {}", prefix, key),
4917            None => key,
4918        };
4919        req_builder = req_builder.header("Authorization", value);
4920    };
4921    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
4922
4923    let req = req_builder.build()?;
4924    let resp = configuration.client.execute(req).await?;
4925
4926    let status = resp.status();
4927    let content_type = resp
4928        .headers()
4929        .get("content-type")
4930        .and_then(|v| v.to_str().ok())
4931        .unwrap_or("application/octet-stream");
4932    let content_type = super::ContentType::from(content_type);
4933
4934    if !status.is_client_error() && !status.is_server_error() {
4935        let content = resp.text().await?;
4936        match content_type {
4937            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4938            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
4939            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`")))),
4940        }
4941    } else {
4942        let content = resp.text().await?;
4943        let entity: Option<CreateOAuthScopeError> = serde_json::from_str(&content).ok();
4944        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4945    }
4946}
4947
4948/// 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.
4949pub 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>> {
4950    // add a prefix to parameters to efficiently prevent name collisions
4951    let p_path_application_id = application_id;
4952    let p_path_scope_id = scope_id;
4953    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4954    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
4955
4956    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), scopeId=crate::apis::urlencode(p_path_scope_id));
4957    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4958
4959    if let Some(ref user_agent) = configuration.user_agent {
4960        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4961    }
4962    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4963        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4964    }
4965    if let Some(ref apikey) = configuration.api_key {
4966        let key = apikey.key.clone();
4967        let value = match apikey.prefix {
4968            Some(ref prefix) => format!("{} {}", prefix, key),
4969            None => key,
4970        };
4971        req_builder = req_builder.header("Authorization", value);
4972    };
4973    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
4974
4975    let req = req_builder.build()?;
4976    let resp = configuration.client.execute(req).await?;
4977
4978    let status = resp.status();
4979    let content_type = resp
4980        .headers()
4981        .get("content-type")
4982        .and_then(|v| v.to_str().ok())
4983        .unwrap_or("application/octet-stream");
4984    let content_type = super::ContentType::from(content_type);
4985
4986    if !status.is_client_error() && !status.is_server_error() {
4987        let content = resp.text().await?;
4988        match content_type {
4989            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4990            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
4991            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`")))),
4992        }
4993    } else {
4994        let content = resp.text().await?;
4995        let entity: Option<CreateOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
4996        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4997    }
4998}
4999
5000/// Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
5001pub async fn create_tenant(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, tenant_request: Option<models::TenantRequest>) -> Result<models::TenantResponse, Error<CreateTenantError>> {
5002    // add a prefix to parameters to efficiently prevent name collisions
5003    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5004    let p_body_tenant_request = tenant_request;
5005
5006    let uri_str = format!("{}/api/tenant", configuration.base_path);
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_header_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_body_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<CreateTenantError> = serde_json::from_str(&content).ok();
5046        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5047    }
5048}
5049
5050/// Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
5051pub 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>> {
5052    // add a prefix to parameters to efficiently prevent name collisions
5053    let p_path_tenant_id = tenant_id;
5054    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5055    let p_body_tenant_request = tenant_request;
5056
5057    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
5058    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5059
5060    if let Some(ref user_agent) = configuration.user_agent {
5061        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5062    }
5063    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5064        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5065    }
5066    if let Some(ref apikey) = configuration.api_key {
5067        let key = apikey.key.clone();
5068        let value = match apikey.prefix {
5069            Some(ref prefix) => format!("{} {}", prefix, key),
5070            None => key,
5071        };
5072        req_builder = req_builder.header("Authorization", value);
5073    };
5074    req_builder = req_builder.json(&p_body_tenant_request);
5075
5076    let req = req_builder.build()?;
5077    let resp = configuration.client.execute(req).await?;
5078
5079    let status = resp.status();
5080    let content_type = resp
5081        .headers()
5082        .get("content-type")
5083        .and_then(|v| v.to_str().ok())
5084        .unwrap_or("application/octet-stream");
5085    let content_type = super::ContentType::from(content_type);
5086
5087    if !status.is_client_error() && !status.is_server_error() {
5088        let content = resp.text().await?;
5089        match content_type {
5090            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5091            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
5092            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`")))),
5093        }
5094    } else {
5095        let content = resp.text().await?;
5096        let entity: Option<CreateTenantWithIdError> = serde_json::from_str(&content).ok();
5097        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5098    }
5099}
5100
5101/// Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
5102pub async fn create_theme(configuration: &configuration::Configuration, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<CreateThemeError>> {
5103    // add a prefix to parameters to efficiently prevent name collisions
5104    let p_body_theme_request = theme_request;
5105
5106    let uri_str = format!("{}/api/theme", configuration.base_path);
5107    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5108
5109    if let Some(ref user_agent) = configuration.user_agent {
5110        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5111    }
5112    if let Some(ref apikey) = configuration.api_key {
5113        let key = apikey.key.clone();
5114        let value = match apikey.prefix {
5115            Some(ref prefix) => format!("{} {}", prefix, key),
5116            None => key,
5117        };
5118        req_builder = req_builder.header("Authorization", value);
5119    };
5120    req_builder = req_builder.json(&p_body_theme_request);
5121
5122    let req = req_builder.build()?;
5123    let resp = configuration.client.execute(req).await?;
5124
5125    let status = resp.status();
5126    let content_type = resp
5127        .headers()
5128        .get("content-type")
5129        .and_then(|v| v.to_str().ok())
5130        .unwrap_or("application/octet-stream");
5131    let content_type = super::ContentType::from(content_type);
5132
5133    if !status.is_client_error() && !status.is_server_error() {
5134        let content = resp.text().await?;
5135        match content_type {
5136            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5137            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
5138            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`")))),
5139        }
5140    } else {
5141        let content = resp.text().await?;
5142        let entity: Option<CreateThemeError> = serde_json::from_str(&content).ok();
5143        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5144    }
5145}
5146
5147/// Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
5148pub async fn create_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<CreateThemeWithIdError>> {
5149    // add a prefix to parameters to efficiently prevent name collisions
5150    let p_path_theme_id = theme_id;
5151    let p_body_theme_request = theme_request;
5152
5153    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
5154    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5155
5156    if let Some(ref user_agent) = configuration.user_agent {
5157        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5158    }
5159    if let Some(ref apikey) = configuration.api_key {
5160        let key = apikey.key.clone();
5161        let value = match apikey.prefix {
5162            Some(ref prefix) => format!("{} {}", prefix, key),
5163            None => key,
5164        };
5165        req_builder = req_builder.header("Authorization", value);
5166    };
5167    req_builder = req_builder.json(&p_body_theme_request);
5168
5169    let req = req_builder.build()?;
5170    let resp = configuration.client.execute(req).await?;
5171
5172    let status = resp.status();
5173    let content_type = resp
5174        .headers()
5175        .get("content-type")
5176        .and_then(|v| v.to_str().ok())
5177        .unwrap_or("application/octet-stream");
5178    let content_type = super::ContentType::from(content_type);
5179
5180    if !status.is_client_error() && !status.is_server_error() {
5181        let content = resp.text().await?;
5182        match content_type {
5183            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5184            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
5185            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`")))),
5186        }
5187    } else {
5188        let content = resp.text().await?;
5189        let entity: Option<CreateThemeWithIdError> = serde_json::from_str(&content).ok();
5190        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5191    }
5192}
5193
5194/// 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 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 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 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. OR Make a Client Credentials grant request to obtain an access token.
5195pub async fn create_token(configuration: &configuration::Configuration, ) -> Result<models::AccessToken, Error<CreateTokenError>> {
5196
5197    let uri_str = format!("{}/oauth2/token", configuration.base_path);
5198    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5199
5200    if let Some(ref user_agent) = configuration.user_agent {
5201        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5202    }
5203    if let Some(ref apikey) = configuration.api_key {
5204        let key = apikey.key.clone();
5205        let value = match apikey.prefix {
5206            Some(ref prefix) => format!("{} {}", prefix, key),
5207            None => key,
5208        };
5209        req_builder = req_builder.header("Authorization", value);
5210    };
5211
5212    let req = req_builder.build()?;
5213    let resp = configuration.client.execute(req).await?;
5214
5215    let status = resp.status();
5216    let content_type = resp
5217        .headers()
5218        .get("content-type")
5219        .and_then(|v| v.to_str().ok())
5220        .unwrap_or("application/octet-stream");
5221    let content_type = super::ContentType::from(content_type);
5222
5223    if !status.is_client_error() && !status.is_server_error() {
5224        let content = resp.text().await?;
5225        match content_type {
5226            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5227            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AccessToken`"))),
5228            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`")))),
5229        }
5230    } else {
5231        let content = resp.text().await?;
5232        let entity: Option<CreateTokenError> = serde_json::from_str(&content).ok();
5233        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5234    }
5235}
5236
5237/// Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
5238pub async fn create_user(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<CreateUserError>> {
5239    // add a prefix to parameters to efficiently prevent name collisions
5240    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5241    let p_body_user_request = user_request;
5242
5243    let uri_str = format!("{}/api/user", configuration.base_path);
5244    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5245
5246    if let Some(ref user_agent) = configuration.user_agent {
5247        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5248    }
5249    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5250        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5251    }
5252    if let Some(ref apikey) = configuration.api_key {
5253        let key = apikey.key.clone();
5254        let value = match apikey.prefix {
5255            Some(ref prefix) => format!("{} {}", prefix, key),
5256            None => key,
5257        };
5258        req_builder = req_builder.header("Authorization", value);
5259    };
5260    req_builder = req_builder.json(&p_body_user_request);
5261
5262    let req = req_builder.build()?;
5263    let resp = configuration.client.execute(req).await?;
5264
5265    let status = resp.status();
5266    let content_type = resp
5267        .headers()
5268        .get("content-type")
5269        .and_then(|v| v.to_str().ok())
5270        .unwrap_or("application/octet-stream");
5271    let content_type = super::ContentType::from(content_type);
5272
5273    if !status.is_client_error() && !status.is_server_error() {
5274        let content = resp.text().await?;
5275        match content_type {
5276            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5277            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
5278            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`")))),
5279        }
5280    } else {
5281        let content = resp.text().await?;
5282        let entity: Option<CreateUserError> = serde_json::from_str(&content).ok();
5283        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5284    }
5285}
5286
5287/// 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.
5288pub 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>> {
5289    // add a prefix to parameters to efficiently prevent name collisions
5290    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5291    let p_body_user_action_request = user_action_request;
5292
5293    let uri_str = format!("{}/api/user-action", configuration.base_path);
5294    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5295
5296    if let Some(ref user_agent) = configuration.user_agent {
5297        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5298    }
5299    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5300        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5301    }
5302    if let Some(ref apikey) = configuration.api_key {
5303        let key = apikey.key.clone();
5304        let value = match apikey.prefix {
5305            Some(ref prefix) => format!("{} {}", prefix, key),
5306            None => key,
5307        };
5308        req_builder = req_builder.header("Authorization", value);
5309    };
5310    req_builder = req_builder.json(&p_body_user_action_request);
5311
5312    let req = req_builder.build()?;
5313    let resp = configuration.client.execute(req).await?;
5314
5315    let status = resp.status();
5316    let content_type = resp
5317        .headers()
5318        .get("content-type")
5319        .and_then(|v| v.to_str().ok())
5320        .unwrap_or("application/octet-stream");
5321    let content_type = super::ContentType::from(content_type);
5322
5323    if !status.is_client_error() && !status.is_server_error() {
5324        let content = resp.text().await?;
5325        match content_type {
5326            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5327            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
5328            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`")))),
5329        }
5330    } else {
5331        let content = resp.text().await?;
5332        let entity: Option<CreateUserActionError> = serde_json::from_str(&content).ok();
5333        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5334    }
5335}
5336
5337/// 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.
5338pub async fn create_user_action_reason(configuration: &configuration::Configuration, user_action_reason_request: Option<models::UserActionReasonRequest>) -> Result<models::UserActionReasonResponse, Error<CreateUserActionReasonError>> {
5339    // add a prefix to parameters to efficiently prevent name collisions
5340    let p_body_user_action_reason_request = user_action_reason_request;
5341
5342    let uri_str = format!("{}/api/user-action-reason", configuration.base_path);
5343    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5344
5345    if let Some(ref user_agent) = configuration.user_agent {
5346        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5347    }
5348    if let Some(ref apikey) = configuration.api_key {
5349        let key = apikey.key.clone();
5350        let value = match apikey.prefix {
5351            Some(ref prefix) => format!("{} {}", prefix, key),
5352            None => key,
5353        };
5354        req_builder = req_builder.header("Authorization", value);
5355    };
5356    req_builder = req_builder.json(&p_body_user_action_reason_request);
5357
5358    let req = req_builder.build()?;
5359    let resp = configuration.client.execute(req).await?;
5360
5361    let status = resp.status();
5362    let content_type = resp
5363        .headers()
5364        .get("content-type")
5365        .and_then(|v| v.to_str().ok())
5366        .unwrap_or("application/octet-stream");
5367    let content_type = super::ContentType::from(content_type);
5368
5369    if !status.is_client_error() && !status.is_server_error() {
5370        let content = resp.text().await?;
5371        match content_type {
5372            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5373            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
5374            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`")))),
5375        }
5376    } else {
5377        let content = resp.text().await?;
5378        let entity: Option<CreateUserActionReasonError> = serde_json::from_str(&content).ok();
5379        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5380    }
5381}
5382
5383/// 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.
5384pub 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>> {
5385    // add a prefix to parameters to efficiently prevent name collisions
5386    let p_path_user_action_reason_id = user_action_reason_id;
5387    let p_body_user_action_reason_request = user_action_reason_request;
5388
5389    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
5390    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5391
5392    if let Some(ref user_agent) = configuration.user_agent {
5393        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
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_body_user_action_reason_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::UserActionReasonResponse`"))),
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::UserActionReasonResponse`")))),
5422        }
5423    } else {
5424        let content = resp.text().await?;
5425        let entity: Option<CreateUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
5426        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5427    }
5428}
5429
5430/// 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.
5431pub 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>> {
5432    // add a prefix to parameters to efficiently prevent name collisions
5433    let p_path_user_action_id = user_action_id;
5434    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5435    let p_body_user_action_request = user_action_request;
5436
5437    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
5438    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5439
5440    if let Some(ref user_agent) = configuration.user_agent {
5441        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5442    }
5443    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5444        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5445    }
5446    if let Some(ref apikey) = configuration.api_key {
5447        let key = apikey.key.clone();
5448        let value = match apikey.prefix {
5449            Some(ref prefix) => format!("{} {}", prefix, key),
5450            None => key,
5451        };
5452        req_builder = req_builder.header("Authorization", value);
5453    };
5454    req_builder = req_builder.json(&p_body_user_action_request);
5455
5456    let req = req_builder.build()?;
5457    let resp = configuration.client.execute(req).await?;
5458
5459    let status = resp.status();
5460    let content_type = resp
5461        .headers()
5462        .get("content-type")
5463        .and_then(|v| v.to_str().ok())
5464        .unwrap_or("application/octet-stream");
5465    let content_type = super::ContentType::from(content_type);
5466
5467    if !status.is_client_error() && !status.is_server_error() {
5468        let content = resp.text().await?;
5469        match content_type {
5470            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5471            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
5472            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`")))),
5473        }
5474    } else {
5475        let content = resp.text().await?;
5476        let entity: Option<CreateUserActionWithIdError> = serde_json::from_str(&content).ok();
5477        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5478    }
5479}
5480
5481/// Changes a user's password using their access token (JWT) instead of the changePasswordId A common use case for this method will be if you want to allow the user to change their own password.  Remember to send refreshToken in the request body if you want to get a new refresh token when login using the returned oneTimePassword. OR 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.
5482pub async fn create_user_change_password(configuration: &configuration::Configuration, change_password_request: Option<models::ChangePasswordRequest>) -> Result<models::ChangePasswordResponse, Error<CreateUserChangePasswordError>> {
5483    // add a prefix to parameters to efficiently prevent name collisions
5484    let p_body_change_password_request = change_password_request;
5485
5486    let uri_str = format!("{}/api/user/change-password", configuration.base_path);
5487    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5488
5489    if let Some(ref user_agent) = configuration.user_agent {
5490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5491    }
5492    if let Some(ref token) = configuration.bearer_access_token {
5493        req_builder = req_builder.bearer_auth(token.to_owned());
5494    };
5495    req_builder = req_builder.json(&p_body_change_password_request);
5496
5497    let req = req_builder.build()?;
5498    let resp = configuration.client.execute(req).await?;
5499
5500    let status = resp.status();
5501    let content_type = resp
5502        .headers()
5503        .get("content-type")
5504        .and_then(|v| v.to_str().ok())
5505        .unwrap_or("application/octet-stream");
5506    let content_type = super::ContentType::from(content_type);
5507
5508    if !status.is_client_error() && !status.is_server_error() {
5509        let content = resp.text().await?;
5510        match content_type {
5511            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5512            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangePasswordResponse`"))),
5513            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`")))),
5514        }
5515    } else {
5516        let content = resp.text().await?;
5517        let entity: Option<CreateUserChangePasswordError> = serde_json::from_str(&content).ok();
5518        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5519    }
5520}
5521
5522/// Creates a single User consent.
5523pub async fn create_user_consent(configuration: &configuration::Configuration, user_consent_request: Option<models::UserConsentRequest>) -> Result<models::UserConsentResponse, Error<CreateUserConsentError>> {
5524    // add a prefix to parameters to efficiently prevent name collisions
5525    let p_body_user_consent_request = user_consent_request;
5526
5527    let uri_str = format!("{}/api/user/consent", configuration.base_path);
5528    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5529
5530    if let Some(ref user_agent) = configuration.user_agent {
5531        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5532    }
5533    if let Some(ref apikey) = configuration.api_key {
5534        let key = apikey.key.clone();
5535        let value = match apikey.prefix {
5536            Some(ref prefix) => format!("{} {}", prefix, key),
5537            None => key,
5538        };
5539        req_builder = req_builder.header("Authorization", value);
5540    };
5541    req_builder = req_builder.json(&p_body_user_consent_request);
5542
5543    let req = req_builder.build()?;
5544    let resp = configuration.client.execute(req).await?;
5545
5546    let status = resp.status();
5547    let content_type = resp
5548        .headers()
5549        .get("content-type")
5550        .and_then(|v| v.to_str().ok())
5551        .unwrap_or("application/octet-stream");
5552    let content_type = super::ContentType::from(content_type);
5553
5554    if !status.is_client_error() && !status.is_server_error() {
5555        let content = resp.text().await?;
5556        match content_type {
5557            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5558            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
5559            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`")))),
5560        }
5561    } else {
5562        let content = resp.text().await?;
5563        let entity: Option<CreateUserConsentError> = serde_json::from_str(&content).ok();
5564        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5565    }
5566}
5567
5568/// Creates a single User consent.
5569pub 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>> {
5570    // add a prefix to parameters to efficiently prevent name collisions
5571    let p_path_user_consent_id = user_consent_id;
5572    let p_body_user_consent_request = user_consent_request;
5573
5574    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
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_body_user_consent_request);
5589
5590    let req = req_builder.build()?;
5591    let resp = configuration.client.execute(req).await?;
5592
5593    let status = resp.status();
5594    let content_type = resp
5595        .headers()
5596        .get("content-type")
5597        .and_then(|v| v.to_str().ok())
5598        .unwrap_or("application/octet-stream");
5599    let content_type = super::ContentType::from(content_type);
5600
5601    if !status.is_client_error() && !status.is_server_error() {
5602        let content = resp.text().await?;
5603        match content_type {
5604            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5605            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
5606            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`")))),
5607        }
5608    } else {
5609        let content = resp.text().await?;
5610        let entity: Option<CreateUserConsentWithIdError> = serde_json::from_str(&content).ok();
5611        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5612    }
5613}
5614
5615/// Link an external user from a 3rd party identity provider to a FusionAuth user.
5616pub async fn create_user_link_with_id(configuration: &configuration::Configuration, identity_provider_link_request: Option<models::IdentityProviderLinkRequest>) -> Result<models::IdentityProviderLinkResponse, Error<CreateUserLinkWithIdError>> {
5617    // add a prefix to parameters to efficiently prevent name collisions
5618    let p_body_identity_provider_link_request = identity_provider_link_request;
5619
5620    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
5621    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5622
5623    if let Some(ref user_agent) = configuration.user_agent {
5624        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5625    }
5626    if let Some(ref apikey) = configuration.api_key {
5627        let key = apikey.key.clone();
5628        let value = match apikey.prefix {
5629            Some(ref prefix) => format!("{} {}", prefix, key),
5630            None => key,
5631        };
5632        req_builder = req_builder.header("Authorization", value);
5633    };
5634    req_builder = req_builder.json(&p_body_identity_provider_link_request);
5635
5636    let req = req_builder.build()?;
5637    let resp = configuration.client.execute(req).await?;
5638
5639    let status = resp.status();
5640    let content_type = resp
5641        .headers()
5642        .get("content-type")
5643        .and_then(|v| v.to_str().ok())
5644        .unwrap_or("application/octet-stream");
5645    let content_type = super::ContentType::from(content_type);
5646
5647    if !status.is_client_error() && !status.is_server_error() {
5648        let content = resp.text().await?;
5649        match content_type {
5650            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5651            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
5652            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`")))),
5653        }
5654    } else {
5655        let content = resp.text().await?;
5656        let entity: Option<CreateUserLinkWithIdError> = serde_json::from_str(&content).ok();
5657        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5658    }
5659}
5660
5661/// 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.
5662pub async fn create_user_verify_email(configuration: &configuration::Configuration, verify_email_request: Option<models::VerifyEmailRequest>) -> Result<(), Error<CreateUserVerifyEmailError>> {
5663    // add a prefix to parameters to efficiently prevent name collisions
5664    let p_body_verify_email_request = verify_email_request;
5665
5666    let uri_str = format!("{}/api/user/verify-email", configuration.base_path);
5667    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5668
5669    if let Some(ref user_agent) = configuration.user_agent {
5670        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5671    }
5672    if let Some(ref apikey) = configuration.api_key {
5673        let key = apikey.key.clone();
5674        let value = match apikey.prefix {
5675            Some(ref prefix) => format!("{} {}", prefix, key),
5676            None => key,
5677        };
5678        req_builder = req_builder.header("Authorization", value);
5679    };
5680    req_builder = req_builder.json(&p_body_verify_email_request);
5681
5682    let req = req_builder.build()?;
5683    let resp = configuration.client.execute(req).await?;
5684
5685    let status = resp.status();
5686
5687    if !status.is_client_error() && !status.is_server_error() {
5688        Ok(())
5689    } else {
5690        let content = resp.text().await?;
5691        let entity: Option<CreateUserVerifyEmailError> = serde_json::from_str(&content).ok();
5692        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5693    }
5694}
5695
5696/// Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
5697pub 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>> {
5698    // add a prefix to parameters to efficiently prevent name collisions
5699    let p_path_user_id = user_id;
5700    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5701    let p_body_user_request = user_request;
5702
5703    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
5704    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5705
5706    if let Some(ref user_agent) = configuration.user_agent {
5707        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5708    }
5709    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5710        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5711    }
5712    if let Some(ref apikey) = configuration.api_key {
5713        let key = apikey.key.clone();
5714        let value = match apikey.prefix {
5715            Some(ref prefix) => format!("{} {}", prefix, key),
5716            None => key,
5717        };
5718        req_builder = req_builder.header("Authorization", value);
5719    };
5720    req_builder = req_builder.json(&p_body_user_request);
5721
5722    let req = req_builder.build()?;
5723    let resp = configuration.client.execute(req).await?;
5724
5725    let status = resp.status();
5726    let content_type = resp
5727        .headers()
5728        .get("content-type")
5729        .and_then(|v| v.to_str().ok())
5730        .unwrap_or("application/octet-stream");
5731    let content_type = super::ContentType::from(content_type);
5732
5733    if !status.is_client_error() && !status.is_server_error() {
5734        let content = resp.text().await?;
5735        match content_type {
5736            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5737            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
5738            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`")))),
5739        }
5740    } else {
5741        let content = resp.text().await?;
5742        let entity: Option<CreateUserWithIdError> = serde_json::from_str(&content).ok();
5743        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5744    }
5745}
5746
5747/// Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
5748pub async fn create_webhook(configuration: &configuration::Configuration, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<CreateWebhookError>> {
5749    // add a prefix to parameters to efficiently prevent name collisions
5750    let p_body_webhook_request = webhook_request;
5751
5752    let uri_str = format!("{}/api/webhook", configuration.base_path);
5753    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5754
5755    if let Some(ref user_agent) = configuration.user_agent {
5756        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5757    }
5758    if let Some(ref apikey) = configuration.api_key {
5759        let key = apikey.key.clone();
5760        let value = match apikey.prefix {
5761            Some(ref prefix) => format!("{} {}", prefix, key),
5762            None => key,
5763        };
5764        req_builder = req_builder.header("Authorization", value);
5765    };
5766    req_builder = req_builder.json(&p_body_webhook_request);
5767
5768    let req = req_builder.build()?;
5769    let resp = configuration.client.execute(req).await?;
5770
5771    let status = resp.status();
5772    let content_type = resp
5773        .headers()
5774        .get("content-type")
5775        .and_then(|v| v.to_str().ok())
5776        .unwrap_or("application/octet-stream");
5777    let content_type = super::ContentType::from(content_type);
5778
5779    if !status.is_client_error() && !status.is_server_error() {
5780        let content = resp.text().await?;
5781        match content_type {
5782            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5783            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
5784            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`")))),
5785        }
5786    } else {
5787        let content = resp.text().await?;
5788        let entity: Option<CreateWebhookError> = serde_json::from_str(&content).ok();
5789        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5790    }
5791}
5792
5793/// Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
5794pub async fn create_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<CreateWebhookWithIdError>> {
5795    // add a prefix to parameters to efficiently prevent name collisions
5796    let p_path_webhook_id = webhook_id;
5797    let p_body_webhook_request = webhook_request;
5798
5799    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
5800    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5801
5802    if let Some(ref user_agent) = configuration.user_agent {
5803        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5804    }
5805    if let Some(ref apikey) = configuration.api_key {
5806        let key = apikey.key.clone();
5807        let value = match apikey.prefix {
5808            Some(ref prefix) => format!("{} {}", prefix, key),
5809            None => key,
5810        };
5811        req_builder = req_builder.header("Authorization", value);
5812    };
5813    req_builder = req_builder.json(&p_body_webhook_request);
5814
5815    let req = req_builder.build()?;
5816    let resp = configuration.client.execute(req).await?;
5817
5818    let status = resp.status();
5819    let content_type = resp
5820        .headers()
5821        .get("content-type")
5822        .and_then(|v| v.to_str().ok())
5823        .unwrap_or("application/octet-stream");
5824    let content_type = super::ContentType::from(content_type);
5825
5826    if !status.is_client_error() && !status.is_server_error() {
5827        let content = resp.text().await?;
5828        match content_type {
5829            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5830            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
5831            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`")))),
5832        }
5833    } else {
5834        let content = resp.text().await?;
5835        let entity: Option<CreateWebhookWithIdError> = serde_json::from_str(&content).ok();
5836        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5837    }
5838}
5839
5840/// Deletes the API key for the given Id.
5841pub async fn delete_api_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error<DeleteApiKeyWithIdError>> {
5842    // add a prefix to parameters to efficiently prevent name collisions
5843    let p_path_key_id = key_id;
5844
5845    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
5846    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5847
5848    if let Some(ref user_agent) = configuration.user_agent {
5849        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5850    }
5851    if let Some(ref apikey) = configuration.api_key {
5852        let key = apikey.key.clone();
5853        let value = match apikey.prefix {
5854            Some(ref prefix) => format!("{} {}", prefix, key),
5855            None => key,
5856        };
5857        req_builder = req_builder.header("Authorization", value);
5858    };
5859
5860    let req = req_builder.build()?;
5861    let resp = configuration.client.execute(req).await?;
5862
5863    let status = resp.status();
5864
5865    if !status.is_client_error() && !status.is_server_error() {
5866        Ok(())
5867    } else {
5868        let content = resp.text().await?;
5869        let entity: Option<DeleteApiKeyWithIdError> = serde_json::from_str(&content).ok();
5870        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5871    }
5872}
5873
5874/// 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.
5875pub 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>> {
5876    // add a prefix to parameters to efficiently prevent name collisions
5877    let p_path_application_id = application_id;
5878    let p_path_role_id = role_id;
5879    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5880
5881    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), roleId=crate::apis::urlencode(p_path_role_id));
5882    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5883
5884    if let Some(ref user_agent) = configuration.user_agent {
5885        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5886    }
5887    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5888        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5889    }
5890    if let Some(ref apikey) = configuration.api_key {
5891        let key = apikey.key.clone();
5892        let value = match apikey.prefix {
5893            Some(ref prefix) => format!("{} {}", prefix, key),
5894            None => key,
5895        };
5896        req_builder = req_builder.header("Authorization", value);
5897    };
5898
5899    let req = req_builder.build()?;
5900    let resp = configuration.client.execute(req).await?;
5901
5902    let status = resp.status();
5903
5904    if !status.is_client_error() && !status.is_server_error() {
5905        Ok(())
5906    } else {
5907        let content = resp.text().await?;
5908        let entity: Option<DeleteApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
5909        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5910    }
5911}
5912
5913/// 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.
5914pub 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>> {
5915    // add a prefix to parameters to efficiently prevent name collisions
5916    let p_path_application_id = application_id;
5917    let p_query_hard_delete = hard_delete;
5918    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5919
5920    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
5921    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5922
5923    if let Some(ref param_value) = p_query_hard_delete {
5924        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
5925    }
5926    if let Some(ref user_agent) = configuration.user_agent {
5927        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5928    }
5929    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5930        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5931    }
5932    if let Some(ref apikey) = configuration.api_key {
5933        let key = apikey.key.clone();
5934        let value = match apikey.prefix {
5935            Some(ref prefix) => format!("{} {}", prefix, key),
5936            None => key,
5937        };
5938        req_builder = req_builder.header("Authorization", value);
5939    };
5940
5941    let req = req_builder.build()?;
5942    let resp = configuration.client.execute(req).await?;
5943
5944    let status = resp.status();
5945
5946    if !status.is_client_error() && !status.is_server_error() {
5947        Ok(())
5948    } else {
5949        let content = resp.text().await?;
5950        let entity: Option<DeleteApplicationWithIdError> = serde_json::from_str(&content).ok();
5951        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5952    }
5953}
5954
5955/// Deletes the connector for the given Id.
5956pub async fn delete_connector_with_id(configuration: &configuration::Configuration, connector_id: &str) -> Result<(), Error<DeleteConnectorWithIdError>> {
5957    // add a prefix to parameters to efficiently prevent name collisions
5958    let p_path_connector_id = connector_id;
5959
5960    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
5961    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5962
5963    if let Some(ref user_agent) = configuration.user_agent {
5964        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5965    }
5966    if let Some(ref apikey) = configuration.api_key {
5967        let key = apikey.key.clone();
5968        let value = match apikey.prefix {
5969            Some(ref prefix) => format!("{} {}", prefix, key),
5970            None => key,
5971        };
5972        req_builder = req_builder.header("Authorization", value);
5973    };
5974
5975    let req = req_builder.build()?;
5976    let resp = configuration.client.execute(req).await?;
5977
5978    let status = resp.status();
5979
5980    if !status.is_client_error() && !status.is_server_error() {
5981        Ok(())
5982    } else {
5983        let content = resp.text().await?;
5984        let entity: Option<DeleteConnectorWithIdError> = serde_json::from_str(&content).ok();
5985        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5986    }
5987}
5988
5989/// Deletes the consent for the given Id.
5990pub async fn delete_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteConsentWithIdError>> {
5991    // add a prefix to parameters to efficiently prevent name collisions
5992    let p_path_consent_id = consent_id;
5993    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5994
5995    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
5996    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5997
5998    if let Some(ref user_agent) = configuration.user_agent {
5999        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6000    }
6001    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6002        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6003    }
6004    if let Some(ref apikey) = configuration.api_key {
6005        let key = apikey.key.clone();
6006        let value = match apikey.prefix {
6007            Some(ref prefix) => format!("{} {}", prefix, key),
6008            None => key,
6009        };
6010        req_builder = req_builder.header("Authorization", value);
6011    };
6012
6013    let req = req_builder.build()?;
6014    let resp = configuration.client.execute(req).await?;
6015
6016    let status = resp.status();
6017
6018    if !status.is_client_error() && !status.is_server_error() {
6019        Ok(())
6020    } else {
6021        let content = resp.text().await?;
6022        let entity: Option<DeleteConsentWithIdError> = serde_json::from_str(&content).ok();
6023        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6024    }
6025}
6026
6027/// Deletes the email template for the given Id.
6028pub async fn delete_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEmailTemplateWithIdError>> {
6029    // add a prefix to parameters to efficiently prevent name collisions
6030    let p_path_email_template_id = email_template_id;
6031    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6032
6033    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
6034    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6035
6036    if let Some(ref user_agent) = configuration.user_agent {
6037        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6038    }
6039    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6040        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6041    }
6042    if let Some(ref apikey) = configuration.api_key {
6043        let key = apikey.key.clone();
6044        let value = match apikey.prefix {
6045            Some(ref prefix) => format!("{} {}", prefix, key),
6046            None => key,
6047        };
6048        req_builder = req_builder.header("Authorization", value);
6049    };
6050
6051    let req = req_builder.build()?;
6052    let resp = configuration.client.execute(req).await?;
6053
6054    let status = resp.status();
6055
6056    if !status.is_client_error() && !status.is_server_error() {
6057        Ok(())
6058    } else {
6059        let content = resp.text().await?;
6060        let entity: Option<DeleteEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
6061        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6062    }
6063}
6064
6065/// Deletes an Entity Grant for the given User or Entity.
6066pub 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>> {
6067    // add a prefix to parameters to efficiently prevent name collisions
6068    let p_path_entity_id = entity_id;
6069    let p_query_recipient_entity_id = recipient_entity_id;
6070    let p_query_user_id = user_id;
6071    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6072
6073    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
6074    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6075
6076    if let Some(ref param_value) = p_query_recipient_entity_id {
6077        req_builder = req_builder.query(&[("recipientEntityId", &param_value.to_string())]);
6078    }
6079    if let Some(ref param_value) = p_query_user_id {
6080        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6081    }
6082    if let Some(ref user_agent) = configuration.user_agent {
6083        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6084    }
6085    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6086        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6087    }
6088    if let Some(ref apikey) = configuration.api_key {
6089        let key = apikey.key.clone();
6090        let value = match apikey.prefix {
6091            Some(ref prefix) => format!("{} {}", prefix, key),
6092            None => key,
6093        };
6094        req_builder = req_builder.header("Authorization", value);
6095    };
6096
6097    let req = req_builder.build()?;
6098    let resp = configuration.client.execute(req).await?;
6099
6100    let status = resp.status();
6101
6102    if !status.is_client_error() && !status.is_server_error() {
6103        Ok(())
6104    } else {
6105        let content = resp.text().await?;
6106        let entity: Option<DeleteEntityGrantWithIdError> = serde_json::from_str(&content).ok();
6107        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6108    }
6109}
6110
6111/// 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.
6112pub async fn delete_entity_type_permission_with_id(configuration: &configuration::Configuration, entity_type_id: &str, permission_id: &str) -> Result<(), Error<DeleteEntityTypePermissionWithIdError>> {
6113    // add a prefix to parameters to efficiently prevent name collisions
6114    let p_path_entity_type_id = entity_type_id;
6115    let p_path_permission_id = permission_id;
6116
6117    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id), permissionId=crate::apis::urlencode(p_path_permission_id));
6118    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6119
6120    if let Some(ref user_agent) = configuration.user_agent {
6121        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6122    }
6123    if let Some(ref apikey) = configuration.api_key {
6124        let key = apikey.key.clone();
6125        let value = match apikey.prefix {
6126            Some(ref prefix) => format!("{} {}", prefix, key),
6127            None => key,
6128        };
6129        req_builder = req_builder.header("Authorization", value);
6130    };
6131
6132    let req = req_builder.build()?;
6133    let resp = configuration.client.execute(req).await?;
6134
6135    let status = resp.status();
6136
6137    if !status.is_client_error() && !status.is_server_error() {
6138        Ok(())
6139    } else {
6140        let content = resp.text().await?;
6141        let entity: Option<DeleteEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
6142        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6143    }
6144}
6145
6146/// Deletes the Entity Type for the given Id.
6147pub async fn delete_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str) -> Result<(), Error<DeleteEntityTypeWithIdError>> {
6148    // add a prefix to parameters to efficiently prevent name collisions
6149    let p_path_entity_type_id = entity_type_id;
6150
6151    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
6152    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6153
6154    if let Some(ref user_agent) = configuration.user_agent {
6155        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6156    }
6157    if let Some(ref apikey) = configuration.api_key {
6158        let key = apikey.key.clone();
6159        let value = match apikey.prefix {
6160            Some(ref prefix) => format!("{} {}", prefix, key),
6161            None => key,
6162        };
6163        req_builder = req_builder.header("Authorization", value);
6164    };
6165
6166    let req = req_builder.build()?;
6167    let resp = configuration.client.execute(req).await?;
6168
6169    let status = resp.status();
6170
6171    if !status.is_client_error() && !status.is_server_error() {
6172        Ok(())
6173    } else {
6174        let content = resp.text().await?;
6175        let entity: Option<DeleteEntityTypeWithIdError> = serde_json::from_str(&content).ok();
6176        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6177    }
6178}
6179
6180/// Deletes the Entity for the given Id.
6181pub async fn delete_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEntityWithIdError>> {
6182    // add a prefix to parameters to efficiently prevent name collisions
6183    let p_path_entity_id = entity_id;
6184    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6185
6186    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
6187    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6188
6189    if let Some(ref user_agent) = configuration.user_agent {
6190        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6191    }
6192    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6193        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6194    }
6195    if let Some(ref apikey) = configuration.api_key {
6196        let key = apikey.key.clone();
6197        let value = match apikey.prefix {
6198            Some(ref prefix) => format!("{} {}", prefix, key),
6199            None => key,
6200        };
6201        req_builder = req_builder.header("Authorization", value);
6202    };
6203
6204    let req = req_builder.build()?;
6205    let resp = configuration.client.execute(req).await?;
6206
6207    let status = resp.status();
6208
6209    if !status.is_client_error() && !status.is_server_error() {
6210        Ok(())
6211    } else {
6212        let content = resp.text().await?;
6213        let entity: Option<DeleteEntityWithIdError> = serde_json::from_str(&content).ok();
6214        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6215    }
6216}
6217
6218/// Deletes the form field for the given Id.
6219pub async fn delete_form_field_with_id(configuration: &configuration::Configuration, field_id: &str) -> Result<(), Error<DeleteFormFieldWithIdError>> {
6220    // add a prefix to parameters to efficiently prevent name collisions
6221    let p_path_field_id = field_id;
6222
6223    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
6224    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6225
6226    if let Some(ref user_agent) = configuration.user_agent {
6227        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6228    }
6229    if let Some(ref apikey) = configuration.api_key {
6230        let key = apikey.key.clone();
6231        let value = match apikey.prefix {
6232            Some(ref prefix) => format!("{} {}", prefix, key),
6233            None => key,
6234        };
6235        req_builder = req_builder.header("Authorization", value);
6236    };
6237
6238    let req = req_builder.build()?;
6239    let resp = configuration.client.execute(req).await?;
6240
6241    let status = resp.status();
6242
6243    if !status.is_client_error() && !status.is_server_error() {
6244        Ok(())
6245    } else {
6246        let content = resp.text().await?;
6247        let entity: Option<DeleteFormFieldWithIdError> = serde_json::from_str(&content).ok();
6248        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6249    }
6250}
6251
6252/// Deletes the form for the given Id.
6253pub async fn delete_form_with_id(configuration: &configuration::Configuration, form_id: &str) -> Result<(), Error<DeleteFormWithIdError>> {
6254    // add a prefix to parameters to efficiently prevent name collisions
6255    let p_path_form_id = form_id;
6256
6257    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
6258    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6259
6260    if let Some(ref user_agent) = configuration.user_agent {
6261        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6262    }
6263    if let Some(ref apikey) = configuration.api_key {
6264        let key = apikey.key.clone();
6265        let value = match apikey.prefix {
6266            Some(ref prefix) => format!("{} {}", prefix, key),
6267            None => key,
6268        };
6269        req_builder = req_builder.header("Authorization", value);
6270    };
6271
6272    let req = req_builder.build()?;
6273    let resp = configuration.client.execute(req).await?;
6274
6275    let status = resp.status();
6276
6277    if !status.is_client_error() && !status.is_server_error() {
6278        Ok(())
6279    } else {
6280        let content = resp.text().await?;
6281        let entity: Option<DeleteFormWithIdError> = serde_json::from_str(&content).ok();
6282        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6283    }
6284}
6285
6286/// Removes users as members of a group.
6287pub async fn delete_group_members_with_id(configuration: &configuration::Configuration, member_delete_request: Option<models::MemberDeleteRequest>) -> Result<(), Error<DeleteGroupMembersWithIdError>> {
6288    // add a prefix to parameters to efficiently prevent name collisions
6289    let p_body_member_delete_request = member_delete_request;
6290
6291    let uri_str = format!("{}/api/group/member", configuration.base_path);
6292    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6293
6294    if let Some(ref user_agent) = configuration.user_agent {
6295        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6296    }
6297    if let Some(ref apikey) = configuration.api_key {
6298        let key = apikey.key.clone();
6299        let value = match apikey.prefix {
6300            Some(ref prefix) => format!("{} {}", prefix, key),
6301            None => key,
6302        };
6303        req_builder = req_builder.header("Authorization", value);
6304    };
6305    req_builder = req_builder.json(&p_body_member_delete_request);
6306
6307    let req = req_builder.build()?;
6308    let resp = configuration.client.execute(req).await?;
6309
6310    let status = resp.status();
6311
6312    if !status.is_client_error() && !status.is_server_error() {
6313        Ok(())
6314    } else {
6315        let content = resp.text().await?;
6316        let entity: Option<DeleteGroupMembersWithIdError> = serde_json::from_str(&content).ok();
6317        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6318    }
6319}
6320
6321/// Deletes the group for the given Id.
6322pub async fn delete_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteGroupWithIdError>> {
6323    // add a prefix to parameters to efficiently prevent name collisions
6324    let p_path_group_id = group_id;
6325    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6326
6327    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
6328    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6329
6330    if let Some(ref user_agent) = configuration.user_agent {
6331        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6332    }
6333    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6334        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6335    }
6336    if let Some(ref apikey) = configuration.api_key {
6337        let key = apikey.key.clone();
6338        let value = match apikey.prefix {
6339            Some(ref prefix) => format!("{} {}", prefix, key),
6340            None => key,
6341        };
6342        req_builder = req_builder.header("Authorization", value);
6343    };
6344
6345    let req = req_builder.build()?;
6346    let resp = configuration.client.execute(req).await?;
6347
6348    let status = resp.status();
6349
6350    if !status.is_client_error() && !status.is_server_error() {
6351        Ok(())
6352    } else {
6353        let content = resp.text().await?;
6354        let entity: Option<DeleteGroupWithIdError> = serde_json::from_str(&content).ok();
6355        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6356    }
6357}
6358
6359/// Deletes the identity provider for the given Id.
6360pub async fn delete_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str) -> Result<(), Error<DeleteIdentityProviderWithIdError>> {
6361    // add a prefix to parameters to efficiently prevent name collisions
6362    let p_path_identity_provider_id = identity_provider_id;
6363
6364    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
6365    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6366
6367    if let Some(ref user_agent) = configuration.user_agent {
6368        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6369    }
6370    if let Some(ref apikey) = configuration.api_key {
6371        let key = apikey.key.clone();
6372        let value = match apikey.prefix {
6373            Some(ref prefix) => format!("{} {}", prefix, key),
6374            None => key,
6375        };
6376        req_builder = req_builder.header("Authorization", value);
6377    };
6378
6379    let req = req_builder.build()?;
6380    let resp = configuration.client.execute(req).await?;
6381
6382    let status = resp.status();
6383
6384    if !status.is_client_error() && !status.is_server_error() {
6385        Ok(())
6386    } else {
6387        let content = resp.text().await?;
6388        let entity: Option<DeleteIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
6389        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6390    }
6391}
6392
6393/// Deletes the IP Access Control List for the given Id.
6394pub async fn delete_ip_access_control_list_with_id(configuration: &configuration::Configuration, ip_access_control_list_id: &str) -> Result<(), Error<DeleteIpAccessControlListWithIdError>> {
6395    // add a prefix to parameters to efficiently prevent name collisions
6396    let p_path_ip_access_control_list_id = ip_access_control_list_id;
6397
6398    let uri_str = format!("{}/api/ip-acl/{ipAccessControlListId}", configuration.base_path, ipAccessControlListId=crate::apis::urlencode(p_path_ip_access_control_list_id));
6399    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6400
6401    if let Some(ref user_agent) = configuration.user_agent {
6402        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6403    }
6404    if let Some(ref apikey) = configuration.api_key {
6405        let key = apikey.key.clone();
6406        let value = match apikey.prefix {
6407            Some(ref prefix) => format!("{} {}", prefix, key),
6408            None => key,
6409        };
6410        req_builder = req_builder.header("Authorization", value);
6411    };
6412
6413    let req = req_builder.build()?;
6414    let resp = configuration.client.execute(req).await?;
6415
6416    let status = resp.status();
6417
6418    if !status.is_client_error() && !status.is_server_error() {
6419        Ok(())
6420    } else {
6421        let content = resp.text().await?;
6422        let entity: Option<DeleteIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
6423        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6424    }
6425}
6426
6427/// 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 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 a user by user Id. OR Revoke all refresh tokens that belong to an application by applicationId. 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
6428pub 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>> {
6429    // add a prefix to parameters to efficiently prevent name collisions
6430    let p_query_user_id = user_id;
6431    let p_query_application_id = application_id;
6432    let p_query_token = token;
6433    let p_body_refresh_token_revoke_request = refresh_token_revoke_request;
6434
6435    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
6436    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6437
6438    if let Some(ref param_value) = p_query_user_id {
6439        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6440    }
6441    if let Some(ref param_value) = p_query_application_id {
6442        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
6443    }
6444    if let Some(ref param_value) = p_query_token {
6445        req_builder = req_builder.query(&[("token", &param_value.to_string())]);
6446    }
6447    if let Some(ref user_agent) = configuration.user_agent {
6448        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6449    }
6450    if let Some(ref apikey) = configuration.api_key {
6451        let key = apikey.key.clone();
6452        let value = match apikey.prefix {
6453            Some(ref prefix) => format!("{} {}", prefix, key),
6454            None => key,
6455        };
6456        req_builder = req_builder.header("Authorization", value);
6457    };
6458    req_builder = req_builder.json(&p_body_refresh_token_revoke_request);
6459
6460    let req = req_builder.build()?;
6461    let resp = configuration.client.execute(req).await?;
6462
6463    let status = resp.status();
6464
6465    if !status.is_client_error() && !status.is_server_error() {
6466        Ok(())
6467    } else {
6468        let content = resp.text().await?;
6469        let entity: Option<DeleteJwtRefreshError> = serde_json::from_str(&content).ok();
6470        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6471    }
6472}
6473
6474/// Deletes the key for the given Id.
6475pub async fn delete_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error<DeleteKeyWithIdError>> {
6476    // add a prefix to parameters to efficiently prevent name collisions
6477    let p_path_key_id = key_id;
6478
6479    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
6480    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6481
6482    if let Some(ref user_agent) = configuration.user_agent {
6483        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6484    }
6485    if let Some(ref apikey) = configuration.api_key {
6486        let key = apikey.key.clone();
6487        let value = match apikey.prefix {
6488            Some(ref prefix) => format!("{} {}", prefix, key),
6489            None => key,
6490        };
6491        req_builder = req_builder.header("Authorization", value);
6492    };
6493
6494    let req = req_builder.build()?;
6495    let resp = configuration.client.execute(req).await?;
6496
6497    let status = resp.status();
6498
6499    if !status.is_client_error() && !status.is_server_error() {
6500        Ok(())
6501    } else {
6502        let content = resp.text().await?;
6503        let entity: Option<DeleteKeyWithIdError> = serde_json::from_str(&content).ok();
6504        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6505    }
6506}
6507
6508/// Deletes the lambda for the given Id.
6509pub async fn delete_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str) -> Result<(), Error<DeleteLambdaWithIdError>> {
6510    // add a prefix to parameters to efficiently prevent name collisions
6511    let p_path_lambda_id = lambda_id;
6512
6513    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
6514    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6515
6516    if let Some(ref user_agent) = configuration.user_agent {
6517        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6518    }
6519    if let Some(ref apikey) = configuration.api_key {
6520        let key = apikey.key.clone();
6521        let value = match apikey.prefix {
6522            Some(ref prefix) => format!("{} {}", prefix, key),
6523            None => key,
6524        };
6525        req_builder = req_builder.header("Authorization", value);
6526    };
6527
6528    let req = req_builder.build()?;
6529    let resp = configuration.client.execute(req).await?;
6530
6531    let status = resp.status();
6532
6533    if !status.is_client_error() && !status.is_server_error() {
6534        Ok(())
6535    } else {
6536        let content = resp.text().await?;
6537        let entity: Option<DeleteLambdaWithIdError> = serde_json::from_str(&content).ok();
6538        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6539    }
6540}
6541
6542/// Deletes the message template for the given Id.
6543pub async fn delete_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str) -> Result<(), Error<DeleteMessageTemplateWithIdError>> {
6544    // add a prefix to parameters to efficiently prevent name collisions
6545    let p_path_message_template_id = message_template_id;
6546
6547    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
6548    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6549
6550    if let Some(ref user_agent) = configuration.user_agent {
6551        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6552    }
6553    if let Some(ref apikey) = configuration.api_key {
6554        let key = apikey.key.clone();
6555        let value = match apikey.prefix {
6556            Some(ref prefix) => format!("{} {}", prefix, key),
6557            None => key,
6558        };
6559        req_builder = req_builder.header("Authorization", value);
6560    };
6561
6562    let req = req_builder.build()?;
6563    let resp = configuration.client.execute(req).await?;
6564
6565    let status = resp.status();
6566
6567    if !status.is_client_error() && !status.is_server_error() {
6568        Ok(())
6569    } else {
6570        let content = resp.text().await?;
6571        let entity: Option<DeleteMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
6572        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6573    }
6574}
6575
6576/// Deletes the messenger for the given Id.
6577pub async fn delete_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str) -> Result<(), Error<DeleteMessengerWithIdError>> {
6578    // add a prefix to parameters to efficiently prevent name collisions
6579    let p_path_messenger_id = messenger_id;
6580
6581    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
6582    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6583
6584    if let Some(ref user_agent) = configuration.user_agent {
6585        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6586    }
6587    if let Some(ref apikey) = configuration.api_key {
6588        let key = apikey.key.clone();
6589        let value = match apikey.prefix {
6590            Some(ref prefix) => format!("{} {}", prefix, key),
6591            None => key,
6592        };
6593        req_builder = req_builder.header("Authorization", value);
6594    };
6595
6596    let req = req_builder.build()?;
6597    let resp = configuration.client.execute(req).await?;
6598
6599    let status = resp.status();
6600
6601    if !status.is_client_error() && !status.is_server_error() {
6602        Ok(())
6603    } else {
6604        let content = resp.text().await?;
6605        let entity: Option<DeleteMessengerWithIdError> = serde_json::from_str(&content).ok();
6606        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6607    }
6608}
6609
6610/// 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.
6611pub 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>> {
6612    // add a prefix to parameters to efficiently prevent name collisions
6613    let p_path_application_id = application_id;
6614    let p_path_scope_id = scope_id;
6615    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6616
6617    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), scopeId=crate::apis::urlencode(p_path_scope_id));
6618    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6619
6620    if let Some(ref user_agent) = configuration.user_agent {
6621        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6622    }
6623    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6624        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6625    }
6626    if let Some(ref apikey) = configuration.api_key {
6627        let key = apikey.key.clone();
6628        let value = match apikey.prefix {
6629            Some(ref prefix) => format!("{} {}", prefix, key),
6630            None => key,
6631        };
6632        req_builder = req_builder.header("Authorization", value);
6633    };
6634
6635    let req = req_builder.build()?;
6636    let resp = configuration.client.execute(req).await?;
6637
6638    let status = resp.status();
6639
6640    if !status.is_client_error() && !status.is_server_error() {
6641        Ok(())
6642    } else {
6643        let content = resp.text().await?;
6644        let entity: Option<DeleteOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
6645        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6646    }
6647}
6648
6649/// 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). 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 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).
6650pub 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>> {
6651    // add a prefix to parameters to efficiently prevent name collisions
6652    let p_path_tenant_id = tenant_id;
6653    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6654    let p_query_async = r#async;
6655    let p_body_tenant_delete_request = tenant_delete_request;
6656
6657    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
6658    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6659
6660    if let Some(ref param_value) = p_query_async {
6661        req_builder = req_builder.query(&[("async", &param_value.to_string())]);
6662    }
6663    if let Some(ref user_agent) = configuration.user_agent {
6664        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6665    }
6666    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6667        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6668    }
6669    if let Some(ref apikey) = configuration.api_key {
6670        let key = apikey.key.clone();
6671        let value = match apikey.prefix {
6672            Some(ref prefix) => format!("{} {}", prefix, key),
6673            None => key,
6674        };
6675        req_builder = req_builder.header("Authorization", value);
6676    };
6677    req_builder = req_builder.json(&p_body_tenant_delete_request);
6678
6679    let req = req_builder.build()?;
6680    let resp = configuration.client.execute(req).await?;
6681
6682    let status = resp.status();
6683
6684    if !status.is_client_error() && !status.is_server_error() {
6685        Ok(())
6686    } else {
6687        let content = resp.text().await?;
6688        let entity: Option<DeleteTenantWithIdError> = serde_json::from_str(&content).ok();
6689        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6690    }
6691}
6692
6693/// Deletes the theme for the given Id.
6694pub async fn delete_theme_with_id(configuration: &configuration::Configuration, theme_id: &str) -> Result<(), Error<DeleteThemeWithIdError>> {
6695    // add a prefix to parameters to efficiently prevent name collisions
6696    let p_path_theme_id = theme_id;
6697
6698    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
6699    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6700
6701    if let Some(ref user_agent) = configuration.user_agent {
6702        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6703    }
6704    if let Some(ref apikey) = configuration.api_key {
6705        let key = apikey.key.clone();
6706        let value = match apikey.prefix {
6707            Some(ref prefix) => format!("{} {}", prefix, key),
6708            None => key,
6709        };
6710        req_builder = req_builder.header("Authorization", value);
6711    };
6712
6713    let req = req_builder.build()?;
6714    let resp = configuration.client.execute(req).await?;
6715
6716    let status = resp.status();
6717
6718    if !status.is_client_error() && !status.is_server_error() {
6719        Ok(())
6720    } else {
6721        let content = resp.text().await?;
6722        let entity: Option<DeleteThemeWithIdError> = serde_json::from_str(&content).ok();
6723        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6724    }
6725}
6726
6727/// Deletes the user action reason for the given Id.
6728pub async fn delete_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str) -> Result<(), Error<DeleteUserActionReasonWithIdError>> {
6729    // add a prefix to parameters to efficiently prevent name collisions
6730    let p_path_user_action_reason_id = user_action_reason_id;
6731
6732    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
6733    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6734
6735    if let Some(ref user_agent) = configuration.user_agent {
6736        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6737    }
6738    if let Some(ref apikey) = configuration.api_key {
6739        let key = apikey.key.clone();
6740        let value = match apikey.prefix {
6741            Some(ref prefix) => format!("{} {}", prefix, key),
6742            None => key,
6743        };
6744        req_builder = req_builder.header("Authorization", value);
6745    };
6746
6747    let req = req_builder.build()?;
6748    let resp = configuration.client.execute(req).await?;
6749
6750    let status = resp.status();
6751
6752    if !status.is_client_error() && !status.is_server_error() {
6753        Ok(())
6754    } else {
6755        let content = resp.text().await?;
6756        let entity: Option<DeleteUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
6757        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6758    }
6759}
6760
6761/// 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. OR Deactivates the user action with the given Id.
6762pub async fn delete_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, hard_delete: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteUserActionWithIdError>> {
6763    // add a prefix to parameters to efficiently prevent name collisions
6764    let p_path_user_action_id = user_action_id;
6765    let p_query_hard_delete = hard_delete;
6766    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6767
6768    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
6769    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6770
6771    if let Some(ref param_value) = p_query_hard_delete {
6772        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6773    }
6774    if let Some(ref user_agent) = configuration.user_agent {
6775        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6776    }
6777    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6778        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6779    }
6780    if let Some(ref apikey) = configuration.api_key {
6781        let key = apikey.key.clone();
6782        let value = match apikey.prefix {
6783            Some(ref prefix) => format!("{} {}", prefix, key),
6784            None => key,
6785        };
6786        req_builder = req_builder.header("Authorization", value);
6787    };
6788
6789    let req = req_builder.build()?;
6790    let resp = configuration.client.execute(req).await?;
6791
6792    let status = resp.status();
6793
6794    if !status.is_client_error() && !status.is_server_error() {
6795        Ok(())
6796    } else {
6797        let content = resp.text().await?;
6798        let entity: Option<DeleteUserActionWithIdError> = serde_json::from_str(&content).ok();
6799        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6800    }
6801}
6802
6803/// 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. OR Deactivates the users with the given Ids.
6804pub 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>> {
6805    // add a prefix to parameters to efficiently prevent name collisions
6806    let p_query_user_ids = user_ids;
6807    let p_query_dry_run = dry_run;
6808    let p_query_hard_delete = hard_delete;
6809    let p_body_user_delete_request = user_delete_request;
6810
6811    let uri_str = format!("{}/api/user/bulk", configuration.base_path);
6812    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6813
6814    if let Some(ref param_value) = p_query_user_ids {
6815        req_builder = req_builder.query(&[("userIds", &param_value.to_string())]);
6816    }
6817    if let Some(ref param_value) = p_query_dry_run {
6818        req_builder = req_builder.query(&[("dryRun", &param_value.to_string())]);
6819    }
6820    if let Some(ref param_value) = p_query_hard_delete {
6821        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6822    }
6823    if let Some(ref user_agent) = configuration.user_agent {
6824        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6825    }
6826    if let Some(ref apikey) = configuration.api_key {
6827        let key = apikey.key.clone();
6828        let value = match apikey.prefix {
6829            Some(ref prefix) => format!("{} {}", prefix, key),
6830            None => key,
6831        };
6832        req_builder = req_builder.header("Authorization", value);
6833    };
6834    req_builder = req_builder.json(&p_body_user_delete_request);
6835
6836    let req = req_builder.build()?;
6837    let resp = configuration.client.execute(req).await?;
6838
6839    let status = resp.status();
6840    let content_type = resp
6841        .headers()
6842        .get("content-type")
6843        .and_then(|v| v.to_str().ok())
6844        .unwrap_or("application/octet-stream");
6845    let content_type = super::ContentType::from(content_type);
6846
6847    if !status.is_client_error() && !status.is_server_error() {
6848        let content = resp.text().await?;
6849        match content_type {
6850            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6851            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserDeleteResponse`"))),
6852            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`")))),
6853        }
6854    } else {
6855        let content = resp.text().await?;
6856        let entity: Option<DeleteUserBulkError> = serde_json::from_str(&content).ok();
6857        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6858    }
6859}
6860
6861/// Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
6862pub 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>> {
6863    // add a prefix to parameters to efficiently prevent name collisions
6864    let p_query_identity_provider_id = identity_provider_id;
6865    let p_query_identity_provider_user_id = identity_provider_user_id;
6866    let p_query_user_id = user_id;
6867
6868    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
6869    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6870
6871    if let Some(ref param_value) = p_query_identity_provider_id {
6872        req_builder = req_builder.query(&[("identityProviderId", &param_value.to_string())]);
6873    }
6874    if let Some(ref param_value) = p_query_identity_provider_user_id {
6875        req_builder = req_builder.query(&[("identityProviderUserId", &param_value.to_string())]);
6876    }
6877    if let Some(ref param_value) = p_query_user_id {
6878        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6879    }
6880    if let Some(ref user_agent) = configuration.user_agent {
6881        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6882    }
6883    if let Some(ref apikey) = configuration.api_key {
6884        let key = apikey.key.clone();
6885        let value = match apikey.prefix {
6886            Some(ref prefix) => format!("{} {}", prefix, key),
6887            None => key,
6888        };
6889        req_builder = req_builder.header("Authorization", value);
6890    };
6891
6892    let req = req_builder.build()?;
6893    let resp = configuration.client.execute(req).await?;
6894
6895    let status = resp.status();
6896    let content_type = resp
6897        .headers()
6898        .get("content-type")
6899        .and_then(|v| v.to_str().ok())
6900        .unwrap_or("application/octet-stream");
6901    let content_type = super::ContentType::from(content_type);
6902
6903    if !status.is_client_error() && !status.is_server_error() {
6904        let content = resp.text().await?;
6905        match content_type {
6906            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6907            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
6908            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`")))),
6909        }
6910    } else {
6911        let content = resp.text().await?;
6912        let entity: Option<DeleteUserLinkWithIdError> = serde_json::from_str(&content).ok();
6913        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6914    }
6915}
6916
6917/// Deletes the user registration for the given user and application along with the given JSON body that contains the event information. OR Deletes the user registration for the given user and application.
6918pub 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>> {
6919    // add a prefix to parameters to efficiently prevent name collisions
6920    let p_path_user_id = user_id;
6921    let p_path_application_id = application_id;
6922    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6923    let p_body_registration_delete_request = registration_delete_request;
6924
6925    let uri_str = format!("{}/api/user/registration/{userId}/{applicationId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id), applicationId=crate::apis::urlencode(p_path_application_id));
6926    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6927
6928    if let Some(ref user_agent) = configuration.user_agent {
6929        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6930    }
6931    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6932        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6933    }
6934    if let Some(ref apikey) = configuration.api_key {
6935        let key = apikey.key.clone();
6936        let value = match apikey.prefix {
6937            Some(ref prefix) => format!("{} {}", prefix, key),
6938            None => key,
6939        };
6940        req_builder = req_builder.header("Authorization", value);
6941    };
6942    req_builder = req_builder.json(&p_body_registration_delete_request);
6943
6944    let req = req_builder.build()?;
6945    let resp = configuration.client.execute(req).await?;
6946
6947    let status = resp.status();
6948
6949    if !status.is_client_error() && !status.is_server_error() {
6950        Ok(())
6951    } else {
6952        let content = resp.text().await?;
6953        let entity: Option<DeleteUserRegistrationWithIdError> = serde_json::from_str(&content).ok();
6954        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6955    }
6956}
6957
6958/// Disable two-factor authentication for a user using a JSON body rather than URL parameters. OR Disable two-factor authentication for a user.
6959pub 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>> {
6960    // add a prefix to parameters to efficiently prevent name collisions
6961    let p_path_user_id = user_id;
6962    let p_query_method_id = method_id;
6963    let p_query_code = code;
6964    let p_body_two_factor_disable_request = two_factor_disable_request;
6965
6966    let uri_str = format!("{}/api/user/two-factor/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
6967    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6968
6969    if let Some(ref param_value) = p_query_method_id {
6970        req_builder = req_builder.query(&[("methodId", &param_value.to_string())]);
6971    }
6972    if let Some(ref param_value) = p_query_code {
6973        req_builder = req_builder.query(&[("code", &param_value.to_string())]);
6974    }
6975    if let Some(ref user_agent) = configuration.user_agent {
6976        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6977    }
6978    if let Some(ref apikey) = configuration.api_key {
6979        let key = apikey.key.clone();
6980        let value = match apikey.prefix {
6981            Some(ref prefix) => format!("{} {}", prefix, key),
6982            None => key,
6983        };
6984        req_builder = req_builder.header("Authorization", value);
6985    };
6986    req_builder = req_builder.json(&p_body_two_factor_disable_request);
6987
6988    let req = req_builder.build()?;
6989    let resp = configuration.client.execute(req).await?;
6990
6991    let status = resp.status();
6992
6993    if !status.is_client_error() && !status.is_server_error() {
6994        Ok(())
6995    } else {
6996        let content = resp.text().await?;
6997        let entity: Option<DeleteUserTwoFactorWithIdError> = serde_json::from_str(&content).ok();
6998        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6999    }
7000}
7001
7002/// 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.
7003pub 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>> {
7004    // add a prefix to parameters to efficiently prevent name collisions
7005    let p_path_user_id = user_id;
7006    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7007    let p_query_hard_delete = hard_delete;
7008    let p_body_user_delete_single_request = user_delete_single_request;
7009
7010    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
7011    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7012
7013    if let Some(ref param_value) = p_query_hard_delete {
7014        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
7015    }
7016    if let Some(ref user_agent) = configuration.user_agent {
7017        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7018    }
7019    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7020        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7021    }
7022    if let Some(ref apikey) = configuration.api_key {
7023        let key = apikey.key.clone();
7024        let value = match apikey.prefix {
7025            Some(ref prefix) => format!("{} {}", prefix, key),
7026            None => key,
7027        };
7028        req_builder = req_builder.header("Authorization", value);
7029    };
7030    req_builder = req_builder.json(&p_body_user_delete_single_request);
7031
7032    let req = req_builder.build()?;
7033    let resp = configuration.client.execute(req).await?;
7034
7035    let status = resp.status();
7036
7037    if !status.is_client_error() && !status.is_server_error() {
7038        Ok(())
7039    } else {
7040        let content = resp.text().await?;
7041        let entity: Option<DeleteUserWithIdError> = serde_json::from_str(&content).ok();
7042        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7043    }
7044}
7045
7046/// Deletes the WebAuthn credential for the given Id.
7047pub async fn delete_web_authn_credential_with_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteWebAuthnCredentialWithIdError>> {
7048    // add a prefix to parameters to efficiently prevent name collisions
7049    let p_path_id = id;
7050
7051    let uri_str = format!("{}/api/webauthn/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
7052    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7053
7054    if let Some(ref user_agent) = configuration.user_agent {
7055        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7056    }
7057    if let Some(ref apikey) = configuration.api_key {
7058        let key = apikey.key.clone();
7059        let value = match apikey.prefix {
7060            Some(ref prefix) => format!("{} {}", prefix, key),
7061            None => key,
7062        };
7063        req_builder = req_builder.header("Authorization", value);
7064    };
7065
7066    let req = req_builder.build()?;
7067    let resp = configuration.client.execute(req).await?;
7068
7069    let status = resp.status();
7070
7071    if !status.is_client_error() && !status.is_server_error() {
7072        Ok(())
7073    } else {
7074        let content = resp.text().await?;
7075        let entity: Option<DeleteWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
7076        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7077    }
7078}
7079
7080/// Deletes the webhook for the given Id.
7081pub async fn delete_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str) -> Result<(), Error<DeleteWebhookWithIdError>> {
7082    // add a prefix to parameters to efficiently prevent name collisions
7083    let p_path_webhook_id = webhook_id;
7084
7085    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
7086    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7087
7088    if let Some(ref user_agent) = configuration.user_agent {
7089        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7090    }
7091    if let Some(ref apikey) = configuration.api_key {
7092        let key = apikey.key.clone();
7093        let value = match apikey.prefix {
7094            Some(ref prefix) => format!("{} {}", prefix, key),
7095            None => key,
7096        };
7097        req_builder = req_builder.header("Authorization", value);
7098    };
7099
7100    let req = req_builder.build()?;
7101    let resp = configuration.client.execute(req).await?;
7102
7103    let status = resp.status();
7104
7105    if !status.is_client_error() && !status.is_server_error() {
7106        Ok(())
7107    } else {
7108        let content = resp.text().await?;
7109        let entity: Option<DeleteWebhookWithIdError> = serde_json::from_str(&content).ok();
7110        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7111    }
7112}
7113
7114/// Enable two-factor authentication for a user.
7115pub async fn enable_two_factor_with_id(configuration: &configuration::Configuration, user_id: &str, two_factor_request: Option<models::TwoFactorRequest>) -> Result<models::TwoFactorResponse, Error<EnableTwoFactorWithIdError>> {
7116    // add a prefix to parameters to efficiently prevent name collisions
7117    let p_path_user_id = user_id;
7118    let p_body_two_factor_request = two_factor_request;
7119
7120    let uri_str = format!("{}/api/user/two-factor/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
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_body_two_factor_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::TwoFactorResponse`"))),
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::TwoFactorResponse`")))),
7153        }
7154    } else {
7155        let content = resp.text().await?;
7156        let entity: Option<EnableTwoFactorWithIdError> = serde_json::from_str(&content).ok();
7157        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7158    }
7159}
7160
7161/// Exchange a refresh token for a new JWT.
7162pub async fn exchange_refresh_token_for_jwt_with_id(configuration: &configuration::Configuration, refresh_request: Option<models::RefreshRequest>) -> Result<models::JwtRefreshResponse, Error<ExchangeRefreshTokenForJwtWithIdError>> {
7163    // add a prefix to parameters to efficiently prevent name collisions
7164    let p_body_refresh_request = refresh_request;
7165
7166    let uri_str = format!("{}/api/jwt/refresh", 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_body_refresh_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::JwtRefreshResponse`"))),
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::JwtRefreshResponse`")))),
7199        }
7200    } else {
7201        let content = resp.text().await?;
7202        let entity: Option<ExchangeRefreshTokenForJwtWithIdError> = serde_json::from_str(&content).ok();
7203        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7204    }
7205}
7206
7207/// Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
7208pub async fn forgot_password_with_id(configuration: &configuration::Configuration, forgot_password_request: Option<models::ForgotPasswordRequest>) -> Result<models::ForgotPasswordResponse, Error<ForgotPasswordWithIdError>> {
7209    // add a prefix to parameters to efficiently prevent name collisions
7210    let p_body_forgot_password_request = forgot_password_request;
7211
7212    let uri_str = format!("{}/api/user/forgot-password", configuration.base_path);
7213    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7214
7215    if let Some(ref user_agent) = configuration.user_agent {
7216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7217    }
7218    if let Some(ref apikey) = configuration.api_key {
7219        let key = apikey.key.clone();
7220        let value = match apikey.prefix {
7221            Some(ref prefix) => format!("{} {}", prefix, key),
7222            None => key,
7223        };
7224        req_builder = req_builder.header("Authorization", value);
7225    };
7226    req_builder = req_builder.json(&p_body_forgot_password_request);
7227
7228    let req = req_builder.build()?;
7229    let resp = configuration.client.execute(req).await?;
7230
7231    let status = resp.status();
7232    let content_type = resp
7233        .headers()
7234        .get("content-type")
7235        .and_then(|v| v.to_str().ok())
7236        .unwrap_or("application/octet-stream");
7237    let content_type = super::ContentType::from(content_type);
7238
7239    if !status.is_client_error() && !status.is_server_error() {
7240        let content = resp.text().await?;
7241        match content_type {
7242            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7243            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ForgotPasswordResponse`"))),
7244            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`")))),
7245        }
7246    } else {
7247        let content = resp.text().await?;
7248        let entity: Option<ForgotPasswordWithIdError> = serde_json::from_str(&content).ok();
7249        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7250    }
7251}
7252
7253/// Generate a new RSA or EC key pair or an HMAC secret.
7254pub async fn generate_key(configuration: &configuration::Configuration, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<GenerateKeyError>> {
7255    // add a prefix to parameters to efficiently prevent name collisions
7256    let p_body_key_request = key_request;
7257
7258    let uri_str = format!("{}/api/key/generate", configuration.base_path);
7259    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7260
7261    if let Some(ref user_agent) = configuration.user_agent {
7262        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7263    }
7264    if let Some(ref apikey) = configuration.api_key {
7265        let key = apikey.key.clone();
7266        let value = match apikey.prefix {
7267            Some(ref prefix) => format!("{} {}", prefix, key),
7268            None => key,
7269        };
7270        req_builder = req_builder.header("Authorization", value);
7271    };
7272    req_builder = req_builder.json(&p_body_key_request);
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::KeyResponse`"))),
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::KeyResponse`")))),
7291        }
7292    } else {
7293        let content = resp.text().await?;
7294        let entity: Option<GenerateKeyError> = serde_json::from_str(&content).ok();
7295        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7296    }
7297}
7298
7299/// Generate a new RSA or EC key pair or an HMAC secret.
7300pub async fn generate_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<GenerateKeyWithIdError>> {
7301    // add a prefix to parameters to efficiently prevent name collisions
7302    let p_path_key_id = key_id;
7303    let p_body_key_request = key_request;
7304
7305    let uri_str = format!("{}/api/key/generate/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
7306    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7307
7308    if let Some(ref user_agent) = configuration.user_agent {
7309        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7310    }
7311    if let Some(ref apikey) = configuration.api_key {
7312        let key = apikey.key.clone();
7313        let value = match apikey.prefix {
7314            Some(ref prefix) => format!("{} {}", prefix, key),
7315            None => key,
7316        };
7317        req_builder = req_builder.header("Authorization", value);
7318    };
7319    req_builder = req_builder.json(&p_body_key_request);
7320
7321    let req = req_builder.build()?;
7322    let resp = configuration.client.execute(req).await?;
7323
7324    let status = resp.status();
7325    let content_type = resp
7326        .headers()
7327        .get("content-type")
7328        .and_then(|v| v.to_str().ok())
7329        .unwrap_or("application/octet-stream");
7330    let content_type = super::ContentType::from(content_type);
7331
7332    if !status.is_client_error() && !status.is_server_error() {
7333        let content = resp.text().await?;
7334        match content_type {
7335            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7336            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7337            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`")))),
7338        }
7339    } else {
7340        let content = resp.text().await?;
7341        let entity: Option<GenerateKeyWithIdError> = serde_json::from_str(&content).ok();
7342        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7343    }
7344}
7345
7346/// Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
7347pub async fn generate_two_factor_recovery_codes_with_id(configuration: &configuration::Configuration, user_id: &str) -> Result<models::TwoFactorRecoveryCodeResponse, Error<GenerateTwoFactorRecoveryCodesWithIdError>> {
7348    // add a prefix to parameters to efficiently prevent name collisions
7349    let p_path_user_id = user_id;
7350
7351    let uri_str = format!("{}/api/user/two-factor/recovery-code/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
7352    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7353
7354    if let Some(ref user_agent) = configuration.user_agent {
7355        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7356    }
7357    if let Some(ref apikey) = configuration.api_key {
7358        let key = apikey.key.clone();
7359        let value = match apikey.prefix {
7360            Some(ref prefix) => format!("{} {}", prefix, key),
7361            None => key,
7362        };
7363        req_builder = req_builder.header("Authorization", value);
7364    };
7365
7366    let req = req_builder.build()?;
7367    let resp = configuration.client.execute(req).await?;
7368
7369    let status = resp.status();
7370    let content_type = resp
7371        .headers()
7372        .get("content-type")
7373        .and_then(|v| v.to_str().ok())
7374        .unwrap_or("application/octet-stream");
7375    let content_type = super::ContentType::from(content_type);
7376
7377    if !status.is_client_error() && !status.is_server_error() {
7378        let content = resp.text().await?;
7379        match content_type {
7380            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7381            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`"))),
7382            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`")))),
7383        }
7384    } else {
7385        let content = resp.text().await?;
7386        let entity: Option<GenerateTwoFactorRecoveryCodesWithIdError> = serde_json::from_str(&content).ok();
7387        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7388    }
7389}
7390
7391/// 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.
7392pub async fn generate_two_factor_secret_using_jwt_with_id(configuration: &configuration::Configuration, ) -> Result<models::SecretResponse, Error<GenerateTwoFactorSecretUsingJwtWithIdError>> {
7393
7394    let uri_str = format!("{}/api/two-factor/secret", configuration.base_path);
7395    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7396
7397    if let Some(ref user_agent) = configuration.user_agent {
7398        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7399    }
7400    if let Some(ref token) = configuration.bearer_access_token {
7401        req_builder = req_builder.bearer_auth(token.to_owned());
7402    };
7403
7404    let req = req_builder.build()?;
7405    let resp = configuration.client.execute(req).await?;
7406
7407    let status = resp.status();
7408    let content_type = resp
7409        .headers()
7410        .get("content-type")
7411        .and_then(|v| v.to_str().ok())
7412        .unwrap_or("application/octet-stream");
7413    let content_type = super::ContentType::from(content_type);
7414
7415    if !status.is_client_error() && !status.is_server_error() {
7416        let content = resp.text().await?;
7417        match content_type {
7418            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7419            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretResponse`"))),
7420            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`")))),
7421        }
7422    } else {
7423        let content = resp.text().await?;
7424        let entity: Option<GenerateTwoFactorSecretUsingJwtWithIdError> = serde_json::from_str(&content).ok();
7425        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7426    }
7427}
7428
7429/// Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.
7430pub 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>> {
7431    // add a prefix to parameters to efficiently prevent name collisions
7432    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7433    let p_body_identity_provider_login_request = identity_provider_login_request;
7434
7435    let uri_str = format!("{}/api/identity-provider/login", configuration.base_path);
7436    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7437
7438    if let Some(ref user_agent) = configuration.user_agent {
7439        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7440    }
7441    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7442        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7443    }
7444    if let Some(ref apikey) = configuration.api_key {
7445        let key = apikey.key.clone();
7446        let value = match apikey.prefix {
7447            Some(ref prefix) => format!("{} {}", prefix, key),
7448            None => key,
7449        };
7450        req_builder = req_builder.header("Authorization", value);
7451    };
7452    req_builder = req_builder.json(&p_body_identity_provider_login_request);
7453
7454    let req = req_builder.build()?;
7455    let resp = configuration.client.execute(req).await?;
7456
7457    let status = resp.status();
7458    let content_type = resp
7459        .headers()
7460        .get("content-type")
7461        .and_then(|v| v.to_str().ok())
7462        .unwrap_or("application/octet-stream");
7463    let content_type = super::ContentType::from(content_type);
7464
7465    if !status.is_client_error() && !status.is_server_error() {
7466        let content = resp.text().await?;
7467        match content_type {
7468            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7469            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7470            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`")))),
7471        }
7472    } else {
7473        let content = resp.text().await?;
7474        let entity: Option<IdentityProviderLoginWithIdError> = serde_json::from_str(&content).ok();
7475        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7476    }
7477}
7478
7479/// Import an existing RSA or EC key pair or an HMAC secret.
7480pub async fn import_key(configuration: &configuration::Configuration, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<ImportKeyError>> {
7481    // add a prefix to parameters to efficiently prevent name collisions
7482    let p_body_key_request = key_request;
7483
7484    let uri_str = format!("{}/api/key/import", configuration.base_path);
7485    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7486
7487    if let Some(ref user_agent) = configuration.user_agent {
7488        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7489    }
7490    if let Some(ref apikey) = configuration.api_key {
7491        let key = apikey.key.clone();
7492        let value = match apikey.prefix {
7493            Some(ref prefix) => format!("{} {}", prefix, key),
7494            None => key,
7495        };
7496        req_builder = req_builder.header("Authorization", value);
7497    };
7498    req_builder = req_builder.json(&p_body_key_request);
7499
7500    let req = req_builder.build()?;
7501    let resp = configuration.client.execute(req).await?;
7502
7503    let status = resp.status();
7504    let content_type = resp
7505        .headers()
7506        .get("content-type")
7507        .and_then(|v| v.to_str().ok())
7508        .unwrap_or("application/octet-stream");
7509    let content_type = super::ContentType::from(content_type);
7510
7511    if !status.is_client_error() && !status.is_server_error() {
7512        let content = resp.text().await?;
7513        match content_type {
7514            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7515            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7516            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`")))),
7517        }
7518    } else {
7519        let content = resp.text().await?;
7520        let entity: Option<ImportKeyError> = serde_json::from_str(&content).ok();
7521        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7522    }
7523}
7524
7525/// Import an existing RSA or EC key pair or an HMAC secret.
7526pub async fn import_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<ImportKeyWithIdError>> {
7527    // add a prefix to parameters to efficiently prevent name collisions
7528    let p_path_key_id = key_id;
7529    let p_body_key_request = key_request;
7530
7531    let uri_str = format!("{}/api/key/import/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
7532    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7533
7534    if let Some(ref user_agent) = configuration.user_agent {
7535        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7536    }
7537    if let Some(ref apikey) = configuration.api_key {
7538        let key = apikey.key.clone();
7539        let value = match apikey.prefix {
7540            Some(ref prefix) => format!("{} {}", prefix, key),
7541            None => key,
7542        };
7543        req_builder = req_builder.header("Authorization", value);
7544    };
7545    req_builder = req_builder.json(&p_body_key_request);
7546
7547    let req = req_builder.build()?;
7548    let resp = configuration.client.execute(req).await?;
7549
7550    let status = resp.status();
7551    let content_type = resp
7552        .headers()
7553        .get("content-type")
7554        .and_then(|v| v.to_str().ok())
7555        .unwrap_or("application/octet-stream");
7556    let content_type = super::ContentType::from(content_type);
7557
7558    if !status.is_client_error() && !status.is_server_error() {
7559        let content = resp.text().await?;
7560        match content_type {
7561            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7562            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7563            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`")))),
7564        }
7565    } else {
7566        let content = resp.text().await?;
7567        let entity: Option<ImportKeyWithIdError> = serde_json::from_str(&content).ok();
7568        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7569    }
7570}
7571
7572/// 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.
7573pub async fn import_refresh_tokens_with_id(configuration: &configuration::Configuration, refresh_token_import_request: Option<models::RefreshTokenImportRequest>) -> Result<(), Error<ImportRefreshTokensWithIdError>> {
7574    // add a prefix to parameters to efficiently prevent name collisions
7575    let p_body_refresh_token_import_request = refresh_token_import_request;
7576
7577    let uri_str = format!("{}/api/user/refresh-token/import", configuration.base_path);
7578    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7579
7580    if let Some(ref user_agent) = configuration.user_agent {
7581        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7582    }
7583    if let Some(ref apikey) = configuration.api_key {
7584        let key = apikey.key.clone();
7585        let value = match apikey.prefix {
7586            Some(ref prefix) => format!("{} {}", prefix, key),
7587            None => key,
7588        };
7589        req_builder = req_builder.header("Authorization", value);
7590    };
7591    req_builder = req_builder.json(&p_body_refresh_token_import_request);
7592
7593    let req = req_builder.build()?;
7594    let resp = configuration.client.execute(req).await?;
7595
7596    let status = resp.status();
7597
7598    if !status.is_client_error() && !status.is_server_error() {
7599        Ok(())
7600    } else {
7601        let content = resp.text().await?;
7602        let entity: Option<ImportRefreshTokensWithIdError> = serde_json::from_str(&content).ok();
7603        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7604    }
7605}
7606
7607/// 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.
7608pub async fn import_users_with_id(configuration: &configuration::Configuration, import_request: Option<models::ImportRequest>) -> Result<(), Error<ImportUsersWithIdError>> {
7609    // add a prefix to parameters to efficiently prevent name collisions
7610    let p_body_import_request = import_request;
7611
7612    let uri_str = format!("{}/api/user/import", configuration.base_path);
7613    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7614
7615    if let Some(ref user_agent) = configuration.user_agent {
7616        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7617    }
7618    if let Some(ref apikey) = configuration.api_key {
7619        let key = apikey.key.clone();
7620        let value = match apikey.prefix {
7621            Some(ref prefix) => format!("{} {}", prefix, key),
7622            None => key,
7623        };
7624        req_builder = req_builder.header("Authorization", value);
7625    };
7626    req_builder = req_builder.json(&p_body_import_request);
7627
7628    let req = req_builder.build()?;
7629    let resp = configuration.client.execute(req).await?;
7630
7631    let status = resp.status();
7632
7633    if !status.is_client_error() && !status.is_server_error() {
7634        Ok(())
7635    } else {
7636        let content = resp.text().await?;
7637        let entity: Option<ImportUsersWithIdError> = serde_json::from_str(&content).ok();
7638        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7639    }
7640}
7641
7642/// Import a WebAuthn credential
7643pub async fn import_web_authn_credential_with_id(configuration: &configuration::Configuration, web_authn_credential_import_request: Option<models::WebAuthnCredentialImportRequest>) -> Result<(), Error<ImportWebAuthnCredentialWithIdError>> {
7644    // add a prefix to parameters to efficiently prevent name collisions
7645    let p_body_web_authn_credential_import_request = web_authn_credential_import_request;
7646
7647    let uri_str = format!("{}/api/webauthn/import", configuration.base_path);
7648    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7649
7650    if let Some(ref user_agent) = configuration.user_agent {
7651        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7652    }
7653    if let Some(ref apikey) = configuration.api_key {
7654        let key = apikey.key.clone();
7655        let value = match apikey.prefix {
7656            Some(ref prefix) => format!("{} {}", prefix, key),
7657            None => key,
7658        };
7659        req_builder = req_builder.header("Authorization", value);
7660    };
7661    req_builder = req_builder.json(&p_body_web_authn_credential_import_request);
7662
7663    let req = req_builder.build()?;
7664    let resp = configuration.client.execute(req).await?;
7665
7666    let status = resp.status();
7667
7668    if !status.is_client_error() && !status.is_server_error() {
7669        Ok(())
7670    } else {
7671        let content = resp.text().await?;
7672        let entity: Option<ImportWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
7673        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7674    }
7675}
7676
7677/// 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.
7678pub async fn issue_jwt_with_id(configuration: &configuration::Configuration, application_id: Option<&str>, refresh_token: Option<&str>) -> Result<models::IssueResponse, Error<IssueJwtWithIdError>> {
7679    // add a prefix to parameters to efficiently prevent name collisions
7680    let p_query_application_id = application_id;
7681    let p_query_refresh_token = refresh_token;
7682
7683    let uri_str = format!("{}/api/jwt/issue", configuration.base_path);
7684    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7685
7686    if let Some(ref param_value) = p_query_application_id {
7687        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
7688    }
7689    if let Some(ref param_value) = p_query_refresh_token {
7690        req_builder = req_builder.query(&[("refreshToken", &param_value.to_string())]);
7691    }
7692    if let Some(ref user_agent) = configuration.user_agent {
7693        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7694    }
7695    if let Some(ref token) = configuration.bearer_access_token {
7696        req_builder = req_builder.bearer_auth(token.to_owned());
7697    };
7698
7699    let req = req_builder.build()?;
7700    let resp = configuration.client.execute(req).await?;
7701
7702    let status = resp.status();
7703    let content_type = resp
7704        .headers()
7705        .get("content-type")
7706        .and_then(|v| v.to_str().ok())
7707        .unwrap_or("application/octet-stream");
7708    let content_type = super::ContentType::from(content_type);
7709
7710    if !status.is_client_error() && !status.is_server_error() {
7711        let content = resp.text().await?;
7712        match content_type {
7713            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7714            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IssueResponse`"))),
7715            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`")))),
7716        }
7717    } else {
7718        let content = resp.text().await?;
7719        let entity: Option<IssueJwtWithIdError> = serde_json::from_str(&content).ok();
7720        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7721    }
7722}
7723
7724/// 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.
7725pub 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>> {
7726    // add a prefix to parameters to efficiently prevent name collisions
7727    let p_path_user_id = user_id;
7728    let p_path_application_id = application_id;
7729    let p_query_caller_ip_address = caller_ip_address;
7730    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7731
7732    let uri_str = format!("{}/api/login/{userId}/{applicationId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id), applicationId=crate::apis::urlencode(p_path_application_id));
7733    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7734
7735    if let Some(ref param_value) = p_query_caller_ip_address {
7736        req_builder = req_builder.query(&[("callerIPAddress", &param_value.to_string())]);
7737    }
7738    if let Some(ref user_agent) = configuration.user_agent {
7739        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7740    }
7741    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7742        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7743    }
7744    if let Some(ref apikey) = configuration.api_key {
7745        let key = apikey.key.clone();
7746        let value = match apikey.prefix {
7747            Some(ref prefix) => format!("{} {}", prefix, key),
7748            None => key,
7749        };
7750        req_builder = req_builder.header("Authorization", value);
7751    };
7752
7753    let req = req_builder.build()?;
7754    let resp = configuration.client.execute(req).await?;
7755
7756    let status = resp.status();
7757    let content_type = resp
7758        .headers()
7759        .get("content-type")
7760        .and_then(|v| v.to_str().ok())
7761        .unwrap_or("application/octet-stream");
7762    let content_type = super::ContentType::from(content_type);
7763
7764    if !status.is_client_error() && !status.is_server_error() {
7765        let content = resp.text().await?;
7766        match content_type {
7767            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7768            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7769            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`")))),
7770        }
7771    } else {
7772        let content = resp.text().await?;
7773        let entity: Option<LoginPingWithIdError> = serde_json::from_str(&content).ok();
7774        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7775    }
7776}
7777
7778/// 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.
7779pub 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>> {
7780    // add a prefix to parameters to efficiently prevent name collisions
7781    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7782    let p_body_login_ping_request = login_ping_request;
7783
7784    let uri_str = format!("{}/api/login", configuration.base_path);
7785    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7786
7787    if let Some(ref user_agent) = configuration.user_agent {
7788        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7789    }
7790    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7791        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7792    }
7793    if let Some(ref apikey) = configuration.api_key {
7794        let key = apikey.key.clone();
7795        let value = match apikey.prefix {
7796            Some(ref prefix) => format!("{} {}", prefix, key),
7797            None => key,
7798        };
7799        req_builder = req_builder.header("Authorization", value);
7800    };
7801    req_builder = req_builder.json(&p_body_login_ping_request);
7802
7803    let req = req_builder.build()?;
7804    let resp = configuration.client.execute(req).await?;
7805
7806    let status = resp.status();
7807    let content_type = resp
7808        .headers()
7809        .get("content-type")
7810        .and_then(|v| v.to_str().ok())
7811        .unwrap_or("application/octet-stream");
7812    let content_type = super::ContentType::from(content_type);
7813
7814    if !status.is_client_error() && !status.is_server_error() {
7815        let content = resp.text().await?;
7816        match content_type {
7817            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7818            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7819            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`")))),
7820        }
7821    } else {
7822        let content = resp.text().await?;
7823        let entity: Option<LoginPingWithRequestWithIdError> = serde_json::from_str(&content).ok();
7824        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7825    }
7826}
7827
7828/// Authenticates a user to FusionAuth.   This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
7829pub 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>> {
7830    // add a prefix to parameters to efficiently prevent name collisions
7831    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7832    let p_body_login_request = login_request;
7833
7834    let uri_str = format!("{}/api/login", configuration.base_path);
7835    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7836
7837    if let Some(ref user_agent) = configuration.user_agent {
7838        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7839    }
7840    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7841        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7842    }
7843    if let Some(ref apikey) = configuration.api_key {
7844        let key = apikey.key.clone();
7845        let value = match apikey.prefix {
7846            Some(ref prefix) => format!("{} {}", prefix, key),
7847            None => key,
7848        };
7849        req_builder = req_builder.header("Authorization", value);
7850    };
7851    req_builder = req_builder.json(&p_body_login_request);
7852
7853    let req = req_builder.build()?;
7854    let resp = configuration.client.execute(req).await?;
7855
7856    let status = resp.status();
7857    let content_type = resp
7858        .headers()
7859        .get("content-type")
7860        .and_then(|v| v.to_str().ok())
7861        .unwrap_or("application/octet-stream");
7862    let content_type = super::ContentType::from(content_type);
7863
7864    if !status.is_client_error() && !status.is_server_error() {
7865        let content = resp.text().await?;
7866        match content_type {
7867            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7868            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7869            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`")))),
7870        }
7871    } else {
7872        let content = resp.text().await?;
7873        let entity: Option<LoginWithIdError> = serde_json::from_str(&content).ok();
7874        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7875    }
7876}
7877
7878/// 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.
7879pub async fn lookup_identity_provider_with_id(configuration: &configuration::Configuration, domain: Option<&str>) -> Result<models::LookupResponse, Error<LookupIdentityProviderWithIdError>> {
7880    // add a prefix to parameters to efficiently prevent name collisions
7881    let p_query_domain = domain;
7882
7883    let uri_str = format!("{}/api/identity-provider/lookup", configuration.base_path);
7884    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7885
7886    if let Some(ref param_value) = p_query_domain {
7887        req_builder = req_builder.query(&[("domain", &param_value.to_string())]);
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
7901    let req = req_builder.build()?;
7902    let resp = configuration.client.execute(req).await?;
7903
7904    let status = resp.status();
7905    let content_type = resp
7906        .headers()
7907        .get("content-type")
7908        .and_then(|v| v.to_str().ok())
7909        .unwrap_or("application/octet-stream");
7910    let content_type = super::ContentType::from(content_type);
7911
7912    if !status.is_client_error() && !status.is_server_error() {
7913        let content = resp.text().await?;
7914        match content_type {
7915            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7916            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LookupResponse`"))),
7917            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`")))),
7918        }
7919    } else {
7920        let content = resp.text().await?;
7921        let entity: Option<LookupIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
7922        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7923    }
7924}
7925
7926/// Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.
7927pub async fn modify_action_with_id(configuration: &configuration::Configuration, action_id: &str, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<ModifyActionWithIdError>> {
7928    // add a prefix to parameters to efficiently prevent name collisions
7929    let p_path_action_id = action_id;
7930    let p_body_action_request = action_request;
7931
7932    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_path_action_id));
7933    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7934
7935    if let Some(ref user_agent) = configuration.user_agent {
7936        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7937    }
7938    if let Some(ref apikey) = configuration.api_key {
7939        let key = apikey.key.clone();
7940        let value = match apikey.prefix {
7941            Some(ref prefix) => format!("{} {}", prefix, key),
7942            None => key,
7943        };
7944        req_builder = req_builder.header("Authorization", value);
7945    };
7946    req_builder = req_builder.json(&p_body_action_request);
7947
7948    let req = req_builder.build()?;
7949    let resp = configuration.client.execute(req).await?;
7950
7951    let status = resp.status();
7952    let content_type = resp
7953        .headers()
7954        .get("content-type")
7955        .and_then(|v| v.to_str().ok())
7956        .unwrap_or("application/octet-stream");
7957    let content_type = super::ContentType::from(content_type);
7958
7959    if !status.is_client_error() && !status.is_server_error() {
7960        let content = resp.text().await?;
7961        match content_type {
7962            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7963            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
7964            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`")))),
7965        }
7966    } else {
7967        let content = resp.text().await?;
7968        let entity: Option<ModifyActionWithIdError> = serde_json::from_str(&content).ok();
7969        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7970    }
7971}
7972
7973/// Complete a login request using a passwordless code
7974pub async fn passwordless_login_with_id(configuration: &configuration::Configuration, passwordless_login_request: Option<models::PasswordlessLoginRequest>) -> Result<models::LoginResponse, Error<PasswordlessLoginWithIdError>> {
7975    // add a prefix to parameters to efficiently prevent name collisions
7976    let p_body_passwordless_login_request = passwordless_login_request;
7977
7978    let uri_str = format!("{}/api/passwordless/login", configuration.base_path);
7979    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7980
7981    if let Some(ref user_agent) = configuration.user_agent {
7982        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7983    }
7984    if let Some(ref apikey) = configuration.api_key {
7985        let key = apikey.key.clone();
7986        let value = match apikey.prefix {
7987            Some(ref prefix) => format!("{} {}", prefix, key),
7988            None => key,
7989        };
7990        req_builder = req_builder.header("Authorization", value);
7991    };
7992    req_builder = req_builder.json(&p_body_passwordless_login_request);
7993
7994    let req = req_builder.build()?;
7995    let resp = configuration.client.execute(req).await?;
7996
7997    let status = resp.status();
7998    let content_type = resp
7999        .headers()
8000        .get("content-type")
8001        .and_then(|v| v.to_str().ok())
8002        .unwrap_or("application/octet-stream");
8003    let content_type = super::ContentType::from(content_type);
8004
8005    if !status.is_client_error() && !status.is_server_error() {
8006        let content = resp.text().await?;
8007        match content_type {
8008            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8009            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
8010            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`")))),
8011        }
8012    } else {
8013        let content = resp.text().await?;
8014        let entity: Option<PasswordlessLoginWithIdError> = serde_json::from_str(&content).ok();
8015        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8016    }
8017}
8018
8019/// Updates an API key with the given Id.
8020pub async fn patch_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<PatchApiKeyWithIdError>> {
8021    // add a prefix to parameters to efficiently prevent name collisions
8022    let p_path_key_id = key_id;
8023    let p_body_api_key_request = api_key_request;
8024
8025    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
8026    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8027
8028    if let Some(ref user_agent) = configuration.user_agent {
8029        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8030    }
8031    if let Some(ref apikey) = configuration.api_key {
8032        let key = apikey.key.clone();
8033        let value = match apikey.prefix {
8034            Some(ref prefix) => format!("{} {}", prefix, key),
8035            None => key,
8036        };
8037        req_builder = req_builder.header("Authorization", value);
8038    };
8039    req_builder = req_builder.json(&p_body_api_key_request);
8040
8041    let req = req_builder.build()?;
8042    let resp = configuration.client.execute(req).await?;
8043
8044    let status = resp.status();
8045    let content_type = resp
8046        .headers()
8047        .get("content-type")
8048        .and_then(|v| v.to_str().ok())
8049        .unwrap_or("application/octet-stream");
8050    let content_type = super::ContentType::from(content_type);
8051
8052    if !status.is_client_error() && !status.is_server_error() {
8053        let content = resp.text().await?;
8054        match content_type {
8055            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8056            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
8057            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`")))),
8058        }
8059    } else {
8060        let content = resp.text().await?;
8061        let entity: Option<PatchApiKeyWithIdError> = serde_json::from_str(&content).ok();
8062        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8063    }
8064}
8065
8066/// Updates, via PATCH, the application role with the given Id for the application.
8067pub 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>> {
8068    // add a prefix to parameters to efficiently prevent name collisions
8069    let p_path_application_id = application_id;
8070    let p_path_role_id = role_id;
8071    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8072    let p_body_application_request = application_request;
8073
8074    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), roleId=crate::apis::urlencode(p_path_role_id));
8075    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8076
8077    if let Some(ref user_agent) = configuration.user_agent {
8078        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8079    }
8080    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8081        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8082    }
8083    if let Some(ref apikey) = configuration.api_key {
8084        let key = apikey.key.clone();
8085        let value = match apikey.prefix {
8086            Some(ref prefix) => format!("{} {}", prefix, key),
8087            None => key,
8088        };
8089        req_builder = req_builder.header("Authorization", value);
8090    };
8091    req_builder = req_builder.json(&p_body_application_request);
8092
8093    let req = req_builder.build()?;
8094    let resp = configuration.client.execute(req).await?;
8095
8096    let status = resp.status();
8097    let content_type = resp
8098        .headers()
8099        .get("content-type")
8100        .and_then(|v| v.to_str().ok())
8101        .unwrap_or("application/octet-stream");
8102    let content_type = super::ContentType::from(content_type);
8103
8104    if !status.is_client_error() && !status.is_server_error() {
8105        let content = resp.text().await?;
8106        match content_type {
8107            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8108            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
8109            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`")))),
8110        }
8111    } else {
8112        let content = resp.text().await?;
8113        let entity: Option<PatchApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
8114        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8115    }
8116}
8117
8118/// Updates, via PATCH, the application with the given Id.
8119pub 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>> {
8120    // add a prefix to parameters to efficiently prevent name collisions
8121    let p_path_application_id = application_id;
8122    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8123    let p_body_application_request = application_request;
8124
8125    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
8126    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8127
8128    if let Some(ref user_agent) = configuration.user_agent {
8129        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8130    }
8131    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8132        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8133    }
8134    if let Some(ref apikey) = configuration.api_key {
8135        let key = apikey.key.clone();
8136        let value = match apikey.prefix {
8137            Some(ref prefix) => format!("{} {}", prefix, key),
8138            None => key,
8139        };
8140        req_builder = req_builder.header("Authorization", value);
8141    };
8142    req_builder = req_builder.json(&p_body_application_request);
8143
8144    let req = req_builder.build()?;
8145    let resp = configuration.client.execute(req).await?;
8146
8147    let status = resp.status();
8148    let content_type = resp
8149        .headers()
8150        .get("content-type")
8151        .and_then(|v| v.to_str().ok())
8152        .unwrap_or("application/octet-stream");
8153    let content_type = super::ContentType::from(content_type);
8154
8155    if !status.is_client_error() && !status.is_server_error() {
8156        let content = resp.text().await?;
8157        match content_type {
8158            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8159            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
8160            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`")))),
8161        }
8162    } else {
8163        let content = resp.text().await?;
8164        let entity: Option<PatchApplicationWithIdError> = serde_json::from_str(&content).ok();
8165        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8166    }
8167}
8168
8169/// Updates, via PATCH, the connector with the given Id.
8170pub async fn patch_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<PatchConnectorWithIdError>> {
8171    // add a prefix to parameters to efficiently prevent name collisions
8172    let p_path_connector_id = connector_id;
8173    let p_body_connector_request = connector_request;
8174
8175    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
8176    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8177
8178    if let Some(ref user_agent) = configuration.user_agent {
8179        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8180    }
8181    if let Some(ref apikey) = configuration.api_key {
8182        let key = apikey.key.clone();
8183        let value = match apikey.prefix {
8184            Some(ref prefix) => format!("{} {}", prefix, key),
8185            None => key,
8186        };
8187        req_builder = req_builder.header("Authorization", value);
8188    };
8189    req_builder = req_builder.json(&p_body_connector_request);
8190
8191    let req = req_builder.build()?;
8192    let resp = configuration.client.execute(req).await?;
8193
8194    let status = resp.status();
8195    let content_type = resp
8196        .headers()
8197        .get("content-type")
8198        .and_then(|v| v.to_str().ok())
8199        .unwrap_or("application/octet-stream");
8200    let content_type = super::ContentType::from(content_type);
8201
8202    if !status.is_client_error() && !status.is_server_error() {
8203        let content = resp.text().await?;
8204        match content_type {
8205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8206            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
8207            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`")))),
8208        }
8209    } else {
8210        let content = resp.text().await?;
8211        let entity: Option<PatchConnectorWithIdError> = serde_json::from_str(&content).ok();
8212        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8213    }
8214}
8215
8216/// Updates, via PATCH, the consent with the given Id.
8217pub 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>> {
8218    // add a prefix to parameters to efficiently prevent name collisions
8219    let p_path_consent_id = consent_id;
8220    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8221    let p_body_consent_request = consent_request;
8222
8223    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
8224    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8225
8226    if let Some(ref user_agent) = configuration.user_agent {
8227        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8228    }
8229    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8230        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8231    }
8232    if let Some(ref apikey) = configuration.api_key {
8233        let key = apikey.key.clone();
8234        let value = match apikey.prefix {
8235            Some(ref prefix) => format!("{} {}", prefix, key),
8236            None => key,
8237        };
8238        req_builder = req_builder.header("Authorization", value);
8239    };
8240    req_builder = req_builder.json(&p_body_consent_request);
8241
8242    let req = req_builder.build()?;
8243    let resp = configuration.client.execute(req).await?;
8244
8245    let status = resp.status();
8246    let content_type = resp
8247        .headers()
8248        .get("content-type")
8249        .and_then(|v| v.to_str().ok())
8250        .unwrap_or("application/octet-stream");
8251    let content_type = super::ContentType::from(content_type);
8252
8253    if !status.is_client_error() && !status.is_server_error() {
8254        let content = resp.text().await?;
8255        match content_type {
8256            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8257            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
8258            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`")))),
8259        }
8260    } else {
8261        let content = resp.text().await?;
8262        let entity: Option<PatchConsentWithIdError> = serde_json::from_str(&content).ok();
8263        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8264    }
8265}
8266
8267/// Updates, via PATCH, the email template with the given Id.
8268pub 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>> {
8269    // add a prefix to parameters to efficiently prevent name collisions
8270    let p_path_email_template_id = email_template_id;
8271    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8272    let p_body_email_template_request = email_template_request;
8273
8274    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
8275    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8276
8277    if let Some(ref user_agent) = configuration.user_agent {
8278        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8279    }
8280    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8281        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8282    }
8283    if let Some(ref apikey) = configuration.api_key {
8284        let key = apikey.key.clone();
8285        let value = match apikey.prefix {
8286            Some(ref prefix) => format!("{} {}", prefix, key),
8287            None => key,
8288        };
8289        req_builder = req_builder.header("Authorization", value);
8290    };
8291    req_builder = req_builder.json(&p_body_email_template_request);
8292
8293    let req = req_builder.build()?;
8294    let resp = configuration.client.execute(req).await?;
8295
8296    let status = resp.status();
8297    let content_type = resp
8298        .headers()
8299        .get("content-type")
8300        .and_then(|v| v.to_str().ok())
8301        .unwrap_or("application/octet-stream");
8302    let content_type = super::ContentType::from(content_type);
8303
8304    if !status.is_client_error() && !status.is_server_error() {
8305        let content = resp.text().await?;
8306        match content_type {
8307            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8308            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
8309            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`")))),
8310        }
8311    } else {
8312        let content = resp.text().await?;
8313        let entity: Option<PatchEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
8314        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8315    }
8316}
8317
8318/// Patches the permission with the given Id for the entity type.
8319pub 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>> {
8320    // add a prefix to parameters to efficiently prevent name collisions
8321    let p_path_entity_type_id = entity_type_id;
8322    let p_path_permission_id = permission_id;
8323    let p_body_entity_type_request = entity_type_request;
8324
8325    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id), permissionId=crate::apis::urlencode(p_path_permission_id));
8326    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8327
8328    if let Some(ref user_agent) = configuration.user_agent {
8329        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8330    }
8331    if let Some(ref apikey) = configuration.api_key {
8332        let key = apikey.key.clone();
8333        let value = match apikey.prefix {
8334            Some(ref prefix) => format!("{} {}", prefix, key),
8335            None => key,
8336        };
8337        req_builder = req_builder.header("Authorization", value);
8338    };
8339    req_builder = req_builder.json(&p_body_entity_type_request);
8340
8341    let req = req_builder.build()?;
8342    let resp = configuration.client.execute(req).await?;
8343
8344    let status = resp.status();
8345    let content_type = resp
8346        .headers()
8347        .get("content-type")
8348        .and_then(|v| v.to_str().ok())
8349        .unwrap_or("application/octet-stream");
8350    let content_type = super::ContentType::from(content_type);
8351
8352    if !status.is_client_error() && !status.is_server_error() {
8353        let content = resp.text().await?;
8354        match content_type {
8355            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8356            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
8357            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`")))),
8358        }
8359    } else {
8360        let content = resp.text().await?;
8361        let entity: Option<PatchEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
8362        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8363    }
8364}
8365
8366/// Updates, via PATCH, the Entity Type with the given Id.
8367pub 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>> {
8368    // add a prefix to parameters to efficiently prevent name collisions
8369    let p_path_entity_type_id = entity_type_id;
8370    let p_body_entity_type_request = entity_type_request;
8371
8372    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
8373    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8374
8375    if let Some(ref user_agent) = configuration.user_agent {
8376        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8377    }
8378    if let Some(ref apikey) = configuration.api_key {
8379        let key = apikey.key.clone();
8380        let value = match apikey.prefix {
8381            Some(ref prefix) => format!("{} {}", prefix, key),
8382            None => key,
8383        };
8384        req_builder = req_builder.header("Authorization", value);
8385    };
8386    req_builder = req_builder.json(&p_body_entity_type_request);
8387
8388    let req = req_builder.build()?;
8389    let resp = configuration.client.execute(req).await?;
8390
8391    let status = resp.status();
8392    let content_type = resp
8393        .headers()
8394        .get("content-type")
8395        .and_then(|v| v.to_str().ok())
8396        .unwrap_or("application/octet-stream");
8397    let content_type = super::ContentType::from(content_type);
8398
8399    if !status.is_client_error() && !status.is_server_error() {
8400        let content = resp.text().await?;
8401        match content_type {
8402            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8403            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
8404            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`")))),
8405        }
8406    } else {
8407        let content = resp.text().await?;
8408        let entity: Option<PatchEntityTypeWithIdError> = serde_json::from_str(&content).ok();
8409        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8410    }
8411}
8412
8413/// Updates, via PATCH, the Entity with the given Id.
8414pub 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>> {
8415    // add a prefix to parameters to efficiently prevent name collisions
8416    let p_path_entity_id = entity_id;
8417    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8418    let p_body_entity_request = entity_request;
8419
8420    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
8421    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8422
8423    if let Some(ref user_agent) = configuration.user_agent {
8424        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8425    }
8426    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8427        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8428    }
8429    if let Some(ref apikey) = configuration.api_key {
8430        let key = apikey.key.clone();
8431        let value = match apikey.prefix {
8432            Some(ref prefix) => format!("{} {}", prefix, key),
8433            None => key,
8434        };
8435        req_builder = req_builder.header("Authorization", value);
8436    };
8437    req_builder = req_builder.json(&p_body_entity_request);
8438
8439    let req = req_builder.build()?;
8440    let resp = configuration.client.execute(req).await?;
8441
8442    let status = resp.status();
8443    let content_type = resp
8444        .headers()
8445        .get("content-type")
8446        .and_then(|v| v.to_str().ok())
8447        .unwrap_or("application/octet-stream");
8448    let content_type = super::ContentType::from(content_type);
8449
8450    if !status.is_client_error() && !status.is_server_error() {
8451        let content = resp.text().await?;
8452        match content_type {
8453            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8454            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
8455            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`")))),
8456        }
8457    } else {
8458        let content = resp.text().await?;
8459        let entity: Option<PatchEntityWithIdError> = serde_json::from_str(&content).ok();
8460        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8461    }
8462}
8463
8464/// Patches the form field with the given Id.
8465pub async fn patch_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<PatchFormFieldWithIdError>> {
8466    // add a prefix to parameters to efficiently prevent name collisions
8467    let p_path_field_id = field_id;
8468    let p_body_form_field_request = form_field_request;
8469
8470    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
8471    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8472
8473    if let Some(ref user_agent) = configuration.user_agent {
8474        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8475    }
8476    if let Some(ref apikey) = configuration.api_key {
8477        let key = apikey.key.clone();
8478        let value = match apikey.prefix {
8479            Some(ref prefix) => format!("{} {}", prefix, key),
8480            None => key,
8481        };
8482        req_builder = req_builder.header("Authorization", value);
8483    };
8484    req_builder = req_builder.json(&p_body_form_field_request);
8485
8486    let req = req_builder.build()?;
8487    let resp = configuration.client.execute(req).await?;
8488
8489    let status = resp.status();
8490    let content_type = resp
8491        .headers()
8492        .get("content-type")
8493        .and_then(|v| v.to_str().ok())
8494        .unwrap_or("application/octet-stream");
8495    let content_type = super::ContentType::from(content_type);
8496
8497    if !status.is_client_error() && !status.is_server_error() {
8498        let content = resp.text().await?;
8499        match content_type {
8500            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8501            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
8502            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`")))),
8503        }
8504    } else {
8505        let content = resp.text().await?;
8506        let entity: Option<PatchFormFieldWithIdError> = serde_json::from_str(&content).ok();
8507        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8508    }
8509}
8510
8511/// Patches the form with the given Id.
8512pub async fn patch_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<PatchFormWithIdError>> {
8513    // add a prefix to parameters to efficiently prevent name collisions
8514    let p_path_form_id = form_id;
8515    let p_body_form_request = form_request;
8516
8517    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
8518    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8519
8520    if let Some(ref user_agent) = configuration.user_agent {
8521        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8522    }
8523    if let Some(ref apikey) = configuration.api_key {
8524        let key = apikey.key.clone();
8525        let value = match apikey.prefix {
8526            Some(ref prefix) => format!("{} {}", prefix, key),
8527            None => key,
8528        };
8529        req_builder = req_builder.header("Authorization", value);
8530    };
8531    req_builder = req_builder.json(&p_body_form_request);
8532
8533    let req = req_builder.build()?;
8534    let resp = configuration.client.execute(req).await?;
8535
8536    let status = resp.status();
8537    let content_type = resp
8538        .headers()
8539        .get("content-type")
8540        .and_then(|v| v.to_str().ok())
8541        .unwrap_or("application/octet-stream");
8542    let content_type = super::ContentType::from(content_type);
8543
8544    if !status.is_client_error() && !status.is_server_error() {
8545        let content = resp.text().await?;
8546        match content_type {
8547            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8548            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
8549            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`")))),
8550        }
8551    } else {
8552        let content = resp.text().await?;
8553        let entity: Option<PatchFormWithIdError> = serde_json::from_str(&content).ok();
8554        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8555    }
8556}
8557
8558/// Updates, via PATCH, the group with the given Id.
8559pub 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>> {
8560    // add a prefix to parameters to efficiently prevent name collisions
8561    let p_path_group_id = group_id;
8562    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8563    let p_body_group_request = group_request;
8564
8565    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
8566    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8567
8568    if let Some(ref user_agent) = configuration.user_agent {
8569        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8570    }
8571    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8572        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8573    }
8574    if let Some(ref apikey) = configuration.api_key {
8575        let key = apikey.key.clone();
8576        let value = match apikey.prefix {
8577            Some(ref prefix) => format!("{} {}", prefix, key),
8578            None => key,
8579        };
8580        req_builder = req_builder.header("Authorization", value);
8581    };
8582    req_builder = req_builder.json(&p_body_group_request);
8583
8584    let req = req_builder.build()?;
8585    let resp = configuration.client.execute(req).await?;
8586
8587    let status = resp.status();
8588    let content_type = resp
8589        .headers()
8590        .get("content-type")
8591        .and_then(|v| v.to_str().ok())
8592        .unwrap_or("application/octet-stream");
8593    let content_type = super::ContentType::from(content_type);
8594
8595    if !status.is_client_error() && !status.is_server_error() {
8596        let content = resp.text().await?;
8597        match content_type {
8598            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8599            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
8600            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`")))),
8601        }
8602    } else {
8603        let content = resp.text().await?;
8604        let entity: Option<PatchGroupWithIdError> = serde_json::from_str(&content).ok();
8605        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8606    }
8607}
8608
8609/// Updates, via PATCH, the identity provider with the given Id.
8610pub 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>> {
8611    // add a prefix to parameters to efficiently prevent name collisions
8612    let p_path_identity_provider_id = identity_provider_id;
8613    let p_body_identity_provider_request = identity_provider_request;
8614
8615    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
8616    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8617
8618    if let Some(ref user_agent) = configuration.user_agent {
8619        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8620    }
8621    if let Some(ref apikey) = configuration.api_key {
8622        let key = apikey.key.clone();
8623        let value = match apikey.prefix {
8624            Some(ref prefix) => format!("{} {}", prefix, key),
8625            None => key,
8626        };
8627        req_builder = req_builder.header("Authorization", value);
8628    };
8629    req_builder = req_builder.json(&p_body_identity_provider_request);
8630
8631    let req = req_builder.build()?;
8632    let resp = configuration.client.execute(req).await?;
8633
8634    let status = resp.status();
8635    let content_type = resp
8636        .headers()
8637        .get("content-type")
8638        .and_then(|v| v.to_str().ok())
8639        .unwrap_or("application/octet-stream");
8640    let content_type = super::ContentType::from(content_type);
8641
8642    if !status.is_client_error() && !status.is_server_error() {
8643        let content = resp.text().await?;
8644        match content_type {
8645            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8646            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
8647            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`")))),
8648        }
8649    } else {
8650        let content = resp.text().await?;
8651        let entity: Option<PatchIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
8652        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8653    }
8654}
8655
8656/// Updates, via PATCH, the available integrations.
8657pub async fn patch_integrations_with_id(configuration: &configuration::Configuration, integration_request: Option<models::IntegrationRequest>) -> Result<models::IntegrationResponse, Error<PatchIntegrationsWithIdError>> {
8658    // add a prefix to parameters to efficiently prevent name collisions
8659    let p_body_integration_request = integration_request;
8660
8661    let uri_str = format!("{}/api/integration", configuration.base_path);
8662    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8663
8664    if let Some(ref user_agent) = configuration.user_agent {
8665        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8666    }
8667    if let Some(ref apikey) = configuration.api_key {
8668        let key = apikey.key.clone();
8669        let value = match apikey.prefix {
8670            Some(ref prefix) => format!("{} {}", prefix, key),
8671            None => key,
8672        };
8673        req_builder = req_builder.header("Authorization", value);
8674    };
8675    req_builder = req_builder.json(&p_body_integration_request);
8676
8677    let req = req_builder.build()?;
8678    let resp = configuration.client.execute(req).await?;
8679
8680    let status = resp.status();
8681    let content_type = resp
8682        .headers()
8683        .get("content-type")
8684        .and_then(|v| v.to_str().ok())
8685        .unwrap_or("application/octet-stream");
8686    let content_type = super::ContentType::from(content_type);
8687
8688    if !status.is_client_error() && !status.is_server_error() {
8689        let content = resp.text().await?;
8690        match content_type {
8691            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8692            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationResponse`"))),
8693            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`")))),
8694        }
8695    } else {
8696        let content = resp.text().await?;
8697        let entity: Option<PatchIntegrationsWithIdError> = serde_json::from_str(&content).ok();
8698        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8699    }
8700}
8701
8702/// Update the IP Access Control List with the given Id.
8703pub 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>> {
8704    // add a prefix to parameters to efficiently prevent name collisions
8705    let p_path_access_control_list_id = access_control_list_id;
8706    let p_body_ip_access_control_list_request = ip_access_control_list_request;
8707
8708    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_path_access_control_list_id));
8709    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8710
8711    if let Some(ref user_agent) = configuration.user_agent {
8712        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8713    }
8714    if let Some(ref apikey) = configuration.api_key {
8715        let key = apikey.key.clone();
8716        let value = match apikey.prefix {
8717            Some(ref prefix) => format!("{} {}", prefix, key),
8718            None => key,
8719        };
8720        req_builder = req_builder.header("Authorization", value);
8721    };
8722    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
8723
8724    let req = req_builder.build()?;
8725    let resp = configuration.client.execute(req).await?;
8726
8727    let status = resp.status();
8728    let content_type = resp
8729        .headers()
8730        .get("content-type")
8731        .and_then(|v| v.to_str().ok())
8732        .unwrap_or("application/octet-stream");
8733    let content_type = super::ContentType::from(content_type);
8734
8735    if !status.is_client_error() && !status.is_server_error() {
8736        let content = resp.text().await?;
8737        match content_type {
8738            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8739            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
8740            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`")))),
8741        }
8742    } else {
8743        let content = resp.text().await?;
8744        let entity: Option<PatchIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
8745        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8746    }
8747}
8748
8749/// Updates, via PATCH, the lambda with the given Id.
8750pub async fn patch_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<PatchLambdaWithIdError>> {
8751    // add a prefix to parameters to efficiently prevent name collisions
8752    let p_path_lambda_id = lambda_id;
8753    let p_body_lambda_request = lambda_request;
8754
8755    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
8756    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8757
8758    if let Some(ref user_agent) = configuration.user_agent {
8759        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8760    }
8761    if let Some(ref apikey) = configuration.api_key {
8762        let key = apikey.key.clone();
8763        let value = match apikey.prefix {
8764            Some(ref prefix) => format!("{} {}", prefix, key),
8765            None => key,
8766        };
8767        req_builder = req_builder.header("Authorization", value);
8768    };
8769    req_builder = req_builder.json(&p_body_lambda_request);
8770
8771    let req = req_builder.build()?;
8772    let resp = configuration.client.execute(req).await?;
8773
8774    let status = resp.status();
8775    let content_type = resp
8776        .headers()
8777        .get("content-type")
8778        .and_then(|v| v.to_str().ok())
8779        .unwrap_or("application/octet-stream");
8780    let content_type = super::ContentType::from(content_type);
8781
8782    if !status.is_client_error() && !status.is_server_error() {
8783        let content = resp.text().await?;
8784        match content_type {
8785            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8786            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
8787            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`")))),
8788        }
8789    } else {
8790        let content = resp.text().await?;
8791        let entity: Option<PatchLambdaWithIdError> = serde_json::from_str(&content).ok();
8792        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8793    }
8794}
8795
8796/// Updates, via PATCH, the message template with the given Id.
8797pub 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>> {
8798    // add a prefix to parameters to efficiently prevent name collisions
8799    let p_path_message_template_id = message_template_id;
8800    let p_body_message_template_request = message_template_request;
8801
8802    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
8803    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8804
8805    if let Some(ref user_agent) = configuration.user_agent {
8806        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8807    }
8808    if let Some(ref apikey) = configuration.api_key {
8809        let key = apikey.key.clone();
8810        let value = match apikey.prefix {
8811            Some(ref prefix) => format!("{} {}", prefix, key),
8812            None => key,
8813        };
8814        req_builder = req_builder.header("Authorization", value);
8815    };
8816    req_builder = req_builder.json(&p_body_message_template_request);
8817
8818    let req = req_builder.build()?;
8819    let resp = configuration.client.execute(req).await?;
8820
8821    let status = resp.status();
8822    let content_type = resp
8823        .headers()
8824        .get("content-type")
8825        .and_then(|v| v.to_str().ok())
8826        .unwrap_or("application/octet-stream");
8827    let content_type = super::ContentType::from(content_type);
8828
8829    if !status.is_client_error() && !status.is_server_error() {
8830        let content = resp.text().await?;
8831        match content_type {
8832            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8833            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
8834            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`")))),
8835        }
8836    } else {
8837        let content = resp.text().await?;
8838        let entity: Option<PatchMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
8839        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8840    }
8841}
8842
8843/// Updates, via PATCH, the messenger with the given Id.
8844pub async fn patch_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<PatchMessengerWithIdError>> {
8845    // add a prefix to parameters to efficiently prevent name collisions
8846    let p_path_messenger_id = messenger_id;
8847    let p_body_messenger_request = messenger_request;
8848
8849    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
8850    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8851
8852    if let Some(ref user_agent) = configuration.user_agent {
8853        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8854    }
8855    if let Some(ref apikey) = configuration.api_key {
8856        let key = apikey.key.clone();
8857        let value = match apikey.prefix {
8858            Some(ref prefix) => format!("{} {}", prefix, key),
8859            None => key,
8860        };
8861        req_builder = req_builder.header("Authorization", value);
8862    };
8863    req_builder = req_builder.json(&p_body_messenger_request);
8864
8865    let req = req_builder.build()?;
8866    let resp = configuration.client.execute(req).await?;
8867
8868    let status = resp.status();
8869    let content_type = resp
8870        .headers()
8871        .get("content-type")
8872        .and_then(|v| v.to_str().ok())
8873        .unwrap_or("application/octet-stream");
8874    let content_type = super::ContentType::from(content_type);
8875
8876    if !status.is_client_error() && !status.is_server_error() {
8877        let content = resp.text().await?;
8878        match content_type {
8879            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8880            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
8881            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`")))),
8882        }
8883    } else {
8884        let content = resp.text().await?;
8885        let entity: Option<PatchMessengerWithIdError> = serde_json::from_str(&content).ok();
8886        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8887    }
8888}
8889
8890/// Updates, via PATCH, the custom OAuth scope with the given Id for the application.
8891pub 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>> {
8892    // add a prefix to parameters to efficiently prevent name collisions
8893    let p_path_application_id = application_id;
8894    let p_path_scope_id = scope_id;
8895    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8896    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
8897
8898    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), scopeId=crate::apis::urlencode(p_path_scope_id));
8899    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8900
8901    if let Some(ref user_agent) = configuration.user_agent {
8902        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8903    }
8904    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8905        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8906    }
8907    if let Some(ref apikey) = configuration.api_key {
8908        let key = apikey.key.clone();
8909        let value = match apikey.prefix {
8910            Some(ref prefix) => format!("{} {}", prefix, key),
8911            None => key,
8912        };
8913        req_builder = req_builder.header("Authorization", value);
8914    };
8915    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
8916
8917    let req = req_builder.build()?;
8918    let resp = configuration.client.execute(req).await?;
8919
8920    let status = resp.status();
8921    let content_type = resp
8922        .headers()
8923        .get("content-type")
8924        .and_then(|v| v.to_str().ok())
8925        .unwrap_or("application/octet-stream");
8926    let content_type = super::ContentType::from(content_type);
8927
8928    if !status.is_client_error() && !status.is_server_error() {
8929        let content = resp.text().await?;
8930        match content_type {
8931            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8932            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
8933            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`")))),
8934        }
8935    } else {
8936        let content = resp.text().await?;
8937        let entity: Option<PatchOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
8938        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8939    }
8940}
8941
8942/// Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
8943pub 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>> {
8944    // add a prefix to parameters to efficiently prevent name collisions
8945    let p_path_user_id = user_id;
8946    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8947    let p_body_registration_request = registration_request;
8948
8949    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
8950    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8951
8952    if let Some(ref user_agent) = configuration.user_agent {
8953        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8954    }
8955    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8956        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8957    }
8958    if let Some(ref apikey) = configuration.api_key {
8959        let key = apikey.key.clone();
8960        let value = match apikey.prefix {
8961            Some(ref prefix) => format!("{} {}", prefix, key),
8962            None => key,
8963        };
8964        req_builder = req_builder.header("Authorization", value);
8965    };
8966    req_builder = req_builder.json(&p_body_registration_request);
8967
8968    let req = req_builder.build()?;
8969    let resp = configuration.client.execute(req).await?;
8970
8971    let status = resp.status();
8972    let content_type = resp
8973        .headers()
8974        .get("content-type")
8975        .and_then(|v| v.to_str().ok())
8976        .unwrap_or("application/octet-stream");
8977    let content_type = super::ContentType::from(content_type);
8978
8979    if !status.is_client_error() && !status.is_server_error() {
8980        let content = resp.text().await?;
8981        match content_type {
8982            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8983            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
8984            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`")))),
8985        }
8986    } else {
8987        let content = resp.text().await?;
8988        let entity: Option<PatchRegistrationWithIdError> = serde_json::from_str(&content).ok();
8989        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8990    }
8991}
8992
8993/// Updates, via PATCH, the system configuration.
8994pub async fn patch_system_configuration_with_id(configuration: &configuration::Configuration, system_configuration_request: Option<models::SystemConfigurationRequest>) -> Result<models::SystemConfigurationResponse, Error<PatchSystemConfigurationWithIdError>> {
8995    // add a prefix to parameters to efficiently prevent name collisions
8996    let p_body_system_configuration_request = system_configuration_request;
8997
8998    let uri_str = format!("{}/api/system-configuration", configuration.base_path);
8999    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9000
9001    if let Some(ref user_agent) = configuration.user_agent {
9002        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9003    }
9004    if let Some(ref apikey) = configuration.api_key {
9005        let key = apikey.key.clone();
9006        let value = match apikey.prefix {
9007            Some(ref prefix) => format!("{} {}", prefix, key),
9008            None => key,
9009        };
9010        req_builder = req_builder.header("Authorization", value);
9011    };
9012    req_builder = req_builder.json(&p_body_system_configuration_request);
9013
9014    let req = req_builder.build()?;
9015    let resp = configuration.client.execute(req).await?;
9016
9017    let status = resp.status();
9018    let content_type = resp
9019        .headers()
9020        .get("content-type")
9021        .and_then(|v| v.to_str().ok())
9022        .unwrap_or("application/octet-stream");
9023    let content_type = super::ContentType::from(content_type);
9024
9025    if !status.is_client_error() && !status.is_server_error() {
9026        let content = resp.text().await?;
9027        match content_type {
9028            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9029            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SystemConfigurationResponse`"))),
9030            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`")))),
9031        }
9032    } else {
9033        let content = resp.text().await?;
9034        let entity: Option<PatchSystemConfigurationWithIdError> = serde_json::from_str(&content).ok();
9035        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9036    }
9037}
9038
9039/// Updates, via PATCH, the tenant with the given Id.
9040pub 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>> {
9041    // add a prefix to parameters to efficiently prevent name collisions
9042    let p_path_tenant_id = tenant_id;
9043    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9044    let p_body_tenant_request = tenant_request;
9045
9046    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
9047    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9048
9049    if let Some(ref user_agent) = configuration.user_agent {
9050        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9051    }
9052    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9053        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9054    }
9055    if let Some(ref apikey) = configuration.api_key {
9056        let key = apikey.key.clone();
9057        let value = match apikey.prefix {
9058            Some(ref prefix) => format!("{} {}", prefix, key),
9059            None => key,
9060        };
9061        req_builder = req_builder.header("Authorization", value);
9062    };
9063    req_builder = req_builder.json(&p_body_tenant_request);
9064
9065    let req = req_builder.build()?;
9066    let resp = configuration.client.execute(req).await?;
9067
9068    let status = resp.status();
9069    let content_type = resp
9070        .headers()
9071        .get("content-type")
9072        .and_then(|v| v.to_str().ok())
9073        .unwrap_or("application/octet-stream");
9074    let content_type = super::ContentType::from(content_type);
9075
9076    if !status.is_client_error() && !status.is_server_error() {
9077        let content = resp.text().await?;
9078        match content_type {
9079            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9080            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
9081            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`")))),
9082        }
9083    } else {
9084        let content = resp.text().await?;
9085        let entity: Option<PatchTenantWithIdError> = serde_json::from_str(&content).ok();
9086        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9087    }
9088}
9089
9090/// Updates, via PATCH, the theme with the given Id.
9091pub async fn patch_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<PatchThemeWithIdError>> {
9092    // add a prefix to parameters to efficiently prevent name collisions
9093    let p_path_theme_id = theme_id;
9094    let p_body_theme_request = theme_request;
9095
9096    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
9097    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9098
9099    if let Some(ref user_agent) = configuration.user_agent {
9100        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9101    }
9102    if let Some(ref apikey) = configuration.api_key {
9103        let key = apikey.key.clone();
9104        let value = match apikey.prefix {
9105            Some(ref prefix) => format!("{} {}", prefix, key),
9106            None => key,
9107        };
9108        req_builder = req_builder.header("Authorization", value);
9109    };
9110    req_builder = req_builder.json(&p_body_theme_request);
9111
9112    let req = req_builder.build()?;
9113    let resp = configuration.client.execute(req).await?;
9114
9115    let status = resp.status();
9116    let content_type = resp
9117        .headers()
9118        .get("content-type")
9119        .and_then(|v| v.to_str().ok())
9120        .unwrap_or("application/octet-stream");
9121    let content_type = super::ContentType::from(content_type);
9122
9123    if !status.is_client_error() && !status.is_server_error() {
9124        let content = resp.text().await?;
9125        match content_type {
9126            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9127            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
9128            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`")))),
9129        }
9130    } else {
9131        let content = resp.text().await?;
9132        let entity: Option<PatchThemeWithIdError> = serde_json::from_str(&content).ok();
9133        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9134    }
9135}
9136
9137/// Updates, via PATCH, the user action reason with the given Id.
9138pub 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>> {
9139    // add a prefix to parameters to efficiently prevent name collisions
9140    let p_path_user_action_reason_id = user_action_reason_id;
9141    let p_body_user_action_reason_request = user_action_reason_request;
9142
9143    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
9144    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9145
9146    if let Some(ref user_agent) = configuration.user_agent {
9147        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9148    }
9149    if let Some(ref apikey) = configuration.api_key {
9150        let key = apikey.key.clone();
9151        let value = match apikey.prefix {
9152            Some(ref prefix) => format!("{} {}", prefix, key),
9153            None => key,
9154        };
9155        req_builder = req_builder.header("Authorization", value);
9156    };
9157    req_builder = req_builder.json(&p_body_user_action_reason_request);
9158
9159    let req = req_builder.build()?;
9160    let resp = configuration.client.execute(req).await?;
9161
9162    let status = resp.status();
9163    let content_type = resp
9164        .headers()
9165        .get("content-type")
9166        .and_then(|v| v.to_str().ok())
9167        .unwrap_or("application/octet-stream");
9168    let content_type = super::ContentType::from(content_type);
9169
9170    if !status.is_client_error() && !status.is_server_error() {
9171        let content = resp.text().await?;
9172        match content_type {
9173            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9174            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
9175            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`")))),
9176        }
9177    } else {
9178        let content = resp.text().await?;
9179        let entity: Option<PatchUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
9180        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9181    }
9182}
9183
9184/// Updates, via PATCH, the user action with the given Id.
9185pub 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>> {
9186    // add a prefix to parameters to efficiently prevent name collisions
9187    let p_path_user_action_id = user_action_id;
9188    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9189    let p_body_user_action_request = user_action_request;
9190
9191    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
9192    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9193
9194    if let Some(ref user_agent) = configuration.user_agent {
9195        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9196    }
9197    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9198        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9199    }
9200    if let Some(ref apikey) = configuration.api_key {
9201        let key = apikey.key.clone();
9202        let value = match apikey.prefix {
9203            Some(ref prefix) => format!("{} {}", prefix, key),
9204            None => key,
9205        };
9206        req_builder = req_builder.header("Authorization", value);
9207    };
9208    req_builder = req_builder.json(&p_body_user_action_request);
9209
9210    let req = req_builder.build()?;
9211    let resp = configuration.client.execute(req).await?;
9212
9213    let status = resp.status();
9214    let content_type = resp
9215        .headers()
9216        .get("content-type")
9217        .and_then(|v| v.to_str().ok())
9218        .unwrap_or("application/octet-stream");
9219    let content_type = super::ContentType::from(content_type);
9220
9221    if !status.is_client_error() && !status.is_server_error() {
9222        let content = resp.text().await?;
9223        match content_type {
9224            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9225            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
9226            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`")))),
9227        }
9228    } else {
9229        let content = resp.text().await?;
9230        let entity: Option<PatchUserActionWithIdError> = serde_json::from_str(&content).ok();
9231        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9232    }
9233}
9234
9235/// Updates, via PATCH, a single User consent by Id.
9236pub 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>> {
9237    // add a prefix to parameters to efficiently prevent name collisions
9238    let p_path_user_consent_id = user_consent_id;
9239    let p_body_user_consent_request = user_consent_request;
9240
9241    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
9242    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9243
9244    if let Some(ref user_agent) = configuration.user_agent {
9245        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9246    }
9247    if let Some(ref apikey) = configuration.api_key {
9248        let key = apikey.key.clone();
9249        let value = match apikey.prefix {
9250            Some(ref prefix) => format!("{} {}", prefix, key),
9251            None => key,
9252        };
9253        req_builder = req_builder.header("Authorization", value);
9254    };
9255    req_builder = req_builder.json(&p_body_user_consent_request);
9256
9257    let req = req_builder.build()?;
9258    let resp = configuration.client.execute(req).await?;
9259
9260    let status = resp.status();
9261    let content_type = resp
9262        .headers()
9263        .get("content-type")
9264        .and_then(|v| v.to_str().ok())
9265        .unwrap_or("application/octet-stream");
9266    let content_type = super::ContentType::from(content_type);
9267
9268    if !status.is_client_error() && !status.is_server_error() {
9269        let content = resp.text().await?;
9270        match content_type {
9271            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9272            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
9273            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`")))),
9274        }
9275    } else {
9276        let content = resp.text().await?;
9277        let entity: Option<PatchUserConsentWithIdError> = serde_json::from_str(&content).ok();
9278        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9279    }
9280}
9281
9282/// Updates, via PATCH, the user with the given Id.
9283pub 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>> {
9284    // add a prefix to parameters to efficiently prevent name collisions
9285    let p_path_user_id = user_id;
9286    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9287    let p_body_user_request = user_request;
9288
9289    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
9290    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9291
9292    if let Some(ref user_agent) = configuration.user_agent {
9293        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9294    }
9295    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9296        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9297    }
9298    if let Some(ref apikey) = configuration.api_key {
9299        let key = apikey.key.clone();
9300        let value = match apikey.prefix {
9301            Some(ref prefix) => format!("{} {}", prefix, key),
9302            None => key,
9303        };
9304        req_builder = req_builder.header("Authorization", value);
9305    };
9306    req_builder = req_builder.json(&p_body_user_request);
9307
9308    let req = req_builder.build()?;
9309    let resp = configuration.client.execute(req).await?;
9310
9311    let status = resp.status();
9312    let content_type = resp
9313        .headers()
9314        .get("content-type")
9315        .and_then(|v| v.to_str().ok())
9316        .unwrap_or("application/octet-stream");
9317    let content_type = super::ContentType::from(content_type);
9318
9319    if !status.is_client_error() && !status.is_server_error() {
9320        let content = resp.text().await?;
9321        match content_type {
9322            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9323            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
9324            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`")))),
9325        }
9326    } else {
9327        let content = resp.text().await?;
9328        let entity: Option<PatchUserWithIdError> = serde_json::from_str(&content).ok();
9329        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9330    }
9331}
9332
9333/// Patches the webhook with the given Id.
9334pub async fn patch_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<PatchWebhookWithIdError>> {
9335    // add a prefix to parameters to efficiently prevent name collisions
9336    let p_path_webhook_id = webhook_id;
9337    let p_body_webhook_request = webhook_request;
9338
9339    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
9340    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9341
9342    if let Some(ref user_agent) = configuration.user_agent {
9343        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9344    }
9345    if let Some(ref apikey) = configuration.api_key {
9346        let key = apikey.key.clone();
9347        let value = match apikey.prefix {
9348            Some(ref prefix) => format!("{} {}", prefix, key),
9349            None => key,
9350        };
9351        req_builder = req_builder.header("Authorization", value);
9352    };
9353    req_builder = req_builder.json(&p_body_webhook_request);
9354
9355    let req = req_builder.build()?;
9356    let resp = configuration.client.execute(req).await?;
9357
9358    let status = resp.status();
9359    let content_type = resp
9360        .headers()
9361        .get("content-type")
9362        .and_then(|v| v.to_str().ok())
9363        .unwrap_or("application/octet-stream");
9364    let content_type = super::ContentType::from(content_type);
9365
9366    if !status.is_client_error() && !status.is_server_error() {
9367        let content = resp.text().await?;
9368        match content_type {
9369            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9370            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
9371            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`")))),
9372        }
9373    } else {
9374        let content = resp.text().await?;
9375        let entity: Option<PatchWebhookWithIdError> = serde_json::from_str(&content).ok();
9376        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9377    }
9378}
9379
9380/// Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
9381pub async fn reconcile_jwt_with_id(configuration: &configuration::Configuration, identity_provider_login_request: Option<models::IdentityProviderLoginRequest>) -> Result<models::LoginResponse, Error<ReconcileJwtWithIdError>> {
9382    // add a prefix to parameters to efficiently prevent name collisions
9383    let p_body_identity_provider_login_request = identity_provider_login_request;
9384
9385    let uri_str = format!("{}/api/jwt/reconcile", configuration.base_path);
9386    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9387
9388    if let Some(ref user_agent) = configuration.user_agent {
9389        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9390    }
9391    if let Some(ref apikey) = configuration.api_key {
9392        let key = apikey.key.clone();
9393        let value = match apikey.prefix {
9394            Some(ref prefix) => format!("{} {}", prefix, key),
9395            None => key,
9396        };
9397        req_builder = req_builder.header("Authorization", value);
9398    };
9399    req_builder = req_builder.json(&p_body_identity_provider_login_request);
9400
9401    let req = req_builder.build()?;
9402    let resp = configuration.client.execute(req).await?;
9403
9404    let status = resp.status();
9405    let content_type = resp
9406        .headers()
9407        .get("content-type")
9408        .and_then(|v| v.to_str().ok())
9409        .unwrap_or("application/octet-stream");
9410    let content_type = super::ContentType::from(content_type);
9411
9412    if !status.is_client_error() && !status.is_server_error() {
9413        let content = resp.text().await?;
9414        match content_type {
9415            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9416            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
9417            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`")))),
9418        }
9419    } else {
9420        let content = resp.text().await?;
9421        let entity: Option<ReconcileJwtWithIdError> = serde_json::from_str(&content).ok();
9422        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9423    }
9424}
9425
9426/// 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.
9427pub async fn register(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, registration_request: Option<models::RegistrationRequest>) -> Result<models::RegistrationResponse, Error<RegisterError>> {
9428    // add a prefix to parameters to efficiently prevent name collisions
9429    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9430    let p_body_registration_request = registration_request;
9431
9432    let uri_str = format!("{}/api/user/registration", configuration.base_path);
9433    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9434
9435    if let Some(ref user_agent) = configuration.user_agent {
9436        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9437    }
9438    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9439        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9440    }
9441    if let Some(ref apikey) = configuration.api_key {
9442        let key = apikey.key.clone();
9443        let value = match apikey.prefix {
9444            Some(ref prefix) => format!("{} {}", prefix, key),
9445            None => key,
9446        };
9447        req_builder = req_builder.header("Authorization", value);
9448    };
9449    req_builder = req_builder.json(&p_body_registration_request);
9450
9451    let req = req_builder.build()?;
9452    let resp = configuration.client.execute(req).await?;
9453
9454    let status = resp.status();
9455    let content_type = resp
9456        .headers()
9457        .get("content-type")
9458        .and_then(|v| v.to_str().ok())
9459        .unwrap_or("application/octet-stream");
9460    let content_type = super::ContentType::from(content_type);
9461
9462    if !status.is_client_error() && !status.is_server_error() {
9463        let content = resp.text().await?;
9464        match content_type {
9465            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9466            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9467            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`")))),
9468        }
9469    } else {
9470        let content = resp.text().await?;
9471        let entity: Option<RegisterError> = serde_json::from_str(&content).ok();
9472        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9473    }
9474}
9475
9476/// 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.
9477pub 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>> {
9478    // add a prefix to parameters to efficiently prevent name collisions
9479    let p_path_user_id = user_id;
9480    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9481    let p_body_registration_request = registration_request;
9482
9483    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
9484    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9485
9486    if let Some(ref user_agent) = configuration.user_agent {
9487        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9488    }
9489    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9490        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9491    }
9492    if let Some(ref apikey) = configuration.api_key {
9493        let key = apikey.key.clone();
9494        let value = match apikey.prefix {
9495            Some(ref prefix) => format!("{} {}", prefix, key),
9496            None => key,
9497        };
9498        req_builder = req_builder.header("Authorization", value);
9499    };
9500    req_builder = req_builder.json(&p_body_registration_request);
9501
9502    let req = req_builder.build()?;
9503    let resp = configuration.client.execute(req).await?;
9504
9505    let status = resp.status();
9506    let content_type = resp
9507        .headers()
9508        .get("content-type")
9509        .and_then(|v| v.to_str().ok())
9510        .unwrap_or("application/octet-stream");
9511    let content_type = super::ContentType::from(content_type);
9512
9513    if !status.is_client_error() && !status.is_server_error() {
9514        let content = resp.text().await?;
9515        match content_type {
9516            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9517            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9518            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`")))),
9519        }
9520    } else {
9521        let content = resp.text().await?;
9522        let entity: Option<RegisterWithIdError> = serde_json::from_str(&content).ok();
9523        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9524    }
9525}
9526
9527/// 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.
9528pub async fn reindex_with_id(configuration: &configuration::Configuration, reindex_request: Option<models::ReindexRequest>) -> Result<(), Error<ReindexWithIdError>> {
9529    // add a prefix to parameters to efficiently prevent name collisions
9530    let p_body_reindex_request = reindex_request;
9531
9532    let uri_str = format!("{}/api/system/reindex", configuration.base_path);
9533    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9534
9535    if let Some(ref user_agent) = configuration.user_agent {
9536        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9537    }
9538    if let Some(ref apikey) = configuration.api_key {
9539        let key = apikey.key.clone();
9540        let value = match apikey.prefix {
9541            Some(ref prefix) => format!("{} {}", prefix, key),
9542            None => key,
9543        };
9544        req_builder = req_builder.header("Authorization", value);
9545    };
9546    req_builder = req_builder.json(&p_body_reindex_request);
9547
9548    let req = req_builder.build()?;
9549    let resp = configuration.client.execute(req).await?;
9550
9551    let status = resp.status();
9552
9553    if !status.is_client_error() && !status.is_server_error() {
9554        Ok(())
9555    } else {
9556        let content = resp.text().await?;
9557        let entity: Option<ReindexWithIdError> = serde_json::from_str(&content).ok();
9558        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9559    }
9560}
9561
9562/// Removes a user from the family with the given Id.
9563pub 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>> {
9564    // add a prefix to parameters to efficiently prevent name collisions
9565    let p_path_family_id = family_id;
9566    let p_path_user_id = user_id;
9567    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9568
9569    let uri_str = format!("{}/api/user/family/{familyId}/{userId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_id), userId=crate::apis::urlencode(p_path_user_id));
9570    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9571
9572    if let Some(ref user_agent) = configuration.user_agent {
9573        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9574    }
9575    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9576        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9577    }
9578    if let Some(ref apikey) = configuration.api_key {
9579        let key = apikey.key.clone();
9580        let value = match apikey.prefix {
9581            Some(ref prefix) => format!("{} {}", prefix, key),
9582            None => key,
9583        };
9584        req_builder = req_builder.header("Authorization", value);
9585    };
9586
9587    let req = req_builder.build()?;
9588    let resp = configuration.client.execute(req).await?;
9589
9590    let status = resp.status();
9591
9592    if !status.is_client_error() && !status.is_server_error() {
9593        Ok(())
9594    } else {
9595        let content = resp.text().await?;
9596        let entity: Option<RemoveUserFromFamilyWithIdError> = serde_json::from_str(&content).ok();
9597        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9598    }
9599}
9600
9601/// Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
9602pub async fn retrieve_action_with_id(configuration: &configuration::Configuration, action_id: &str) -> Result<models::ActionResponse, Error<RetrieveActionWithIdError>> {
9603    // add a prefix to parameters to efficiently prevent name collisions
9604    let p_path_action_id = action_id;
9605
9606    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_path_action_id));
9607    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9608
9609    if let Some(ref user_agent) = configuration.user_agent {
9610        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9611    }
9612    if let Some(ref apikey) = configuration.api_key {
9613        let key = apikey.key.clone();
9614        let value = match apikey.prefix {
9615            Some(ref prefix) => format!("{} {}", prefix, key),
9616            None => key,
9617        };
9618        req_builder = req_builder.header("Authorization", value);
9619    };
9620
9621    let req = req_builder.build()?;
9622    let resp = configuration.client.execute(req).await?;
9623
9624    let status = resp.status();
9625    let content_type = resp
9626        .headers()
9627        .get("content-type")
9628        .and_then(|v| v.to_str().ok())
9629        .unwrap_or("application/octet-stream");
9630    let content_type = super::ContentType::from(content_type);
9631
9632    if !status.is_client_error() && !status.is_server_error() {
9633        let content = resp.text().await?;
9634        match content_type {
9635            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9636            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
9637            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`")))),
9638        }
9639    } else {
9640        let content = resp.text().await?;
9641        let entity: Option<RetrieveActionWithIdError> = serde_json::from_str(&content).ok();
9642        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9643    }
9644}
9645
9646/// Retrieves an authentication API key for the given Id.
9647pub async fn retrieve_api_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<models::ApiKeyResponse, Error<RetrieveApiKeyWithIdError>> {
9648    // add a prefix to parameters to efficiently prevent name collisions
9649    let p_path_key_id = key_id;
9650
9651    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
9652    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9653
9654    if let Some(ref user_agent) = configuration.user_agent {
9655        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9656    }
9657    if let Some(ref apikey) = configuration.api_key {
9658        let key = apikey.key.clone();
9659        let value = match apikey.prefix {
9660            Some(ref prefix) => format!("{} {}", prefix, key),
9661            None => key,
9662        };
9663        req_builder = req_builder.header("Authorization", value);
9664    };
9665
9666    let req = req_builder.build()?;
9667    let resp = configuration.client.execute(req).await?;
9668
9669    let status = resp.status();
9670    let content_type = resp
9671        .headers()
9672        .get("content-type")
9673        .and_then(|v| v.to_str().ok())
9674        .unwrap_or("application/octet-stream");
9675    let content_type = super::ContentType::from(content_type);
9676
9677    if !status.is_client_error() && !status.is_server_error() {
9678        let content = resp.text().await?;
9679        match content_type {
9680            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9681            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
9682            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`")))),
9683        }
9684    } else {
9685        let content = resp.text().await?;
9686        let entity: Option<RetrieveApiKeyWithIdError> = serde_json::from_str(&content).ok();
9687        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9688    }
9689}
9690
9691/// Retrieves all the applications that are currently inactive. OR Retrieves the application for the given Id or all the applications if the Id is null.
9692pub async fn retrieve_application(configuration: &configuration::Configuration, inactive: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ApplicationResponse, Error<RetrieveApplicationError>> {
9693    // add a prefix to parameters to efficiently prevent name collisions
9694    let p_query_inactive = inactive;
9695    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9696
9697    let uri_str = format!("{}/api/application", configuration.base_path);
9698    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9699
9700    if let Some(ref param_value) = p_query_inactive {
9701        req_builder = req_builder.query(&[("inactive", &param_value.to_string())]);
9702    }
9703    if let Some(ref user_agent) = configuration.user_agent {
9704        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9705    }
9706    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9707        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
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::ApplicationResponse`"))),
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::ApplicationResponse`")))),
9735        }
9736    } else {
9737        let content = resp.text().await?;
9738        let entity: Option<RetrieveApplicationError> = serde_json::from_str(&content).ok();
9739        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9740    }
9741}
9742
9743/// Retrieves the application for the given Id or all the applications if the Id is null.
9744pub async fn retrieve_application_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ApplicationResponse, Error<RetrieveApplicationWithIdError>> {
9745    // add a prefix to parameters to efficiently prevent name collisions
9746    let p_path_application_id = application_id;
9747    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9748
9749    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_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_header_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::ApplicationResponse`"))),
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::ApplicationResponse`")))),
9784        }
9785    } else {
9786        let content = resp.text().await?;
9787        let entity: Option<RetrieveApplicationWithIdError> = serde_json::from_str(&content).ok();
9788        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9789    }
9790}
9791
9792/// Retrieves a single audit log for the given Id.
9793pub async fn retrieve_audit_log_with_id(configuration: &configuration::Configuration, audit_log_id: &str) -> Result<models::AuditLogResponse, Error<RetrieveAuditLogWithIdError>> {
9794    // add a prefix to parameters to efficiently prevent name collisions
9795    let p_path_audit_log_id = audit_log_id;
9796
9797    let uri_str = format!("{}/api/system/audit-log/{auditLogId}", configuration.base_path, auditLogId=crate::apis::urlencode(p_path_audit_log_id));
9798    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9799
9800    if let Some(ref user_agent) = configuration.user_agent {
9801        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9802    }
9803    if let Some(ref apikey) = configuration.api_key {
9804        let key = apikey.key.clone();
9805        let value = match apikey.prefix {
9806            Some(ref prefix) => format!("{} {}", prefix, key),
9807            None => key,
9808        };
9809        req_builder = req_builder.header("Authorization", value);
9810    };
9811
9812    let req = req_builder.build()?;
9813    let resp = configuration.client.execute(req).await?;
9814
9815    let status = resp.status();
9816    let content_type = resp
9817        .headers()
9818        .get("content-type")
9819        .and_then(|v| v.to_str().ok())
9820        .unwrap_or("application/octet-stream");
9821    let content_type = super::ContentType::from(content_type);
9822
9823    if !status.is_client_error() && !status.is_server_error() {
9824        let content = resp.text().await?;
9825        match content_type {
9826            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9827            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogResponse`"))),
9828            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`")))),
9829        }
9830    } else {
9831        let content = resp.text().await?;
9832        let entity: Option<RetrieveAuditLogWithIdError> = serde_json::from_str(&content).ok();
9833        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9834    }
9835}
9836
9837/// Retrieves the connector with the given Id.
9838pub async fn retrieve_connector_with_id(configuration: &configuration::Configuration, connector_id: &str) -> Result<models::ConnectorResponse, Error<RetrieveConnectorWithIdError>> {
9839    // add a prefix to parameters to efficiently prevent name collisions
9840    let p_path_connector_id = connector_id;
9841
9842    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
9843    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9844
9845    if let Some(ref user_agent) = configuration.user_agent {
9846        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9847    }
9848    if let Some(ref apikey) = configuration.api_key {
9849        let key = apikey.key.clone();
9850        let value = match apikey.prefix {
9851            Some(ref prefix) => format!("{} {}", prefix, key),
9852            None => key,
9853        };
9854        req_builder = req_builder.header("Authorization", value);
9855    };
9856
9857    let req = req_builder.build()?;
9858    let resp = configuration.client.execute(req).await?;
9859
9860    let status = resp.status();
9861    let content_type = resp
9862        .headers()
9863        .get("content-type")
9864        .and_then(|v| v.to_str().ok())
9865        .unwrap_or("application/octet-stream");
9866    let content_type = super::ContentType::from(content_type);
9867
9868    if !status.is_client_error() && !status.is_server_error() {
9869        let content = resp.text().await?;
9870        match content_type {
9871            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9872            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
9873            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`")))),
9874        }
9875    } else {
9876        let content = resp.text().await?;
9877        let entity: Option<RetrieveConnectorWithIdError> = serde_json::from_str(&content).ok();
9878        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9879    }
9880}
9881
9882/// Retrieves the Consent for the given Id.
9883pub async fn retrieve_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ConsentResponse, Error<RetrieveConsentWithIdError>> {
9884    // add a prefix to parameters to efficiently prevent name collisions
9885    let p_path_consent_id = consent_id;
9886    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9887
9888    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
9889    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9890
9891    if let Some(ref user_agent) = configuration.user_agent {
9892        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9893    }
9894    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9895        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9896    }
9897    if let Some(ref apikey) = configuration.api_key {
9898        let key = apikey.key.clone();
9899        let value = match apikey.prefix {
9900            Some(ref prefix) => format!("{} {}", prefix, key),
9901            None => key,
9902        };
9903        req_builder = req_builder.header("Authorization", value);
9904    };
9905
9906    let req = req_builder.build()?;
9907    let resp = configuration.client.execute(req).await?;
9908
9909    let status = resp.status();
9910    let content_type = resp
9911        .headers()
9912        .get("content-type")
9913        .and_then(|v| v.to_str().ok())
9914        .unwrap_or("application/octet-stream");
9915    let content_type = super::ContentType::from(content_type);
9916
9917    if !status.is_client_error() && !status.is_server_error() {
9918        let content = resp.text().await?;
9919        match content_type {
9920            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9921            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
9922            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`")))),
9923        }
9924    } else {
9925        let content = resp.text().await?;
9926        let entity: Option<RetrieveConsentWithIdError> = serde_json::from_str(&content).ok();
9927        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9928    }
9929}
9930
9931/// 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.
9932pub 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>> {
9933    // add a prefix to parameters to efficiently prevent name collisions
9934    let p_query_application_id = application_id;
9935    let p_query_start = start;
9936    let p_query_end = end;
9937
9938    let uri_str = format!("{}/api/report/daily-active-user", configuration.base_path);
9939    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9940
9941    if let Some(ref param_value) = p_query_application_id {
9942        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
9943    }
9944    if let Some(ref param_value) = p_query_start {
9945        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
9946    }
9947    if let Some(ref param_value) = p_query_end {
9948        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
9949    }
9950    if let Some(ref user_agent) = configuration.user_agent {
9951        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9952    }
9953    if let Some(ref apikey) = configuration.api_key {
9954        let key = apikey.key.clone();
9955        let value = match apikey.prefix {
9956            Some(ref prefix) => format!("{} {}", prefix, key),
9957            None => key,
9958        };
9959        req_builder = req_builder.header("Authorization", value);
9960    };
9961
9962    let req = req_builder.build()?;
9963    let resp = configuration.client.execute(req).await?;
9964
9965    let status = resp.status();
9966    let content_type = resp
9967        .headers()
9968        .get("content-type")
9969        .and_then(|v| v.to_str().ok())
9970        .unwrap_or("application/octet-stream");
9971    let content_type = super::ContentType::from(content_type);
9972
9973    if !status.is_client_error() && !status.is_server_error() {
9974        let content = resp.text().await?;
9975        match content_type {
9976            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9977            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DailyActiveUserReportResponse`"))),
9978            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`")))),
9979        }
9980    } else {
9981        let content = resp.text().await?;
9982        let entity: Option<RetrieveDailyActiveReportWithIdError> = serde_json::from_str(&content).ok();
9983        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9984    }
9985}
9986
9987/// 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.
9988pub async fn retrieve_device_user_code(configuration: &configuration::Configuration, ) -> Result<(), Error<RetrieveDeviceUserCodeError>> {
9989
9990    let uri_str = format!("{}/oauth2/device/user-code", configuration.base_path);
9991    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9992
9993    if let Some(ref user_agent) = configuration.user_agent {
9994        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9995    }
9996    if let Some(ref apikey) = configuration.api_key {
9997        let key = apikey.key.clone();
9998        let value = match apikey.prefix {
9999            Some(ref prefix) => format!("{} {}", prefix, key),
10000            None => key,
10001        };
10002        req_builder = req_builder.header("Authorization", value);
10003    };
10004
10005    let req = req_builder.build()?;
10006    let resp = configuration.client.execute(req).await?;
10007
10008    let status = resp.status();
10009
10010    if !status.is_client_error() && !status.is_server_error() {
10011        Ok(())
10012    } else {
10013        let content = resp.text().await?;
10014        let entity: Option<RetrieveDeviceUserCodeError> = serde_json::from_str(&content).ok();
10015        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10016    }
10017}
10018
10019/// Retrieves the email template for the given Id. If you don't specify the Id, this will return all the email templates.
10020pub async fn retrieve_email_template(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EmailTemplateResponse, Error<RetrieveEmailTemplateError>> {
10021    // add a prefix to parameters to efficiently prevent name collisions
10022    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10023
10024    let uri_str = format!("{}/api/email/template", configuration.base_path);
10025    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10026
10027    if let Some(ref user_agent) = configuration.user_agent {
10028        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10029    }
10030    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10031        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10032    }
10033    if let Some(ref apikey) = configuration.api_key {
10034        let key = apikey.key.clone();
10035        let value = match apikey.prefix {
10036            Some(ref prefix) => format!("{} {}", prefix, key),
10037            None => key,
10038        };
10039        req_builder = req_builder.header("Authorization", value);
10040    };
10041
10042    let req = req_builder.build()?;
10043    let resp = configuration.client.execute(req).await?;
10044
10045    let status = resp.status();
10046    let content_type = resp
10047        .headers()
10048        .get("content-type")
10049        .and_then(|v| v.to_str().ok())
10050        .unwrap_or("application/octet-stream");
10051    let content_type = super::ContentType::from(content_type);
10052
10053    if !status.is_client_error() && !status.is_server_error() {
10054        let content = resp.text().await?;
10055        match content_type {
10056            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10057            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
10058            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`")))),
10059        }
10060    } else {
10061        let content = resp.text().await?;
10062        let entity: Option<RetrieveEmailTemplateError> = serde_json::from_str(&content).ok();
10063        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10064    }
10065}
10066
10067/// 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.
10068pub async fn retrieve_email_template_preview_with_id(configuration: &configuration::Configuration, preview_request: Option<models::PreviewRequest>) -> Result<models::PreviewResponse, Error<RetrieveEmailTemplatePreviewWithIdError>> {
10069    // add a prefix to parameters to efficiently prevent name collisions
10070    let p_body_preview_request = preview_request;
10071
10072    let uri_str = format!("{}/api/email/template/preview", configuration.base_path);
10073    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10074
10075    if let Some(ref user_agent) = configuration.user_agent {
10076        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10077    }
10078    if let Some(ref apikey) = configuration.api_key {
10079        let key = apikey.key.clone();
10080        let value = match apikey.prefix {
10081            Some(ref prefix) => format!("{} {}", prefix, key),
10082            None => key,
10083        };
10084        req_builder = req_builder.header("Authorization", value);
10085    };
10086    req_builder = req_builder.json(&p_body_preview_request);
10087
10088    let req = req_builder.build()?;
10089    let resp = configuration.client.execute(req).await?;
10090
10091    let status = resp.status();
10092    let content_type = resp
10093        .headers()
10094        .get("content-type")
10095        .and_then(|v| v.to_str().ok())
10096        .unwrap_or("application/octet-stream");
10097    let content_type = super::ContentType::from(content_type);
10098
10099    if !status.is_client_error() && !status.is_server_error() {
10100        let content = resp.text().await?;
10101        match content_type {
10102            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10103            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewResponse`"))),
10104            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`")))),
10105        }
10106    } else {
10107        let content = resp.text().await?;
10108        let entity: Option<RetrieveEmailTemplatePreviewWithIdError> = serde_json::from_str(&content).ok();
10109        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10110    }
10111}
10112
10113/// Retrieves the email template for the given Id. If you don't specify the Id, this will return all the email templates.
10114pub 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>> {
10115    // add a prefix to parameters to efficiently prevent name collisions
10116    let p_path_email_template_id = email_template_id;
10117    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10118
10119    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
10120    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10121
10122    if let Some(ref user_agent) = configuration.user_agent {
10123        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10124    }
10125    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10126        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10127    }
10128    if let Some(ref apikey) = configuration.api_key {
10129        let key = apikey.key.clone();
10130        let value = match apikey.prefix {
10131            Some(ref prefix) => format!("{} {}", prefix, key),
10132            None => key,
10133        };
10134        req_builder = req_builder.header("Authorization", value);
10135    };
10136
10137    let req = req_builder.build()?;
10138    let resp = configuration.client.execute(req).await?;
10139
10140    let status = resp.status();
10141    let content_type = resp
10142        .headers()
10143        .get("content-type")
10144        .and_then(|v| v.to_str().ok())
10145        .unwrap_or("application/octet-stream");
10146    let content_type = super::ContentType::from(content_type);
10147
10148    if !status.is_client_error() && !status.is_server_error() {
10149        let content = resp.text().await?;
10150        match content_type {
10151            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10152            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
10153            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`")))),
10154        }
10155    } else {
10156        let content = resp.text().await?;
10157        let entity: Option<RetrieveEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
10158        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10159    }
10160}
10161
10162/// Retrieves an Entity Grant for the given Entity and User/Entity.
10163pub 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>> {
10164    // add a prefix to parameters to efficiently prevent name collisions
10165    let p_path_entity_id = entity_id;
10166    let p_query_recipient_entity_id = recipient_entity_id;
10167    let p_query_user_id = user_id;
10168    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10169
10170    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
10171    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10172
10173    if let Some(ref param_value) = p_query_recipient_entity_id {
10174        req_builder = req_builder.query(&[("recipientEntityId", &param_value.to_string())]);
10175    }
10176    if let Some(ref param_value) = p_query_user_id {
10177        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10178    }
10179    if let Some(ref user_agent) = configuration.user_agent {
10180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10181    }
10182    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10183        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
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::EntityGrantResponse`"))),
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::EntityGrantResponse`")))),
10211        }
10212    } else {
10213        let content = resp.text().await?;
10214        let entity: Option<RetrieveEntityGrantWithIdError> = serde_json::from_str(&content).ok();
10215        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10216    }
10217}
10218
10219/// Retrieves the Entity Type for the given Id.
10220pub async fn retrieve_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str) -> Result<models::EntityTypeResponse, Error<RetrieveEntityTypeWithIdError>> {
10221    // add a prefix to parameters to efficiently prevent name collisions
10222    let p_path_entity_type_id = entity_type_id;
10223
10224    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
10225    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10226
10227    if let Some(ref user_agent) = configuration.user_agent {
10228        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10229    }
10230    if let Some(ref apikey) = configuration.api_key {
10231        let key = apikey.key.clone();
10232        let value = match apikey.prefix {
10233            Some(ref prefix) => format!("{} {}", prefix, key),
10234            None => key,
10235        };
10236        req_builder = req_builder.header("Authorization", value);
10237    };
10238
10239    let req = req_builder.build()?;
10240    let resp = configuration.client.execute(req).await?;
10241
10242    let status = resp.status();
10243    let content_type = resp
10244        .headers()
10245        .get("content-type")
10246        .and_then(|v| v.to_str().ok())
10247        .unwrap_or("application/octet-stream");
10248    let content_type = super::ContentType::from(content_type);
10249
10250    if !status.is_client_error() && !status.is_server_error() {
10251        let content = resp.text().await?;
10252        match content_type {
10253            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10254            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
10255            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`")))),
10256        }
10257    } else {
10258        let content = resp.text().await?;
10259        let entity: Option<RetrieveEntityTypeWithIdError> = serde_json::from_str(&content).ok();
10260        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10261    }
10262}
10263
10264/// Retrieves the Entity for the given Id.
10265pub async fn retrieve_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EntityResponse, Error<RetrieveEntityWithIdError>> {
10266    // add a prefix to parameters to efficiently prevent name collisions
10267    let p_path_entity_id = entity_id;
10268    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10269
10270    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
10271    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10272
10273    if let Some(ref user_agent) = configuration.user_agent {
10274        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10275    }
10276    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10277        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10278    }
10279    if let Some(ref apikey) = configuration.api_key {
10280        let key = apikey.key.clone();
10281        let value = match apikey.prefix {
10282            Some(ref prefix) => format!("{} {}", prefix, key),
10283            None => key,
10284        };
10285        req_builder = req_builder.header("Authorization", value);
10286    };
10287
10288    let req = req_builder.build()?;
10289    let resp = configuration.client.execute(req).await?;
10290
10291    let status = resp.status();
10292    let content_type = resp
10293        .headers()
10294        .get("content-type")
10295        .and_then(|v| v.to_str().ok())
10296        .unwrap_or("application/octet-stream");
10297    let content_type = super::ContentType::from(content_type);
10298
10299    if !status.is_client_error() && !status.is_server_error() {
10300        let content = resp.text().await?;
10301        match content_type {
10302            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10303            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
10304            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`")))),
10305        }
10306    } else {
10307        let content = resp.text().await?;
10308        let entity: Option<RetrieveEntityWithIdError> = serde_json::from_str(&content).ok();
10309        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10310    }
10311}
10312
10313/// Retrieves a single event log for the given Id.
10314pub async fn retrieve_event_log_with_id(configuration: &configuration::Configuration, event_log_id: &str) -> Result<models::EventLogResponse, Error<RetrieveEventLogWithIdError>> {
10315    // add a prefix to parameters to efficiently prevent name collisions
10316    let p_path_event_log_id = event_log_id;
10317
10318    let uri_str = format!("{}/api/system/event-log/{eventLogId}", configuration.base_path, eventLogId=crate::apis::urlencode(p_path_event_log_id));
10319    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10320
10321    if let Some(ref user_agent) = configuration.user_agent {
10322        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10323    }
10324    if let Some(ref apikey) = configuration.api_key {
10325        let key = apikey.key.clone();
10326        let value = match apikey.prefix {
10327            Some(ref prefix) => format!("{} {}", prefix, key),
10328            None => key,
10329        };
10330        req_builder = req_builder.header("Authorization", value);
10331    };
10332
10333    let req = req_builder.build()?;
10334    let resp = configuration.client.execute(req).await?;
10335
10336    let status = resp.status();
10337    let content_type = resp
10338        .headers()
10339        .get("content-type")
10340        .and_then(|v| v.to_str().ok())
10341        .unwrap_or("application/octet-stream");
10342    let content_type = super::ContentType::from(content_type);
10343
10344    if !status.is_client_error() && !status.is_server_error() {
10345        let content = resp.text().await?;
10346        match content_type {
10347            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10348            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventLogResponse`"))),
10349            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`")))),
10350        }
10351    } else {
10352        let content = resp.text().await?;
10353        let entity: Option<RetrieveEventLogWithIdError> = serde_json::from_str(&content).ok();
10354        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10355    }
10356}
10357
10358/// Retrieves all the families that a user belongs to.
10359pub 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>> {
10360    // add a prefix to parameters to efficiently prevent name collisions
10361    let p_query_user_id = user_id;
10362    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10363
10364    let uri_str = format!("{}/api/user/family", configuration.base_path);
10365    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10366
10367    if let Some(ref param_value) = p_query_user_id {
10368        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10369    }
10370    if let Some(ref user_agent) = configuration.user_agent {
10371        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10372    }
10373    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10374        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
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::FamilyResponse`"))),
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::FamilyResponse`")))),
10402        }
10403    } else {
10404        let content = resp.text().await?;
10405        let entity: Option<RetrieveFamiliesWithIdError> = serde_json::from_str(&content).ok();
10406        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10407    }
10408}
10409
10410/// Retrieves all the members of a family by the unique Family Id.
10411pub 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>> {
10412    // add a prefix to parameters to efficiently prevent name collisions
10413    let p_path_family_id = family_id;
10414    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10415
10416    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_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_header_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::FamilyResponse`"))),
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::FamilyResponse`")))),
10451        }
10452    } else {
10453        let content = resp.text().await?;
10454        let entity: Option<RetrieveFamilyMembersByFamilyIdWithIdError> = serde_json::from_str(&content).ok();
10455        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10456    }
10457}
10458
10459/// Retrieves the form field with the given Id.
10460pub async fn retrieve_form_field_with_id(configuration: &configuration::Configuration, field_id: &str) -> Result<models::FormFieldResponse, Error<RetrieveFormFieldWithIdError>> {
10461    // add a prefix to parameters to efficiently prevent name collisions
10462    let p_path_field_id = field_id;
10463
10464    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
10465    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10466
10467    if let Some(ref user_agent) = configuration.user_agent {
10468        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10469    }
10470    if let Some(ref apikey) = configuration.api_key {
10471        let key = apikey.key.clone();
10472        let value = match apikey.prefix {
10473            Some(ref prefix) => format!("{} {}", prefix, key),
10474            None => key,
10475        };
10476        req_builder = req_builder.header("Authorization", value);
10477    };
10478
10479    let req = req_builder.build()?;
10480    let resp = configuration.client.execute(req).await?;
10481
10482    let status = resp.status();
10483    let content_type = resp
10484        .headers()
10485        .get("content-type")
10486        .and_then(|v| v.to_str().ok())
10487        .unwrap_or("application/octet-stream");
10488    let content_type = super::ContentType::from(content_type);
10489
10490    if !status.is_client_error() && !status.is_server_error() {
10491        let content = resp.text().await?;
10492        match content_type {
10493            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10494            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
10495            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`")))),
10496        }
10497    } else {
10498        let content = resp.text().await?;
10499        let entity: Option<RetrieveFormFieldWithIdError> = serde_json::from_str(&content).ok();
10500        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10501    }
10502}
10503
10504/// Retrieves the form with the given Id.
10505pub async fn retrieve_form_with_id(configuration: &configuration::Configuration, form_id: &str) -> Result<models::FormResponse, Error<RetrieveFormWithIdError>> {
10506    // add a prefix to parameters to efficiently prevent name collisions
10507    let p_path_form_id = form_id;
10508
10509    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
10510    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10511
10512    if let Some(ref user_agent) = configuration.user_agent {
10513        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10514    }
10515    if let Some(ref apikey) = configuration.api_key {
10516        let key = apikey.key.clone();
10517        let value = match apikey.prefix {
10518            Some(ref prefix) => format!("{} {}", prefix, key),
10519            None => key,
10520        };
10521        req_builder = req_builder.header("Authorization", value);
10522    };
10523
10524    let req = req_builder.build()?;
10525    let resp = configuration.client.execute(req).await?;
10526
10527    let status = resp.status();
10528    let content_type = resp
10529        .headers()
10530        .get("content-type")
10531        .and_then(|v| v.to_str().ok())
10532        .unwrap_or("application/octet-stream");
10533    let content_type = super::ContentType::from(content_type);
10534
10535    if !status.is_client_error() && !status.is_server_error() {
10536        let content = resp.text().await?;
10537        match content_type {
10538            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10539            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
10540            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`")))),
10541        }
10542    } else {
10543        let content = resp.text().await?;
10544        let entity: Option<RetrieveFormWithIdError> = serde_json::from_str(&content).ok();
10545        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10546    }
10547}
10548
10549/// Retrieves the group for the given Id.
10550pub async fn retrieve_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::GroupResponse, Error<RetrieveGroupWithIdError>> {
10551    // add a prefix to parameters to efficiently prevent name collisions
10552    let p_path_group_id = group_id;
10553    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10554
10555    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
10556    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10557
10558    if let Some(ref user_agent) = configuration.user_agent {
10559        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10560    }
10561    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10562        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10563    }
10564    if let Some(ref apikey) = configuration.api_key {
10565        let key = apikey.key.clone();
10566        let value = match apikey.prefix {
10567            Some(ref prefix) => format!("{} {}", prefix, key),
10568            None => key,
10569        };
10570        req_builder = req_builder.header("Authorization", value);
10571    };
10572
10573    let req = req_builder.build()?;
10574    let resp = configuration.client.execute(req).await?;
10575
10576    let status = resp.status();
10577    let content_type = resp
10578        .headers()
10579        .get("content-type")
10580        .and_then(|v| v.to_str().ok())
10581        .unwrap_or("application/octet-stream");
10582    let content_type = super::ContentType::from(content_type);
10583
10584    if !status.is_client_error() && !status.is_server_error() {
10585        let content = resp.text().await?;
10586        match content_type {
10587            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10588            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
10589            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`")))),
10590        }
10591    } else {
10592        let content = resp.text().await?;
10593        let entity: Option<RetrieveGroupWithIdError> = serde_json::from_str(&content).ok();
10594        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10595    }
10596}
10597
10598/// 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.
10599pub async fn retrieve_identity_provider_by_type_with_id(configuration: &configuration::Configuration, r#type: Option<&str>) -> Result<models::IdentityProviderResponse, Error<RetrieveIdentityProviderByTypeWithIdError>> {
10600    // add a prefix to parameters to efficiently prevent name collisions
10601    let p_query_type = r#type;
10602
10603    let uri_str = format!("{}/api/identity-provider", configuration.base_path);
10604    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10605
10606    if let Some(ref param_value) = p_query_type {
10607        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
10608    }
10609    if let Some(ref user_agent) = configuration.user_agent {
10610        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10611    }
10612    if let Some(ref apikey) = configuration.api_key {
10613        let key = apikey.key.clone();
10614        let value = match apikey.prefix {
10615            Some(ref prefix) => format!("{} {}", prefix, key),
10616            None => key,
10617        };
10618        req_builder = req_builder.header("Authorization", value);
10619    };
10620
10621    let req = req_builder.build()?;
10622    let resp = configuration.client.execute(req).await?;
10623
10624    let status = resp.status();
10625    let content_type = resp
10626        .headers()
10627        .get("content-type")
10628        .and_then(|v| v.to_str().ok())
10629        .unwrap_or("application/octet-stream");
10630    let content_type = super::ContentType::from(content_type);
10631
10632    if !status.is_client_error() && !status.is_server_error() {
10633        let content = resp.text().await?;
10634        match content_type {
10635            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10636            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
10637            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`")))),
10638        }
10639    } else {
10640        let content = resp.text().await?;
10641        let entity: Option<RetrieveIdentityProviderByTypeWithIdError> = serde_json::from_str(&content).ok();
10642        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10643    }
10644}
10645
10646/// Retrieve all Identity Provider users (links) for the user. Specify the optional identityProviderId to retrieve links for a particular IdP. OR Retrieve a single Identity Provider user (link).
10647pub async fn retrieve_identity_provider_link(configuration: &configuration::Configuration, identity_provider_id: Option<&str>, user_id: Option<&str>, identity_provider_user_id: Option<&str>) -> Result<models::IdentityProviderLinkResponse, Error<RetrieveIdentityProviderLinkError>> {
10648    // add a prefix to parameters to efficiently prevent name collisions
10649    let p_query_identity_provider_id = identity_provider_id;
10650    let p_query_user_id = user_id;
10651    let p_query_identity_provider_user_id = identity_provider_user_id;
10652
10653    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
10654    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10655
10656    if let Some(ref param_value) = p_query_identity_provider_id {
10657        req_builder = req_builder.query(&[("identityProviderId", &param_value.to_string())]);
10658    }
10659    if let Some(ref param_value) = p_query_user_id {
10660        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10661    }
10662    if let Some(ref param_value) = p_query_identity_provider_user_id {
10663        req_builder = req_builder.query(&[("identityProviderUserId", &param_value.to_string())]);
10664    }
10665    if let Some(ref user_agent) = configuration.user_agent {
10666        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10667    }
10668    if let Some(ref apikey) = configuration.api_key {
10669        let key = apikey.key.clone();
10670        let value = match apikey.prefix {
10671            Some(ref prefix) => format!("{} {}", prefix, key),
10672            None => key,
10673        };
10674        req_builder = req_builder.header("Authorization", value);
10675    };
10676
10677    let req = req_builder.build()?;
10678    let resp = configuration.client.execute(req).await?;
10679
10680    let status = resp.status();
10681    let content_type = resp
10682        .headers()
10683        .get("content-type")
10684        .and_then(|v| v.to_str().ok())
10685        .unwrap_or("application/octet-stream");
10686    let content_type = super::ContentType::from(content_type);
10687
10688    if !status.is_client_error() && !status.is_server_error() {
10689        let content = resp.text().await?;
10690        match content_type {
10691            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10692            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
10693            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`")))),
10694        }
10695    } else {
10696        let content = resp.text().await?;
10697        let entity: Option<RetrieveIdentityProviderLinkError> = serde_json::from_str(&content).ok();
10698        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10699    }
10700}
10701
10702/// Retrieves the identity provider for the given Id or all the identity providers if the Id is null.
10703pub async fn retrieve_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str) -> Result<models::IdentityProviderResponse, Error<RetrieveIdentityProviderWithIdError>> {
10704    // add a prefix to parameters to efficiently prevent name collisions
10705    let p_path_identity_provider_id = identity_provider_id;
10706
10707    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
10708    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10709
10710    if let Some(ref user_agent) = configuration.user_agent {
10711        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10712    }
10713    if let Some(ref apikey) = configuration.api_key {
10714        let key = apikey.key.clone();
10715        let value = match apikey.prefix {
10716            Some(ref prefix) => format!("{} {}", prefix, key),
10717            None => key,
10718        };
10719        req_builder = req_builder.header("Authorization", value);
10720    };
10721
10722    let req = req_builder.build()?;
10723    let resp = configuration.client.execute(req).await?;
10724
10725    let status = resp.status();
10726    let content_type = resp
10727        .headers()
10728        .get("content-type")
10729        .and_then(|v| v.to_str().ok())
10730        .unwrap_or("application/octet-stream");
10731    let content_type = super::ContentType::from(content_type);
10732
10733    if !status.is_client_error() && !status.is_server_error() {
10734        let content = resp.text().await?;
10735        match content_type {
10736            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10737            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
10738            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`")))),
10739        }
10740    } else {
10741        let content = resp.text().await?;
10742        let entity: Option<RetrieveIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
10743        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10744    }
10745}
10746
10747/// Retrieves the IP Access Control List with the given Id.
10748pub async fn retrieve_ip_access_control_list_with_id(configuration: &configuration::Configuration, ip_access_control_list_id: &str) -> Result<models::IpAccessControlListResponse, Error<RetrieveIpAccessControlListWithIdError>> {
10749    // add a prefix to parameters to efficiently prevent name collisions
10750    let p_path_ip_access_control_list_id = ip_access_control_list_id;
10751
10752    let uri_str = format!("{}/api/ip-acl/{ipAccessControlListId}", configuration.base_path, ipAccessControlListId=crate::apis::urlencode(p_path_ip_access_control_list_id));
10753    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10754
10755    if let Some(ref user_agent) = configuration.user_agent {
10756        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10757    }
10758    if let Some(ref apikey) = configuration.api_key {
10759        let key = apikey.key.clone();
10760        let value = match apikey.prefix {
10761            Some(ref prefix) => format!("{} {}", prefix, key),
10762            None => key,
10763        };
10764        req_builder = req_builder.header("Authorization", value);
10765    };
10766
10767    let req = req_builder.build()?;
10768    let resp = configuration.client.execute(req).await?;
10769
10770    let status = resp.status();
10771    let content_type = resp
10772        .headers()
10773        .get("content-type")
10774        .and_then(|v| v.to_str().ok())
10775        .unwrap_or("application/octet-stream");
10776    let content_type = super::ContentType::from(content_type);
10777
10778    if !status.is_client_error() && !status.is_server_error() {
10779        let content = resp.text().await?;
10780        match content_type {
10781            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10782            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
10783            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`")))),
10784        }
10785    } else {
10786        let content = resp.text().await?;
10787        let entity: Option<RetrieveIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
10788        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10789    }
10790}
10791
10792/// Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format.
10793pub async fn retrieve_json_web_key_set_with_id(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<RetrieveJsonWebKeySetWithIdError>> {
10794
10795    let uri_str = format!("{}/.well-known/jwks.json", configuration.base_path);
10796    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10797
10798    if let Some(ref user_agent) = configuration.user_agent {
10799        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10800    }
10801    if let Some(ref apikey) = configuration.api_key {
10802        let key = apikey.key.clone();
10803        let value = match apikey.prefix {
10804            Some(ref prefix) => format!("{} {}", prefix, key),
10805            None => key,
10806        };
10807        req_builder = req_builder.header("Authorization", value);
10808    };
10809
10810    let req = req_builder.build()?;
10811    let resp = configuration.client.execute(req).await?;
10812
10813    let status = resp.status();
10814    let content_type = resp
10815        .headers()
10816        .get("content-type")
10817        .and_then(|v| v.to_str().ok())
10818        .unwrap_or("application/octet-stream");
10819    let content_type = super::ContentType::from(content_type);
10820
10821    if !status.is_client_error() && !status.is_server_error() {
10822        let content = resp.text().await?;
10823        match content_type {
10824            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10825            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwksResponse`"))),
10826            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`")))),
10827        }
10828    } else {
10829        let content = resp.text().await?;
10830        let entity: Option<RetrieveJsonWebKeySetWithIdError> = serde_json::from_str(&content).ok();
10831        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10832    }
10833}
10834
10835/// Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id. OR Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).
10836pub async fn retrieve_jwt_public_key(configuration: &configuration::Configuration, application_id: Option<&str>, key_id: Option<&str>) -> Result<models::PublicKeyResponse, Error<RetrieveJwtPublicKeyError>> {
10837    // add a prefix to parameters to efficiently prevent name collisions
10838    let p_query_application_id = application_id;
10839    let p_query_key_id = key_id;
10840
10841    let uri_str = format!("{}/api/jwt/public-key", configuration.base_path);
10842    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10843
10844    if let Some(ref param_value) = p_query_application_id {
10845        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
10846    }
10847    if let Some(ref param_value) = p_query_key_id {
10848        req_builder = req_builder.query(&[("keyId", &param_value.to_string())]);
10849    }
10850    if let Some(ref user_agent) = configuration.user_agent {
10851        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10852    }
10853    if let Some(ref apikey) = configuration.api_key {
10854        let key = apikey.key.clone();
10855        let value = match apikey.prefix {
10856            Some(ref prefix) => format!("{} {}", prefix, key),
10857            None => key,
10858        };
10859        req_builder = req_builder.header("Authorization", value);
10860    };
10861
10862    let req = req_builder.build()?;
10863    let resp = configuration.client.execute(req).await?;
10864
10865    let status = resp.status();
10866    let content_type = resp
10867        .headers()
10868        .get("content-type")
10869        .and_then(|v| v.to_str().ok())
10870        .unwrap_or("application/octet-stream");
10871    let content_type = super::ContentType::from(content_type);
10872
10873    if !status.is_client_error() && !status.is_server_error() {
10874        let content = resp.text().await?;
10875        match content_type {
10876            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10877            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PublicKeyResponse`"))),
10878            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`")))),
10879        }
10880    } else {
10881        let content = resp.text().await?;
10882        let entity: Option<RetrieveJwtPublicKeyError> = serde_json::from_str(&content).ok();
10883        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10884    }
10885}
10886
10887/// Retrieves the key for the given Id.
10888pub async fn retrieve_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<models::KeyResponse, Error<RetrieveKeyWithIdError>> {
10889    // add a prefix to parameters to efficiently prevent name collisions
10890    let p_path_key_id = key_id;
10891
10892    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
10893    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10894
10895    if let Some(ref user_agent) = configuration.user_agent {
10896        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10897    }
10898    if let Some(ref apikey) = configuration.api_key {
10899        let key = apikey.key.clone();
10900        let value = match apikey.prefix {
10901            Some(ref prefix) => format!("{} {}", prefix, key),
10902            None => key,
10903        };
10904        req_builder = req_builder.header("Authorization", value);
10905    };
10906
10907    let req = req_builder.build()?;
10908    let resp = configuration.client.execute(req).await?;
10909
10910    let status = resp.status();
10911    let content_type = resp
10912        .headers()
10913        .get("content-type")
10914        .and_then(|v| v.to_str().ok())
10915        .unwrap_or("application/octet-stream");
10916    let content_type = super::ContentType::from(content_type);
10917
10918    if !status.is_client_error() && !status.is_server_error() {
10919        let content = resp.text().await?;
10920        match content_type {
10921            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10922            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
10923            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`")))),
10924        }
10925    } else {
10926        let content = resp.text().await?;
10927        let entity: Option<RetrieveKeyWithIdError> = serde_json::from_str(&content).ok();
10928        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10929    }
10930}
10931
10932/// Retrieves all the keys.
10933pub async fn retrieve_keys_with_id(configuration: &configuration::Configuration, ) -> Result<models::KeyResponse, Error<RetrieveKeysWithIdError>> {
10934
10935    let uri_str = format!("{}/api/key", configuration.base_path);
10936    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10937
10938    if let Some(ref user_agent) = configuration.user_agent {
10939        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10940    }
10941    if let Some(ref apikey) = configuration.api_key {
10942        let key = apikey.key.clone();
10943        let value = match apikey.prefix {
10944            Some(ref prefix) => format!("{} {}", prefix, key),
10945            None => key,
10946        };
10947        req_builder = req_builder.header("Authorization", value);
10948    };
10949
10950    let req = req_builder.build()?;
10951    let resp = configuration.client.execute(req).await?;
10952
10953    let status = resp.status();
10954    let content_type = resp
10955        .headers()
10956        .get("content-type")
10957        .and_then(|v| v.to_str().ok())
10958        .unwrap_or("application/octet-stream");
10959    let content_type = super::ContentType::from(content_type);
10960
10961    if !status.is_client_error() && !status.is_server_error() {
10962        let content = resp.text().await?;
10963        match content_type {
10964            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10965            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
10966            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`")))),
10967        }
10968    } else {
10969        let content = resp.text().await?;
10970        let entity: Option<RetrieveKeysWithIdError> = serde_json::from_str(&content).ok();
10971        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10972    }
10973}
10974
10975/// Retrieves the lambda for the given Id.
10976pub async fn retrieve_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str) -> Result<models::LambdaResponse, Error<RetrieveLambdaWithIdError>> {
10977    // add a prefix to parameters to efficiently prevent name collisions
10978    let p_path_lambda_id = lambda_id;
10979
10980    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
10981    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10982
10983    if let Some(ref user_agent) = configuration.user_agent {
10984        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10985    }
10986    if let Some(ref apikey) = configuration.api_key {
10987        let key = apikey.key.clone();
10988        let value = match apikey.prefix {
10989            Some(ref prefix) => format!("{} {}", prefix, key),
10990            None => key,
10991        };
10992        req_builder = req_builder.header("Authorization", value);
10993    };
10994
10995    let req = req_builder.build()?;
10996    let resp = configuration.client.execute(req).await?;
10997
10998    let status = resp.status();
10999    let content_type = resp
11000        .headers()
11001        .get("content-type")
11002        .and_then(|v| v.to_str().ok())
11003        .unwrap_or("application/octet-stream");
11004    let content_type = super::ContentType::from(content_type);
11005
11006    if !status.is_client_error() && !status.is_server_error() {
11007        let content = resp.text().await?;
11008        match content_type {
11009            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11010            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
11011            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`")))),
11012        }
11013    } else {
11014        let content = resp.text().await?;
11015        let entity: Option<RetrieveLambdaWithIdError> = serde_json::from_str(&content).ok();
11016        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11017    }
11018}
11019
11020/// Retrieves all the lambdas for the provided type.
11021pub async fn retrieve_lambdas_by_type_with_id(configuration: &configuration::Configuration, r#type: Option<&str>) -> Result<models::LambdaResponse, Error<RetrieveLambdasByTypeWithIdError>> {
11022    // add a prefix to parameters to efficiently prevent name collisions
11023    let p_query_type = r#type;
11024
11025    let uri_str = format!("{}/api/lambda", configuration.base_path);
11026    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11027
11028    if let Some(ref param_value) = p_query_type {
11029        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
11030    }
11031    if let Some(ref user_agent) = configuration.user_agent {
11032        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11033    }
11034    if let Some(ref apikey) = configuration.api_key {
11035        let key = apikey.key.clone();
11036        let value = match apikey.prefix {
11037            Some(ref prefix) => format!("{} {}", prefix, key),
11038            None => key,
11039        };
11040        req_builder = req_builder.header("Authorization", value);
11041    };
11042
11043    let req = req_builder.build()?;
11044    let resp = configuration.client.execute(req).await?;
11045
11046    let status = resp.status();
11047    let content_type = resp
11048        .headers()
11049        .get("content-type")
11050        .and_then(|v| v.to_str().ok())
11051        .unwrap_or("application/octet-stream");
11052    let content_type = super::ContentType::from(content_type);
11053
11054    if !status.is_client_error() && !status.is_server_error() {
11055        let content = resp.text().await?;
11056        match content_type {
11057            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11058            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
11059            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`")))),
11060        }
11061    } else {
11062        let content = resp.text().await?;
11063        let entity: Option<RetrieveLambdasByTypeWithIdError> = serde_json::from_str(&content).ok();
11064        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11065    }
11066}
11067
11068/// Retrieves the message template for the given Id. If you don't specify the Id, this will return all the message templates.
11069pub async fn retrieve_message_template(configuration: &configuration::Configuration, ) -> Result<models::MessageTemplateResponse, Error<RetrieveMessageTemplateError>> {
11070
11071    let uri_str = format!("{}/api/message/template", configuration.base_path);
11072    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11073
11074    if let Some(ref user_agent) = configuration.user_agent {
11075        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11076    }
11077    if let Some(ref apikey) = configuration.api_key {
11078        let key = apikey.key.clone();
11079        let value = match apikey.prefix {
11080            Some(ref prefix) => format!("{} {}", prefix, key),
11081            None => key,
11082        };
11083        req_builder = req_builder.header("Authorization", value);
11084    };
11085
11086    let req = req_builder.build()?;
11087    let resp = configuration.client.execute(req).await?;
11088
11089    let status = resp.status();
11090    let content_type = resp
11091        .headers()
11092        .get("content-type")
11093        .and_then(|v| v.to_str().ok())
11094        .unwrap_or("application/octet-stream");
11095    let content_type = super::ContentType::from(content_type);
11096
11097    if !status.is_client_error() && !status.is_server_error() {
11098        let content = resp.text().await?;
11099        match content_type {
11100            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11101            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
11102            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`")))),
11103        }
11104    } else {
11105        let content = resp.text().await?;
11106        let entity: Option<RetrieveMessageTemplateError> = serde_json::from_str(&content).ok();
11107        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11108    }
11109}
11110
11111/// Creates a preview of the message template provided in the request, normalized to a given locale.
11112pub async fn retrieve_message_template_preview_with_id(configuration: &configuration::Configuration, preview_message_template_request: Option<models::PreviewMessageTemplateRequest>) -> Result<models::PreviewMessageTemplateResponse, Error<RetrieveMessageTemplatePreviewWithIdError>> {
11113    // add a prefix to parameters to efficiently prevent name collisions
11114    let p_body_preview_message_template_request = preview_message_template_request;
11115
11116    let uri_str = format!("{}/api/message/template/preview", configuration.base_path);
11117    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11118
11119    if let Some(ref user_agent) = configuration.user_agent {
11120        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11121    }
11122    if let Some(ref apikey) = configuration.api_key {
11123        let key = apikey.key.clone();
11124        let value = match apikey.prefix {
11125            Some(ref prefix) => format!("{} {}", prefix, key),
11126            None => key,
11127        };
11128        req_builder = req_builder.header("Authorization", value);
11129    };
11130    req_builder = req_builder.json(&p_body_preview_message_template_request);
11131
11132    let req = req_builder.build()?;
11133    let resp = configuration.client.execute(req).await?;
11134
11135    let status = resp.status();
11136    let content_type = resp
11137        .headers()
11138        .get("content-type")
11139        .and_then(|v| v.to_str().ok())
11140        .unwrap_or("application/octet-stream");
11141    let content_type = super::ContentType::from(content_type);
11142
11143    if !status.is_client_error() && !status.is_server_error() {
11144        let content = resp.text().await?;
11145        match content_type {
11146            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11147            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewMessageTemplateResponse`"))),
11148            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`")))),
11149        }
11150    } else {
11151        let content = resp.text().await?;
11152        let entity: Option<RetrieveMessageTemplatePreviewWithIdError> = serde_json::from_str(&content).ok();
11153        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11154    }
11155}
11156
11157/// Retrieves the message template for the given Id. If you don't specify the Id, this will return all the message templates.
11158pub async fn retrieve_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str) -> Result<models::MessageTemplateResponse, Error<RetrieveMessageTemplateWithIdError>> {
11159    // add a prefix to parameters to efficiently prevent name collisions
11160    let p_path_message_template_id = message_template_id;
11161
11162    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
11163    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11164
11165    if let Some(ref user_agent) = configuration.user_agent {
11166        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11167    }
11168    if let Some(ref apikey) = configuration.api_key {
11169        let key = apikey.key.clone();
11170        let value = match apikey.prefix {
11171            Some(ref prefix) => format!("{} {}", prefix, key),
11172            None => key,
11173        };
11174        req_builder = req_builder.header("Authorization", value);
11175    };
11176
11177    let req = req_builder.build()?;
11178    let resp = configuration.client.execute(req).await?;
11179
11180    let status = resp.status();
11181    let content_type = resp
11182        .headers()
11183        .get("content-type")
11184        .and_then(|v| v.to_str().ok())
11185        .unwrap_or("application/octet-stream");
11186    let content_type = super::ContentType::from(content_type);
11187
11188    if !status.is_client_error() && !status.is_server_error() {
11189        let content = resp.text().await?;
11190        match content_type {
11191            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11192            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
11193            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`")))),
11194        }
11195    } else {
11196        let content = resp.text().await?;
11197        let entity: Option<RetrieveMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
11198        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11199    }
11200}
11201
11202/// Retrieves the messenger with the given Id.
11203pub async fn retrieve_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str) -> Result<models::MessengerResponse, Error<RetrieveMessengerWithIdError>> {
11204    // add a prefix to parameters to efficiently prevent name collisions
11205    let p_path_messenger_id = messenger_id;
11206
11207    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
11208    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11209
11210    if let Some(ref user_agent) = configuration.user_agent {
11211        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11212    }
11213    if let Some(ref apikey) = configuration.api_key {
11214        let key = apikey.key.clone();
11215        let value = match apikey.prefix {
11216            Some(ref prefix) => format!("{} {}", prefix, key),
11217            None => key,
11218        };
11219        req_builder = req_builder.header("Authorization", value);
11220    };
11221
11222    let req = req_builder.build()?;
11223    let resp = configuration.client.execute(req).await?;
11224
11225    let status = resp.status();
11226    let content_type = resp
11227        .headers()
11228        .get("content-type")
11229        .and_then(|v| v.to_str().ok())
11230        .unwrap_or("application/octet-stream");
11231    let content_type = super::ContentType::from(content_type);
11232
11233    if !status.is_client_error() && !status.is_server_error() {
11234        let content = resp.text().await?;
11235        match content_type {
11236            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11237            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
11238            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`")))),
11239        }
11240    } else {
11241        let content = resp.text().await?;
11242        let entity: Option<RetrieveMessengerWithIdError> = serde_json::from_str(&content).ok();
11243        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11244    }
11245}
11246
11247/// 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.
11248pub 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>> {
11249    // add a prefix to parameters to efficiently prevent name collisions
11250    let p_query_application_id = application_id;
11251    let p_query_start = start;
11252    let p_query_end = end;
11253
11254    let uri_str = format!("{}/api/report/monthly-active-user", configuration.base_path);
11255    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11256
11257    if let Some(ref param_value) = p_query_application_id {
11258        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11259    }
11260    if let Some(ref param_value) = p_query_start {
11261        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11262    }
11263    if let Some(ref param_value) = p_query_end {
11264        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11265    }
11266    if let Some(ref user_agent) = configuration.user_agent {
11267        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11268    }
11269    if let Some(ref apikey) = configuration.api_key {
11270        let key = apikey.key.clone();
11271        let value = match apikey.prefix {
11272            Some(ref prefix) => format!("{} {}", prefix, key),
11273            None => key,
11274        };
11275        req_builder = req_builder.header("Authorization", value);
11276    };
11277
11278    let req = req_builder.build()?;
11279    let resp = configuration.client.execute(req).await?;
11280
11281    let status = resp.status();
11282    let content_type = resp
11283        .headers()
11284        .get("content-type")
11285        .and_then(|v| v.to_str().ok())
11286        .unwrap_or("application/octet-stream");
11287    let content_type = super::ContentType::from(content_type);
11288
11289    if !status.is_client_error() && !status.is_server_error() {
11290        let content = resp.text().await?;
11291        match content_type {
11292            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11293            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MonthlyActiveUserReportResponse`"))),
11294            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`")))),
11295        }
11296    } else {
11297        let content = resp.text().await?;
11298        let entity: Option<RetrieveMonthlyActiveReportWithIdError> = serde_json::from_str(&content).ok();
11299        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11300    }
11301}
11302
11303/// Retrieves a custom OAuth scope.
11304pub 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>> {
11305    // add a prefix to parameters to efficiently prevent name collisions
11306    let p_path_application_id = application_id;
11307    let p_path_scope_id = scope_id;
11308    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11309
11310    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), scopeId=crate::apis::urlencode(p_path_scope_id));
11311    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11312
11313    if let Some(ref user_agent) = configuration.user_agent {
11314        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11315    }
11316    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
11317        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11318    }
11319    if let Some(ref apikey) = configuration.api_key {
11320        let key = apikey.key.clone();
11321        let value = match apikey.prefix {
11322            Some(ref prefix) => format!("{} {}", prefix, key),
11323            None => key,
11324        };
11325        req_builder = req_builder.header("Authorization", value);
11326    };
11327
11328    let req = req_builder.build()?;
11329    let resp = configuration.client.execute(req).await?;
11330
11331    let status = resp.status();
11332    let content_type = resp
11333        .headers()
11334        .get("content-type")
11335        .and_then(|v| v.to_str().ok())
11336        .unwrap_or("application/octet-stream");
11337    let content_type = super::ContentType::from(content_type);
11338
11339    if !status.is_client_error() && !status.is_server_error() {
11340        let content = resp.text().await?;
11341        match content_type {
11342            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11343            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
11344            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`")))),
11345        }
11346    } else {
11347        let content = resp.text().await?;
11348        let entity: Option<RetrieveOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
11349        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11350    }
11351}
11352
11353/// Retrieves the Oauth2 configuration for the application for the given Application Id.
11354pub 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>> {
11355    // add a prefix to parameters to efficiently prevent name collisions
11356    let p_path_application_id = application_id;
11357    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11358
11359    let uri_str = format!("{}/api/application/{applicationId}/oauth-configuration", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
11360    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11361
11362    if let Some(ref user_agent) = configuration.user_agent {
11363        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11364    }
11365    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
11366        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11367    }
11368    if let Some(ref apikey) = configuration.api_key {
11369        let key = apikey.key.clone();
11370        let value = match apikey.prefix {
11371            Some(ref prefix) => format!("{} {}", prefix, key),
11372            None => key,
11373        };
11374        req_builder = req_builder.header("Authorization", value);
11375    };
11376
11377    let req = req_builder.build()?;
11378    let resp = configuration.client.execute(req).await?;
11379
11380    let status = resp.status();
11381    let content_type = resp
11382        .headers()
11383        .get("content-type")
11384        .and_then(|v| v.to_str().ok())
11385        .unwrap_or("application/octet-stream");
11386    let content_type = super::ContentType::from(content_type);
11387
11388    if !status.is_client_error() && !status.is_server_error() {
11389        let content = resp.text().await?;
11390        match content_type {
11391            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11392            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthConfigurationResponse`"))),
11393            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`")))),
11394        }
11395    } else {
11396        let content = resp.text().await?;
11397        let entity: Option<RetrieveOauthConfigurationWithIdError> = serde_json::from_str(&content).ok();
11398        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11399    }
11400}
11401
11402/// Returns the well known OpenID Configuration JSON document
11403pub async fn retrieve_open_id_configuration_with_id(configuration: &configuration::Configuration, ) -> Result<models::OpenIdConfiguration, Error<RetrieveOpenIdConfigurationWithIdError>> {
11404
11405    let uri_str = format!("{}/.well-known/openid-configuration", configuration.base_path);
11406    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11407
11408    if let Some(ref user_agent) = configuration.user_agent {
11409        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11410    }
11411    if let Some(ref apikey) = configuration.api_key {
11412        let key = apikey.key.clone();
11413        let value = match apikey.prefix {
11414            Some(ref prefix) => format!("{} {}", prefix, key),
11415            None => key,
11416        };
11417        req_builder = req_builder.header("Authorization", value);
11418    };
11419
11420    let req = req_builder.build()?;
11421    let resp = configuration.client.execute(req).await?;
11422
11423    let status = resp.status();
11424    let content_type = resp
11425        .headers()
11426        .get("content-type")
11427        .and_then(|v| v.to_str().ok())
11428        .unwrap_or("application/octet-stream");
11429    let content_type = super::ContentType::from(content_type);
11430
11431    if !status.is_client_error() && !status.is_server_error() {
11432        let content = resp.text().await?;
11433        match content_type {
11434            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11435            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OpenIdConfiguration`"))),
11436            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`")))),
11437        }
11438    } else {
11439        let content = resp.text().await?;
11440        let entity: Option<RetrieveOpenIdConfigurationWithIdError> = serde_json::from_str(&content).ok();
11441        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11442    }
11443}
11444
11445/// 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.
11446pub async fn retrieve_password_validation_rules_with_id(configuration: &configuration::Configuration, ) -> Result<models::PasswordValidationRulesResponse, Error<RetrievePasswordValidationRulesWithIdError>> {
11447
11448    let uri_str = format!("{}/api/tenant/password-validation-rules", configuration.base_path);
11449    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11450
11451    if let Some(ref user_agent) = configuration.user_agent {
11452        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11453    }
11454    if let Some(ref apikey) = configuration.api_key {
11455        let key = apikey.key.clone();
11456        let value = match apikey.prefix {
11457            Some(ref prefix) => format!("{} {}", prefix, key),
11458            None => key,
11459        };
11460        req_builder = req_builder.header("Authorization", value);
11461    };
11462
11463    let req = req_builder.build()?;
11464    let resp = configuration.client.execute(req).await?;
11465
11466    let status = resp.status();
11467    let content_type = resp
11468        .headers()
11469        .get("content-type")
11470        .and_then(|v| v.to_str().ok())
11471        .unwrap_or("application/octet-stream");
11472    let content_type = super::ContentType::from(content_type);
11473
11474    if !status.is_client_error() && !status.is_server_error() {
11475        let content = resp.text().await?;
11476        match content_type {
11477            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11478            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordValidationRulesResponse`"))),
11479            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`")))),
11480        }
11481    } else {
11482        let content = resp.text().await?;
11483        let entity: Option<RetrievePasswordValidationRulesWithIdError> = serde_json::from_str(&content).ok();
11484        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11485    }
11486}
11487
11488/// Retrieves the password validation rules for a specific tenant.  This API does not require an API key.
11489pub async fn retrieve_password_validation_rules_with_tenant_id_with_id(configuration: &configuration::Configuration, tenant_id: &str) -> Result<models::PasswordValidationRulesResponse, Error<RetrievePasswordValidationRulesWithTenantIdWithIdError>> {
11490    // add a prefix to parameters to efficiently prevent name collisions
11491    let p_path_tenant_id = tenant_id;
11492
11493    let uri_str = format!("{}/api/tenant/password-validation-rules/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
11494    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11495
11496    if let Some(ref user_agent) = configuration.user_agent {
11497        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11498    }
11499    if let Some(ref apikey) = configuration.api_key {
11500        let key = apikey.key.clone();
11501        let value = match apikey.prefix {
11502            Some(ref prefix) => format!("{} {}", prefix, key),
11503            None => key,
11504        };
11505        req_builder = req_builder.header("Authorization", value);
11506    };
11507
11508    let req = req_builder.build()?;
11509    let resp = configuration.client.execute(req).await?;
11510
11511    let status = resp.status();
11512    let content_type = resp
11513        .headers()
11514        .get("content-type")
11515        .and_then(|v| v.to_str().ok())
11516        .unwrap_or("application/octet-stream");
11517    let content_type = super::ContentType::from(content_type);
11518
11519    if !status.is_client_error() && !status.is_server_error() {
11520        let content = resp.text().await?;
11521        match content_type {
11522            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11523            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordValidationRulesResponse`"))),
11524            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`")))),
11525        }
11526    } else {
11527        let content = resp.text().await?;
11528        let entity: Option<RetrievePasswordValidationRulesWithTenantIdWithIdError> = serde_json::from_str(&content).ok();
11529        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11530    }
11531}
11532
11533/// Retrieves all the children for the given parent email address.
11534pub async fn retrieve_pending_children_with_id(configuration: &configuration::Configuration, parent_email: Option<&str>) -> Result<models::PendingResponse, Error<RetrievePendingChildrenWithIdError>> {
11535    // add a prefix to parameters to efficiently prevent name collisions
11536    let p_query_parent_email = parent_email;
11537
11538    let uri_str = format!("{}/api/user/family/pending", configuration.base_path);
11539    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11540
11541    if let Some(ref param_value) = p_query_parent_email {
11542        req_builder = req_builder.query(&[("parentEmail", &param_value.to_string())]);
11543    }
11544    if let Some(ref user_agent) = configuration.user_agent {
11545        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11546    }
11547    if let Some(ref apikey) = configuration.api_key {
11548        let key = apikey.key.clone();
11549        let value = match apikey.prefix {
11550            Some(ref prefix) => format!("{} {}", prefix, key),
11551            None => key,
11552        };
11553        req_builder = req_builder.header("Authorization", value);
11554    };
11555
11556    let req = req_builder.build()?;
11557    let resp = configuration.client.execute(req).await?;
11558
11559    let status = resp.status();
11560    let content_type = resp
11561        .headers()
11562        .get("content-type")
11563        .and_then(|v| v.to_str().ok())
11564        .unwrap_or("application/octet-stream");
11565    let content_type = super::ContentType::from(content_type);
11566
11567    if !status.is_client_error() && !status.is_server_error() {
11568        let content = resp.text().await?;
11569        match content_type {
11570            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11571            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PendingResponse`"))),
11572            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`")))),
11573        }
11574    } else {
11575        let content = resp.text().await?;
11576        let entity: Option<RetrievePendingChildrenWithIdError> = serde_json::from_str(&content).ok();
11577        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11578    }
11579}
11580
11581/// Retrieve a pending identity provider link. This is useful to validate a pending link and retrieve meta-data about the identity provider link.
11582pub async fn retrieve_pending_link_with_id(configuration: &configuration::Configuration, pending_link_id: &str, user_id: Option<&str>) -> Result<models::IdentityProviderPendingLinkResponse, Error<RetrievePendingLinkWithIdError>> {
11583    // add a prefix to parameters to efficiently prevent name collisions
11584    let p_path_pending_link_id = pending_link_id;
11585    let p_query_user_id = user_id;
11586
11587    let uri_str = format!("{}/api/identity-provider/link/pending/{pendingLinkId}", configuration.base_path, pendingLinkId=crate::apis::urlencode(p_path_pending_link_id));
11588    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11589
11590    if let Some(ref param_value) = p_query_user_id {
11591        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11592    }
11593    if let Some(ref user_agent) = configuration.user_agent {
11594        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11595    }
11596    if let Some(ref apikey) = configuration.api_key {
11597        let key = apikey.key.clone();
11598        let value = match apikey.prefix {
11599            Some(ref prefix) => format!("{} {}", prefix, key),
11600            None => key,
11601        };
11602        req_builder = req_builder.header("Authorization", value);
11603    };
11604
11605    let req = req_builder.build()?;
11606    let resp = configuration.client.execute(req).await?;
11607
11608    let status = resp.status();
11609    let content_type = resp
11610        .headers()
11611        .get("content-type")
11612        .and_then(|v| v.to_str().ok())
11613        .unwrap_or("application/octet-stream");
11614    let content_type = super::ContentType::from(content_type);
11615
11616    if !status.is_client_error() && !status.is_server_error() {
11617        let content = resp.text().await?;
11618        match content_type {
11619            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11620            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderPendingLinkResponse`"))),
11621            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`")))),
11622        }
11623    } else {
11624        let content = resp.text().await?;
11625        let entity: Option<RetrievePendingLinkWithIdError> = serde_json::from_str(&content).ok();
11626        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11627    }
11628}
11629
11630/// Retrieves the FusionAuth Reactor metrics.
11631pub async fn retrieve_reactor_metrics_with_id(configuration: &configuration::Configuration, ) -> Result<models::ReactorMetricsResponse, Error<RetrieveReactorMetricsWithIdError>> {
11632
11633    let uri_str = format!("{}/api/reactor/metrics", configuration.base_path);
11634    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11635
11636    if let Some(ref user_agent) = configuration.user_agent {
11637        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11638    }
11639    if let Some(ref apikey) = configuration.api_key {
11640        let key = apikey.key.clone();
11641        let value = match apikey.prefix {
11642            Some(ref prefix) => format!("{} {}", prefix, key),
11643            None => key,
11644        };
11645        req_builder = req_builder.header("Authorization", value);
11646    };
11647
11648    let req = req_builder.build()?;
11649    let resp = configuration.client.execute(req).await?;
11650
11651    let status = resp.status();
11652    let content_type = resp
11653        .headers()
11654        .get("content-type")
11655        .and_then(|v| v.to_str().ok())
11656        .unwrap_or("application/octet-stream");
11657    let content_type = super::ContentType::from(content_type);
11658
11659    if !status.is_client_error() && !status.is_server_error() {
11660        let content = resp.text().await?;
11661        match content_type {
11662            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11663            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReactorMetricsResponse`"))),
11664            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`")))),
11665        }
11666    } else {
11667        let content = resp.text().await?;
11668        let entity: Option<RetrieveReactorMetricsWithIdError> = serde_json::from_str(&content).ok();
11669        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11670    }
11671}
11672
11673/// 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.
11674pub async fn retrieve_refresh_token_by_id_with_id(configuration: &configuration::Configuration, token_id: &str) -> Result<models::RefreshTokenResponse, Error<RetrieveRefreshTokenByIdWithIdError>> {
11675    // add a prefix to parameters to efficiently prevent name collisions
11676    let p_path_token_id = token_id;
11677
11678    let uri_str = format!("{}/api/jwt/refresh/{tokenId}", configuration.base_path, tokenId=crate::apis::urlencode(p_path_token_id));
11679    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11680
11681    if let Some(ref user_agent) = configuration.user_agent {
11682        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11683    }
11684    if let Some(ref apikey) = configuration.api_key {
11685        let key = apikey.key.clone();
11686        let value = match apikey.prefix {
11687            Some(ref prefix) => format!("{} {}", prefix, key),
11688            None => key,
11689        };
11690        req_builder = req_builder.header("Authorization", value);
11691    };
11692
11693    let req = req_builder.build()?;
11694    let resp = configuration.client.execute(req).await?;
11695
11696    let status = resp.status();
11697    let content_type = resp
11698        .headers()
11699        .get("content-type")
11700        .and_then(|v| v.to_str().ok())
11701        .unwrap_or("application/octet-stream");
11702    let content_type = super::ContentType::from(content_type);
11703
11704    if !status.is_client_error() && !status.is_server_error() {
11705        let content = resp.text().await?;
11706        match content_type {
11707            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11708            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefreshTokenResponse`"))),
11709            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`")))),
11710        }
11711    } else {
11712        let content = resp.text().await?;
11713        let entity: Option<RetrieveRefreshTokenByIdWithIdError> = serde_json::from_str(&content).ok();
11714        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11715    }
11716}
11717
11718/// Retrieves the refresh tokens that belong to the user with the given Id.
11719pub async fn retrieve_refresh_tokens_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::RefreshTokenResponse, Error<RetrieveRefreshTokensWithIdError>> {
11720    // add a prefix to parameters to efficiently prevent name collisions
11721    let p_query_user_id = user_id;
11722
11723    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
11724    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11725
11726    if let Some(ref param_value) = p_query_user_id {
11727        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11728    }
11729    if let Some(ref user_agent) = configuration.user_agent {
11730        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11731    }
11732    if let Some(ref apikey) = configuration.api_key {
11733        let key = apikey.key.clone();
11734        let value = match apikey.prefix {
11735            Some(ref prefix) => format!("{} {}", prefix, key),
11736            None => key,
11737        };
11738        req_builder = req_builder.header("Authorization", value);
11739    };
11740
11741    let req = req_builder.build()?;
11742    let resp = configuration.client.execute(req).await?;
11743
11744    let status = resp.status();
11745    let content_type = resp
11746        .headers()
11747        .get("content-type")
11748        .and_then(|v| v.to_str().ok())
11749        .unwrap_or("application/octet-stream");
11750    let content_type = super::ContentType::from(content_type);
11751
11752    if !status.is_client_error() && !status.is_server_error() {
11753        let content = resp.text().await?;
11754        match content_type {
11755            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11756            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefreshTokenResponse`"))),
11757            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`")))),
11758        }
11759    } else {
11760        let content = resp.text().await?;
11761        let entity: Option<RetrieveRefreshTokensWithIdError> = serde_json::from_str(&content).ok();
11762        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11763    }
11764}
11765
11766/// Retrieves the registration report between the two instants. If you specify an application Id, it will only return the registration counts for that application.
11767pub 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>> {
11768    // add a prefix to parameters to efficiently prevent name collisions
11769    let p_query_application_id = application_id;
11770    let p_query_start = start;
11771    let p_query_end = end;
11772
11773    let uri_str = format!("{}/api/report/registration", configuration.base_path);
11774    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11775
11776    if let Some(ref param_value) = p_query_application_id {
11777        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11778    }
11779    if let Some(ref param_value) = p_query_start {
11780        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11781    }
11782    if let Some(ref param_value) = p_query_end {
11783        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11784    }
11785    if let Some(ref user_agent) = configuration.user_agent {
11786        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11787    }
11788    if let Some(ref apikey) = configuration.api_key {
11789        let key = apikey.key.clone();
11790        let value = match apikey.prefix {
11791            Some(ref prefix) => format!("{} {}", prefix, key),
11792            None => key,
11793        };
11794        req_builder = req_builder.header("Authorization", value);
11795    };
11796
11797    let req = req_builder.build()?;
11798    let resp = configuration.client.execute(req).await?;
11799
11800    let status = resp.status();
11801    let content_type = resp
11802        .headers()
11803        .get("content-type")
11804        .and_then(|v| v.to_str().ok())
11805        .unwrap_or("application/octet-stream");
11806    let content_type = super::ContentType::from(content_type);
11807
11808    if !status.is_client_error() && !status.is_server_error() {
11809        let content = resp.text().await?;
11810        match content_type {
11811            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11812            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationReportResponse`"))),
11813            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`")))),
11814        }
11815    } else {
11816        let content = resp.text().await?;
11817        let entity: Option<RetrieveRegistrationReportWithIdError> = serde_json::from_str(&content).ok();
11818        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11819    }
11820}
11821
11822/// Retrieves the user registration for the user with the given Id and the given application Id.
11823pub 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>> {
11824    // add a prefix to parameters to efficiently prevent name collisions
11825    let p_path_user_id = user_id;
11826    let p_path_application_id = application_id;
11827    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11828
11829    let uri_str = format!("{}/api/user/registration/{userId}/{applicationId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id), applicationId=crate::apis::urlencode(p_path_application_id));
11830    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11831
11832    if let Some(ref user_agent) = configuration.user_agent {
11833        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11834    }
11835    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
11836        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11837    }
11838    if let Some(ref apikey) = configuration.api_key {
11839        let key = apikey.key.clone();
11840        let value = match apikey.prefix {
11841            Some(ref prefix) => format!("{} {}", prefix, key),
11842            None => key,
11843        };
11844        req_builder = req_builder.header("Authorization", value);
11845    };
11846
11847    let req = req_builder.build()?;
11848    let resp = configuration.client.execute(req).await?;
11849
11850    let status = resp.status();
11851    let content_type = resp
11852        .headers()
11853        .get("content-type")
11854        .and_then(|v| v.to_str().ok())
11855        .unwrap_or("application/octet-stream");
11856    let content_type = super::ContentType::from(content_type);
11857
11858    if !status.is_client_error() && !status.is_server_error() {
11859        let content = resp.text().await?;
11860        match content_type {
11861            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11862            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
11863            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`")))),
11864        }
11865    } else {
11866        let content = resp.text().await?;
11867        let entity: Option<RetrieveRegistrationWithIdError> = serde_json::from_str(&content).ok();
11868        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11869    }
11870}
11871
11872/// Retrieves the login report between the two instants for a particular user by login Id, using specific loginIdTypes. 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. 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. If you specify an application Id, it will only return the login counts for that application.
11873pub async fn retrieve_report_login(configuration: &configuration::Configuration, application_id: Option<&str>, login_id: Option<&str>, start: Option<&str>, end: Option<&str>, login_id_types: Option<Vec<String>>, user_id: Option<&str>) -> Result<models::LoginReportResponse, Error<RetrieveReportLoginError>> {
11874    // add a prefix to parameters to efficiently prevent name collisions
11875    let p_query_application_id = application_id;
11876    let p_query_login_id = login_id;
11877    let p_query_start = start;
11878    let p_query_end = end;
11879    let p_query_login_id_types = login_id_types;
11880    let p_query_user_id = user_id;
11881
11882    let uri_str = format!("{}/api/report/login", configuration.base_path);
11883    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11884
11885    if let Some(ref param_value) = p_query_application_id {
11886        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11887    }
11888    if let Some(ref param_value) = p_query_login_id {
11889        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
11890    }
11891    if let Some(ref param_value) = p_query_start {
11892        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11893    }
11894    if let Some(ref param_value) = p_query_end {
11895        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11896    }
11897    if let Some(ref param_value) = p_query_login_id_types {
11898        req_builder = match "multi" {
11899            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("loginIdTypes".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
11900            _ => req_builder.query(&[("loginIdTypes", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
11901        };
11902    }
11903    if let Some(ref param_value) = p_query_user_id {
11904        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11905    }
11906    if let Some(ref user_agent) = configuration.user_agent {
11907        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11908    }
11909    if let Some(ref apikey) = configuration.api_key {
11910        let key = apikey.key.clone();
11911        let value = match apikey.prefix {
11912            Some(ref prefix) => format!("{} {}", prefix, key),
11913            None => key,
11914        };
11915        req_builder = req_builder.header("Authorization", value);
11916    };
11917
11918    let req = req_builder.build()?;
11919    let resp = configuration.client.execute(req).await?;
11920
11921    let status = resp.status();
11922    let content_type = resp
11923        .headers()
11924        .get("content-type")
11925        .and_then(|v| v.to_str().ok())
11926        .unwrap_or("application/octet-stream");
11927    let content_type = super::ContentType::from(content_type);
11928
11929    if !status.is_client_error() && !status.is_server_error() {
11930        let content = resp.text().await?;
11931        match content_type {
11932            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11933            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginReportResponse`"))),
11934            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`")))),
11935        }
11936    } else {
11937        let content = resp.text().await?;
11938        let entity: Option<RetrieveReportLoginError> = serde_json::from_str(&content).ok();
11939        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11940    }
11941}
11942
11943/// 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. OR 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.
11944pub async fn retrieve_status(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RetrieveStatusError>> {
11945
11946    let uri_str = format!("{}/api/status", configuration.base_path);
11947    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11948
11949    if let Some(ref user_agent) = configuration.user_agent {
11950        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11951    }
11952    if let Some(ref apikey) = configuration.api_key {
11953        let key = apikey.key.clone();
11954        let value = match apikey.prefix {
11955            Some(ref prefix) => format!("{} {}", prefix, key),
11956            None => key,
11957        };
11958        req_builder = req_builder.header("Authorization", value);
11959    };
11960
11961    let req = req_builder.build()?;
11962    let resp = configuration.client.execute(req).await?;
11963
11964    let status = resp.status();
11965    let content_type = resp
11966        .headers()
11967        .get("content-type")
11968        .and_then(|v| v.to_str().ok())
11969        .unwrap_or("application/octet-stream");
11970    let content_type = super::ContentType::from(content_type);
11971
11972    if !status.is_client_error() && !status.is_server_error() {
11973        let content = resp.text().await?;
11974        match content_type {
11975            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11976            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
11977            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`")))),
11978        }
11979    } else {
11980        let content = resp.text().await?;
11981        let entity: Option<RetrieveStatusError> = serde_json::from_str(&content).ok();
11982        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11983    }
11984}
11985
11986/// Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.
11987pub async fn retrieve_system_health_with_id(configuration: &configuration::Configuration, ) -> Result<(), Error<RetrieveSystemHealthWithIdError>> {
11988
11989    let uri_str = format!("{}/api/health", configuration.base_path);
11990    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11991
11992    if let Some(ref user_agent) = configuration.user_agent {
11993        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11994    }
11995    if let Some(ref apikey) = configuration.api_key {
11996        let key = apikey.key.clone();
11997        let value = match apikey.prefix {
11998            Some(ref prefix) => format!("{} {}", prefix, key),
11999            None => key,
12000        };
12001        req_builder = req_builder.header("Authorization", value);
12002    };
12003
12004    let req = req_builder.build()?;
12005    let resp = configuration.client.execute(req).await?;
12006
12007    let status = resp.status();
12008
12009    if !status.is_client_error() && !status.is_server_error() {
12010        Ok(())
12011    } else {
12012        let content = resp.text().await?;
12013        let entity: Option<RetrieveSystemHealthWithIdError> = serde_json::from_str(&content).ok();
12014        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12015    }
12016}
12017
12018/// Retrieves the tenant for the given Id.
12019pub async fn retrieve_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::TenantResponse, Error<RetrieveTenantWithIdError>> {
12020    // add a prefix to parameters to efficiently prevent name collisions
12021    let p_path_tenant_id = tenant_id;
12022    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12023
12024    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
12025    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12026
12027    if let Some(ref user_agent) = configuration.user_agent {
12028        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12029    }
12030    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12031        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12032    }
12033    if let Some(ref apikey) = configuration.api_key {
12034        let key = apikey.key.clone();
12035        let value = match apikey.prefix {
12036            Some(ref prefix) => format!("{} {}", prefix, key),
12037            None => key,
12038        };
12039        req_builder = req_builder.header("Authorization", value);
12040    };
12041
12042    let req = req_builder.build()?;
12043    let resp = configuration.client.execute(req).await?;
12044
12045    let status = resp.status();
12046    let content_type = resp
12047        .headers()
12048        .get("content-type")
12049        .and_then(|v| v.to_str().ok())
12050        .unwrap_or("application/octet-stream");
12051    let content_type = super::ContentType::from(content_type);
12052
12053    if !status.is_client_error() && !status.is_server_error() {
12054        let content = resp.text().await?;
12055        match content_type {
12056            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12057            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
12058            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`")))),
12059        }
12060    } else {
12061        let content = resp.text().await?;
12062        let entity: Option<RetrieveTenantWithIdError> = serde_json::from_str(&content).ok();
12063        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12064    }
12065}
12066
12067/// Retrieves the theme for the given Id.
12068pub async fn retrieve_theme_with_id(configuration: &configuration::Configuration, theme_id: &str) -> Result<models::ThemeResponse, Error<RetrieveThemeWithIdError>> {
12069    // add a prefix to parameters to efficiently prevent name collisions
12070    let p_path_theme_id = theme_id;
12071
12072    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
12073    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12074
12075    if let Some(ref user_agent) = configuration.user_agent {
12076        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12077    }
12078    if let Some(ref apikey) = configuration.api_key {
12079        let key = apikey.key.clone();
12080        let value = match apikey.prefix {
12081            Some(ref prefix) => format!("{} {}", prefix, key),
12082            None => key,
12083        };
12084        req_builder = req_builder.header("Authorization", value);
12085    };
12086
12087    let req = req_builder.build()?;
12088    let resp = configuration.client.execute(req).await?;
12089
12090    let status = resp.status();
12091    let content_type = resp
12092        .headers()
12093        .get("content-type")
12094        .and_then(|v| v.to_str().ok())
12095        .unwrap_or("application/octet-stream");
12096    let content_type = super::ContentType::from(content_type);
12097
12098    if !status.is_client_error() && !status.is_server_error() {
12099        let content = resp.text().await?;
12100        match content_type {
12101            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12102            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
12103            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`")))),
12104        }
12105    } else {
12106        let content = resp.text().await?;
12107        let entity: Option<RetrieveThemeWithIdError> = serde_json::from_str(&content).ok();
12108        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12109    }
12110}
12111
12112/// Retrieves the totals report. This contains all the total counts for each application and the global registration count.
12113pub async fn retrieve_total_report_with_id(configuration: &configuration::Configuration, ) -> Result<models::TotalsReportResponse, Error<RetrieveTotalReportWithIdError>> {
12114
12115    let uri_str = format!("{}/api/report/totals", configuration.base_path);
12116    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12117
12118    if let Some(ref user_agent) = configuration.user_agent {
12119        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12120    }
12121    if let Some(ref apikey) = configuration.api_key {
12122        let key = apikey.key.clone();
12123        let value = match apikey.prefix {
12124            Some(ref prefix) => format!("{} {}", prefix, key),
12125            None => key,
12126        };
12127        req_builder = req_builder.header("Authorization", value);
12128    };
12129
12130    let req = req_builder.build()?;
12131    let resp = configuration.client.execute(req).await?;
12132
12133    let status = resp.status();
12134    let content_type = resp
12135        .headers()
12136        .get("content-type")
12137        .and_then(|v| v.to_str().ok())
12138        .unwrap_or("application/octet-stream");
12139    let content_type = super::ContentType::from(content_type);
12140
12141    if !status.is_client_error() && !status.is_server_error() {
12142        let content = resp.text().await?;
12143        match content_type {
12144            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12145            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TotalsReportResponse`"))),
12146            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`")))),
12147        }
12148    } else {
12149        let content = resp.text().await?;
12150        let entity: Option<RetrieveTotalReportWithIdError> = serde_json::from_str(&content).ok();
12151        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12152    }
12153}
12154
12155/// Retrieve two-factor recovery codes for a user.
12156pub async fn retrieve_two_factor_recovery_codes_with_id(configuration: &configuration::Configuration, user_id: &str) -> Result<models::TwoFactorRecoveryCodeResponse, Error<RetrieveTwoFactorRecoveryCodesWithIdError>> {
12157    // add a prefix to parameters to efficiently prevent name collisions
12158    let p_path_user_id = user_id;
12159
12160    let uri_str = format!("{}/api/user/two-factor/recovery-code/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
12161    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12162
12163    if let Some(ref user_agent) = configuration.user_agent {
12164        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12165    }
12166    if let Some(ref apikey) = configuration.api_key {
12167        let key = apikey.key.clone();
12168        let value = match apikey.prefix {
12169            Some(ref prefix) => format!("{} {}", prefix, key),
12170            None => key,
12171        };
12172        req_builder = req_builder.header("Authorization", value);
12173    };
12174
12175    let req = req_builder.build()?;
12176    let resp = configuration.client.execute(req).await?;
12177
12178    let status = resp.status();
12179    let content_type = resp
12180        .headers()
12181        .get("content-type")
12182        .and_then(|v| v.to_str().ok())
12183        .unwrap_or("application/octet-stream");
12184    let content_type = super::ContentType::from(content_type);
12185
12186    if !status.is_client_error() && !status.is_server_error() {
12187        let content = resp.text().await?;
12188        match content_type {
12189            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12190            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`"))),
12191            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`")))),
12192        }
12193    } else {
12194        let content = resp.text().await?;
12195        let entity: Option<RetrieveTwoFactorRecoveryCodesWithIdError> = serde_json::from_str(&content).ok();
12196        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12197    }
12198}
12199
12200/// 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.
12201pub 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>> {
12202    // add a prefix to parameters to efficiently prevent name collisions
12203    let p_path_two_factor_trust_id = two_factor_trust_id;
12204    let p_query_user_id = user_id;
12205    let p_query_application_id = application_id;
12206
12207    let uri_str = format!("{}/api/two-factor/status/{twoFactorTrustId}", configuration.base_path, twoFactorTrustId=crate::apis::urlencode(p_path_two_factor_trust_id));
12208    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12209
12210    if let Some(ref param_value) = p_query_user_id {
12211        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12212    }
12213    if let Some(ref param_value) = p_query_application_id {
12214        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
12215    }
12216    if let Some(ref user_agent) = configuration.user_agent {
12217        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12218    }
12219    if let Some(ref apikey) = configuration.api_key {
12220        let key = apikey.key.clone();
12221        let value = match apikey.prefix {
12222            Some(ref prefix) => format!("{} {}", prefix, key),
12223            None => key,
12224        };
12225        req_builder = req_builder.header("Authorization", value);
12226    };
12227
12228    let req = req_builder.build()?;
12229    let resp = configuration.client.execute(req).await?;
12230
12231    let status = resp.status();
12232    let content_type = resp
12233        .headers()
12234        .get("content-type")
12235        .and_then(|v| v.to_str().ok())
12236        .unwrap_or("application/octet-stream");
12237    let content_type = super::ContentType::from(content_type);
12238
12239    if !status.is_client_error() && !status.is_server_error() {
12240        let content = resp.text().await?;
12241        match content_type {
12242            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12243            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStatusResponse`"))),
12244            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`")))),
12245        }
12246    } else {
12247        let content = resp.text().await?;
12248        let entity: Option<RetrieveTwoFactorStatusWithIdError> = serde_json::from_str(&content).ok();
12249        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12250    }
12251}
12252
12253/// 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 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 for the given username. OR Retrieves the user for the loginId, using specific loginIdTypes. OR Retrieves the user for the loginId. The loginId can be either the username or the email. OR Retrieves the user for the given email. 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.
12254pub async fn retrieve_user(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, verification_id: Option<&str>, username: Option<&str>, login_id: Option<&str>, login_id_types: Option<Vec<String>>, email: Option<&str>, change_password_id: Option<&str>) -> Result<models::UserResponse, Error<RetrieveUserError>> {
12255    // add a prefix to parameters to efficiently prevent name collisions
12256    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12257    let p_query_verification_id = verification_id;
12258    let p_query_username = username;
12259    let p_query_login_id = login_id;
12260    let p_query_login_id_types = login_id_types;
12261    let p_query_email = email;
12262    let p_query_change_password_id = change_password_id;
12263
12264    let uri_str = format!("{}/api/user", configuration.base_path);
12265    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12266
12267    if let Some(ref param_value) = p_query_verification_id {
12268        req_builder = req_builder.query(&[("verificationId", &param_value.to_string())]);
12269    }
12270    if let Some(ref param_value) = p_query_username {
12271        req_builder = req_builder.query(&[("username", &param_value.to_string())]);
12272    }
12273    if let Some(ref param_value) = p_query_login_id {
12274        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
12275    }
12276    if let Some(ref param_value) = p_query_login_id_types {
12277        req_builder = match "multi" {
12278            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("loginIdTypes".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
12279            _ => req_builder.query(&[("loginIdTypes", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
12280        };
12281    }
12282    if let Some(ref param_value) = p_query_email {
12283        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
12284    }
12285    if let Some(ref param_value) = p_query_change_password_id {
12286        req_builder = req_builder.query(&[("changePasswordId", &param_value.to_string())]);
12287    }
12288    if let Some(ref user_agent) = configuration.user_agent {
12289        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12290    }
12291    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12292        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12293    }
12294    if let Some(ref token) = configuration.bearer_access_token {
12295        req_builder = req_builder.bearer_auth(token.to_owned());
12296    };
12297
12298    let req = req_builder.build()?;
12299    let resp = configuration.client.execute(req).await?;
12300
12301    let status = resp.status();
12302    let content_type = resp
12303        .headers()
12304        .get("content-type")
12305        .and_then(|v| v.to_str().ok())
12306        .unwrap_or("application/octet-stream");
12307    let content_type = super::ContentType::from(content_type);
12308
12309    if !status.is_client_error() && !status.is_server_error() {
12310        let content = resp.text().await?;
12311        match content_type {
12312            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12313            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
12314            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`")))),
12315        }
12316    } else {
12317        let content = resp.text().await?;
12318        let entity: Option<RetrieveUserError> = serde_json::from_str(&content).ok();
12319        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12320    }
12321}
12322
12323/// Retrieves the user action for the given Id. If you pass in null for the Id, this will return all the user actions. OR Retrieves all the user actions that are currently inactive.
12324pub async fn retrieve_user_action(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, inactive: Option<&str>) -> Result<models::UserActionResponse, Error<RetrieveUserActionError>> {
12325    // add a prefix to parameters to efficiently prevent name collisions
12326    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12327    let p_query_inactive = inactive;
12328
12329    let uri_str = format!("{}/api/user-action", configuration.base_path);
12330    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12331
12332    if let Some(ref param_value) = p_query_inactive {
12333        req_builder = req_builder.query(&[("inactive", &param_value.to_string())]);
12334    }
12335    if let Some(ref user_agent) = configuration.user_agent {
12336        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12337    }
12338    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12339        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12340    }
12341    if let Some(ref apikey) = configuration.api_key {
12342        let key = apikey.key.clone();
12343        let value = match apikey.prefix {
12344            Some(ref prefix) => format!("{} {}", prefix, key),
12345            None => key,
12346        };
12347        req_builder = req_builder.header("Authorization", value);
12348    };
12349
12350    let req = req_builder.build()?;
12351    let resp = configuration.client.execute(req).await?;
12352
12353    let status = resp.status();
12354    let content_type = resp
12355        .headers()
12356        .get("content-type")
12357        .and_then(|v| v.to_str().ok())
12358        .unwrap_or("application/octet-stream");
12359    let content_type = super::ContentType::from(content_type);
12360
12361    if !status.is_client_error() && !status.is_server_error() {
12362        let content = resp.text().await?;
12363        match content_type {
12364            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12365            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
12366            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`")))),
12367        }
12368    } else {
12369        let content = resp.text().await?;
12370        let entity: Option<RetrieveUserActionError> = serde_json::from_str(&content).ok();
12371        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12372    }
12373}
12374
12375/// 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.
12376pub async fn retrieve_user_action_reason(configuration: &configuration::Configuration, ) -> Result<models::UserActionReasonResponse, Error<RetrieveUserActionReasonError>> {
12377
12378    let uri_str = format!("{}/api/user-action-reason", configuration.base_path);
12379    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12380
12381    if let Some(ref user_agent) = configuration.user_agent {
12382        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12383    }
12384    if let Some(ref apikey) = configuration.api_key {
12385        let key = apikey.key.clone();
12386        let value = match apikey.prefix {
12387            Some(ref prefix) => format!("{} {}", prefix, key),
12388            None => key,
12389        };
12390        req_builder = req_builder.header("Authorization", value);
12391    };
12392
12393    let req = req_builder.build()?;
12394    let resp = configuration.client.execute(req).await?;
12395
12396    let status = resp.status();
12397    let content_type = resp
12398        .headers()
12399        .get("content-type")
12400        .and_then(|v| v.to_str().ok())
12401        .unwrap_or("application/octet-stream");
12402    let content_type = super::ContentType::from(content_type);
12403
12404    if !status.is_client_error() && !status.is_server_error() {
12405        let content = resp.text().await?;
12406        match content_type {
12407            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12408            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
12409            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`")))),
12410        }
12411    } else {
12412        let content = resp.text().await?;
12413        let entity: Option<RetrieveUserActionReasonError> = serde_json::from_str(&content).ok();
12414        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12415    }
12416}
12417
12418/// 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.
12419pub async fn retrieve_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str) -> Result<models::UserActionReasonResponse, Error<RetrieveUserActionReasonWithIdError>> {
12420    // add a prefix to parameters to efficiently prevent name collisions
12421    let p_path_user_action_reason_id = user_action_reason_id;
12422
12423    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
12424    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12425
12426    if let Some(ref user_agent) = configuration.user_agent {
12427        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12428    }
12429    if let Some(ref apikey) = configuration.api_key {
12430        let key = apikey.key.clone();
12431        let value = match apikey.prefix {
12432            Some(ref prefix) => format!("{} {}", prefix, key),
12433            None => key,
12434        };
12435        req_builder = req_builder.header("Authorization", value);
12436    };
12437
12438    let req = req_builder.build()?;
12439    let resp = configuration.client.execute(req).await?;
12440
12441    let status = resp.status();
12442    let content_type = resp
12443        .headers()
12444        .get("content-type")
12445        .and_then(|v| v.to_str().ok())
12446        .unwrap_or("application/octet-stream");
12447    let content_type = super::ContentType::from(content_type);
12448
12449    if !status.is_client_error() && !status.is_server_error() {
12450        let content = resp.text().await?;
12451        match content_type {
12452            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12453            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
12454            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`")))),
12455        }
12456    } else {
12457        let content = resp.text().await?;
12458        let entity: Option<RetrieveUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
12459        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12460    }
12461}
12462
12463/// Retrieves the user action for the given Id. If you pass in null for the Id, this will return all the user actions.
12464pub 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>> {
12465    // add a prefix to parameters to efficiently prevent name collisions
12466    let p_path_user_action_id = user_action_id;
12467    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12468
12469    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
12470    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12471
12472    if let Some(ref user_agent) = configuration.user_agent {
12473        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12474    }
12475    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12476        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12477    }
12478    if let Some(ref apikey) = configuration.api_key {
12479        let key = apikey.key.clone();
12480        let value = match apikey.prefix {
12481            Some(ref prefix) => format!("{} {}", prefix, key),
12482            None => key,
12483        };
12484        req_builder = req_builder.header("Authorization", value);
12485    };
12486
12487    let req = req_builder.build()?;
12488    let resp = configuration.client.execute(req).await?;
12489
12490    let status = resp.status();
12491    let content_type = resp
12492        .headers()
12493        .get("content-type")
12494        .and_then(|v| v.to_str().ok())
12495        .unwrap_or("application/octet-stream");
12496    let content_type = super::ContentType::from(content_type);
12497
12498    if !status.is_client_error() && !status.is_server_error() {
12499        let content = resp.text().await?;
12500        match content_type {
12501            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12502            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
12503            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`")))),
12504        }
12505    } else {
12506        let content = resp.text().await?;
12507        let entity: Option<RetrieveUserActionWithIdError> = serde_json::from_str(&content).ok();
12508        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12509    }
12510}
12511
12512/// 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. 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 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.
12513pub async fn retrieve_user_actioning(configuration: &configuration::Configuration, user_id: Option<&str>, active: Option<&str>, preventing_login: Option<&str>) -> Result<models::ActionResponse, Error<RetrieveUserActioningError>> {
12514    // add a prefix to parameters to efficiently prevent name collisions
12515    let p_query_user_id = user_id;
12516    let p_query_active = active;
12517    let p_query_preventing_login = preventing_login;
12518
12519    let uri_str = format!("{}/api/user/action", configuration.base_path);
12520    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12521
12522    if let Some(ref param_value) = p_query_user_id {
12523        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12524    }
12525    if let Some(ref param_value) = p_query_active {
12526        req_builder = req_builder.query(&[("active", &param_value.to_string())]);
12527    }
12528    if let Some(ref param_value) = p_query_preventing_login {
12529        req_builder = req_builder.query(&[("preventingLogin", &param_value.to_string())]);
12530    }
12531    if let Some(ref user_agent) = configuration.user_agent {
12532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12533    }
12534    if let Some(ref apikey) = configuration.api_key {
12535        let key = apikey.key.clone();
12536        let value = match apikey.prefix {
12537            Some(ref prefix) => format!("{} {}", prefix, key),
12538            None => key,
12539        };
12540        req_builder = req_builder.header("Authorization", value);
12541    };
12542
12543    let req = req_builder.build()?;
12544    let resp = configuration.client.execute(req).await?;
12545
12546    let status = resp.status();
12547    let content_type = resp
12548        .headers()
12549        .get("content-type")
12550        .and_then(|v| v.to_str().ok())
12551        .unwrap_or("application/octet-stream");
12552    let content_type = super::ContentType::from(content_type);
12553
12554    if !status.is_client_error() && !status.is_server_error() {
12555        let content = resp.text().await?;
12556        match content_type {
12557            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12558            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
12559            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`")))),
12560        }
12561    } else {
12562        let content = resp.text().await?;
12563        let entity: Option<RetrieveUserActioningError> = serde_json::from_str(&content).ok();
12564        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12565    }
12566}
12567
12568/// 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.
12569pub async fn retrieve_user_change_password(configuration: &configuration::Configuration, login_id: Option<&str>) -> Result<(), Error<RetrieveUserChangePasswordError>> {
12570    // add a prefix to parameters to efficiently prevent name collisions
12571    let p_query_login_id = login_id;
12572
12573    let uri_str = format!("{}/api/user/change-password", configuration.base_path);
12574    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12575
12576    if let Some(ref param_value) = p_query_login_id {
12577        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
12578    }
12579    if let Some(ref user_agent) = configuration.user_agent {
12580        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12581    }
12582    if let Some(ref apikey) = configuration.api_key {
12583        let key = apikey.key.clone();
12584        let value = match apikey.prefix {
12585            Some(ref prefix) => format!("{} {}", prefix, key),
12586            None => key,
12587        };
12588        req_builder = req_builder.header("Authorization", value);
12589    };
12590
12591    let req = req_builder.build()?;
12592    let resp = configuration.client.execute(req).await?;
12593
12594    let status = resp.status();
12595
12596    if !status.is_client_error() && !status.is_server_error() {
12597        Ok(())
12598    } else {
12599        let content = resp.text().await?;
12600        let entity: Option<RetrieveUserChangePasswordError> = serde_json::from_str(&content).ok();
12601        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12602    }
12603}
12604
12605/// Retrieves all the comments for the user with the given Id.
12606pub 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>> {
12607    // add a prefix to parameters to efficiently prevent name collisions
12608    let p_path_user_id = user_id;
12609    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12610
12611    let uri_str = format!("{}/api/user/comment/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
12612    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12613
12614    if let Some(ref user_agent) = configuration.user_agent {
12615        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12616    }
12617    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12618        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12619    }
12620    if let Some(ref apikey) = configuration.api_key {
12621        let key = apikey.key.clone();
12622        let value = match apikey.prefix {
12623            Some(ref prefix) => format!("{} {}", prefix, key),
12624            None => key,
12625        };
12626        req_builder = req_builder.header("Authorization", value);
12627    };
12628
12629    let req = req_builder.build()?;
12630    let resp = configuration.client.execute(req).await?;
12631
12632    let status = resp.status();
12633    let content_type = resp
12634        .headers()
12635        .get("content-type")
12636        .and_then(|v| v.to_str().ok())
12637        .unwrap_or("application/octet-stream");
12638    let content_type = super::ContentType::from(content_type);
12639
12640    if !status.is_client_error() && !status.is_server_error() {
12641        let content = resp.text().await?;
12642        match content_type {
12643            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12644            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentResponse`"))),
12645            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`")))),
12646        }
12647    } else {
12648        let content = resp.text().await?;
12649        let entity: Option<RetrieveUserCommentsWithIdError> = serde_json::from_str(&content).ok();
12650        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12651    }
12652}
12653
12654/// Retrieve a single User consent by Id.
12655pub async fn retrieve_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str) -> Result<models::UserConsentResponse, Error<RetrieveUserConsentWithIdError>> {
12656    // add a prefix to parameters to efficiently prevent name collisions
12657    let p_path_user_consent_id = user_consent_id;
12658
12659    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
12660    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12661
12662    if let Some(ref user_agent) = configuration.user_agent {
12663        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12664    }
12665    if let Some(ref apikey) = configuration.api_key {
12666        let key = apikey.key.clone();
12667        let value = match apikey.prefix {
12668            Some(ref prefix) => format!("{} {}", prefix, key),
12669            None => key,
12670        };
12671        req_builder = req_builder.header("Authorization", value);
12672    };
12673
12674    let req = req_builder.build()?;
12675    let resp = configuration.client.execute(req).await?;
12676
12677    let status = resp.status();
12678    let content_type = resp
12679        .headers()
12680        .get("content-type")
12681        .and_then(|v| v.to_str().ok())
12682        .unwrap_or("application/octet-stream");
12683    let content_type = super::ContentType::from(content_type);
12684
12685    if !status.is_client_error() && !status.is_server_error() {
12686        let content = resp.text().await?;
12687        match content_type {
12688            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12689            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
12690            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`")))),
12691        }
12692    } else {
12693        let content = resp.text().await?;
12694        let entity: Option<RetrieveUserConsentWithIdError> = serde_json::from_str(&content).ok();
12695        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12696    }
12697}
12698
12699/// Retrieves all the consents for a User.
12700pub async fn retrieve_user_consents_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::UserConsentResponse, Error<RetrieveUserConsentsWithIdError>> {
12701    // add a prefix to parameters to efficiently prevent name collisions
12702    let p_query_user_id = user_id;
12703
12704    let uri_str = format!("{}/api/user/consent", configuration.base_path);
12705    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12706
12707    if let Some(ref param_value) = p_query_user_id {
12708        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12709    }
12710    if let Some(ref user_agent) = configuration.user_agent {
12711        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12712    }
12713    if let Some(ref apikey) = configuration.api_key {
12714        let key = apikey.key.clone();
12715        let value = match apikey.prefix {
12716            Some(ref prefix) => format!("{} {}", prefix, key),
12717            None => key,
12718        };
12719        req_builder = req_builder.header("Authorization", value);
12720    };
12721
12722    let req = req_builder.build()?;
12723    let resp = configuration.client.execute(req).await?;
12724
12725    let status = resp.status();
12726    let content_type = resp
12727        .headers()
12728        .get("content-type")
12729        .and_then(|v| v.to_str().ok())
12730        .unwrap_or("application/octet-stream");
12731    let content_type = super::ContentType::from(content_type);
12732
12733    if !status.is_client_error() && !status.is_server_error() {
12734        let content = resp.text().await?;
12735        match content_type {
12736            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12737            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
12738            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`")))),
12739        }
12740    } else {
12741        let content = resp.text().await?;
12742        let entity: Option<RetrieveUserConsentsWithIdError> = serde_json::from_str(&content).ok();
12743        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12744    }
12745}
12746
12747/// Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
12748pub async fn retrieve_user_info_from_access_token_with_id(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RetrieveUserInfoFromAccessTokenWithIdError>> {
12749
12750    let uri_str = format!("{}/oauth2/userinfo", configuration.base_path);
12751    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12752
12753    if let Some(ref user_agent) = configuration.user_agent {
12754        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12755    }
12756    if let Some(ref token) = configuration.bearer_access_token {
12757        req_builder = req_builder.bearer_auth(token.to_owned());
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 `serde_json::Value`"))),
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 `serde_json::Value`")))),
12777        }
12778    } else {
12779        let content = resp.text().await?;
12780        let entity: Option<RetrieveUserInfoFromAccessTokenWithIdError> = serde_json::from_str(&content).ok();
12781        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12782    }
12783}
12784
12785/// Retrieves the last number of login records for a user. OR Retrieves the last number of login records.
12786pub async fn retrieve_user_recent_login(configuration: &configuration::Configuration, user_id: Option<&str>, offset: Option<&str>, limit: Option<&str>) -> Result<models::RecentLoginResponse, Error<RetrieveUserRecentLoginError>> {
12787    // add a prefix to parameters to efficiently prevent name collisions
12788    let p_query_user_id = user_id;
12789    let p_query_offset = offset;
12790    let p_query_limit = limit;
12791
12792    let uri_str = format!("{}/api/user/recent-login", configuration.base_path);
12793    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12794
12795    if let Some(ref param_value) = p_query_user_id {
12796        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12797    }
12798    if let Some(ref param_value) = p_query_offset {
12799        req_builder = req_builder.query(&[("offset", &param_value.to_string())]);
12800    }
12801    if let Some(ref param_value) = p_query_limit {
12802        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
12803    }
12804    if let Some(ref user_agent) = configuration.user_agent {
12805        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12806    }
12807    if let Some(ref apikey) = configuration.api_key {
12808        let key = apikey.key.clone();
12809        let value = match apikey.prefix {
12810            Some(ref prefix) => format!("{} {}", prefix, key),
12811            None => key,
12812        };
12813        req_builder = req_builder.header("Authorization", value);
12814    };
12815
12816    let req = req_builder.build()?;
12817    let resp = configuration.client.execute(req).await?;
12818
12819    let status = resp.status();
12820    let content_type = resp
12821        .headers()
12822        .get("content-type")
12823        .and_then(|v| v.to_str().ok())
12824        .unwrap_or("application/octet-stream");
12825    let content_type = super::ContentType::from(content_type);
12826
12827    if !status.is_client_error() && !status.is_server_error() {
12828        let content = resp.text().await?;
12829        match content_type {
12830            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12831            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RecentLoginResponse`"))),
12832            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`")))),
12833        }
12834    } else {
12835        let content = resp.text().await?;
12836        let entity: Option<RetrieveUserRecentLoginError> = serde_json::from_str(&content).ok();
12837        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12838    }
12839}
12840
12841/// Retrieves the user for the given Id.
12842pub async fn retrieve_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::UserResponse, Error<RetrieveUserWithIdError>> {
12843    // add a prefix to parameters to efficiently prevent name collisions
12844    let p_path_user_id = user_id;
12845    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12846
12847    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
12848    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12849
12850    if let Some(ref user_agent) = configuration.user_agent {
12851        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12852    }
12853    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12854        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12855    }
12856    if let Some(ref apikey) = configuration.api_key {
12857        let key = apikey.key.clone();
12858        let value = match apikey.prefix {
12859            Some(ref prefix) => format!("{} {}", prefix, key),
12860            None => key,
12861        };
12862        req_builder = req_builder.header("Authorization", value);
12863    };
12864
12865    let req = req_builder.build()?;
12866    let resp = configuration.client.execute(req).await?;
12867
12868    let status = resp.status();
12869    let content_type = resp
12870        .headers()
12871        .get("content-type")
12872        .and_then(|v| v.to_str().ok())
12873        .unwrap_or("application/octet-stream");
12874    let content_type = super::ContentType::from(content_type);
12875
12876    if !status.is_client_error() && !status.is_server_error() {
12877        let content = resp.text().await?;
12878        match content_type {
12879            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12880            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
12881            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`")))),
12882        }
12883    } else {
12884        let content = resp.text().await?;
12885        let entity: Option<RetrieveUserWithIdError> = serde_json::from_str(&content).ok();
12886        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12887    }
12888}
12889
12890/// Retrieves the FusionAuth version string.
12891pub async fn retrieve_version_with_id(configuration: &configuration::Configuration, ) -> Result<models::VersionResponse, Error<RetrieveVersionWithIdError>> {
12892
12893    let uri_str = format!("{}/api/system/version", configuration.base_path);
12894    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12895
12896    if let Some(ref user_agent) = configuration.user_agent {
12897        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12898    }
12899    if let Some(ref apikey) = configuration.api_key {
12900        let key = apikey.key.clone();
12901        let value = match apikey.prefix {
12902            Some(ref prefix) => format!("{} {}", prefix, key),
12903            None => key,
12904        };
12905        req_builder = req_builder.header("Authorization", value);
12906    };
12907
12908    let req = req_builder.build()?;
12909    let resp = configuration.client.execute(req).await?;
12910
12911    let status = resp.status();
12912    let content_type = resp
12913        .headers()
12914        .get("content-type")
12915        .and_then(|v| v.to_str().ok())
12916        .unwrap_or("application/octet-stream");
12917    let content_type = super::ContentType::from(content_type);
12918
12919    if !status.is_client_error() && !status.is_server_error() {
12920        let content = resp.text().await?;
12921        match content_type {
12922            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12923            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VersionResponse`"))),
12924            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`")))),
12925        }
12926    } else {
12927        let content = resp.text().await?;
12928        let entity: Option<RetrieveVersionWithIdError> = serde_json::from_str(&content).ok();
12929        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12930    }
12931}
12932
12933/// Retrieves the WebAuthn credential for the given Id.
12934pub async fn retrieve_web_authn_credential_with_id(configuration: &configuration::Configuration, id: &str) -> Result<models::WebAuthnCredentialResponse, Error<RetrieveWebAuthnCredentialWithIdError>> {
12935    // add a prefix to parameters to efficiently prevent name collisions
12936    let p_path_id = id;
12937
12938    let uri_str = format!("{}/api/webauthn/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
12939    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12940
12941    if let Some(ref user_agent) = configuration.user_agent {
12942        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12943    }
12944    if let Some(ref apikey) = configuration.api_key {
12945        let key = apikey.key.clone();
12946        let value = match apikey.prefix {
12947            Some(ref prefix) => format!("{} {}", prefix, key),
12948            None => key,
12949        };
12950        req_builder = req_builder.header("Authorization", value);
12951    };
12952
12953    let req = req_builder.build()?;
12954    let resp = configuration.client.execute(req).await?;
12955
12956    let status = resp.status();
12957    let content_type = resp
12958        .headers()
12959        .get("content-type")
12960        .and_then(|v| v.to_str().ok())
12961        .unwrap_or("application/octet-stream");
12962    let content_type = super::ContentType::from(content_type);
12963
12964    if !status.is_client_error() && !status.is_server_error() {
12965        let content = resp.text().await?;
12966        match content_type {
12967            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12968            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponse`"))),
12969            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`")))),
12970        }
12971    } else {
12972        let content = resp.text().await?;
12973        let entity: Option<RetrieveWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
12974        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12975    }
12976}
12977
12978/// Retrieves all WebAuthn credentials for the given user.
12979pub async fn retrieve_web_authn_credentials_for_user_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::WebAuthnCredentialResponse, Error<RetrieveWebAuthnCredentialsForUserWithIdError>> {
12980    // add a prefix to parameters to efficiently prevent name collisions
12981    let p_query_user_id = user_id;
12982
12983    let uri_str = format!("{}/api/webauthn", configuration.base_path);
12984    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12985
12986    if let Some(ref param_value) = p_query_user_id {
12987        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12988    }
12989    if let Some(ref user_agent) = configuration.user_agent {
12990        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12991    }
12992    if let Some(ref apikey) = configuration.api_key {
12993        let key = apikey.key.clone();
12994        let value = match apikey.prefix {
12995            Some(ref prefix) => format!("{} {}", prefix, key),
12996            None => key,
12997        };
12998        req_builder = req_builder.header("Authorization", value);
12999    };
13000
13001    let req = req_builder.build()?;
13002    let resp = configuration.client.execute(req).await?;
13003
13004    let status = resp.status();
13005    let content_type = resp
13006        .headers()
13007        .get("content-type")
13008        .and_then(|v| v.to_str().ok())
13009        .unwrap_or("application/octet-stream");
13010    let content_type = super::ContentType::from(content_type);
13011
13012    if !status.is_client_error() && !status.is_server_error() {
13013        let content = resp.text().await?;
13014        match content_type {
13015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13016            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponse`"))),
13017            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`")))),
13018        }
13019    } else {
13020        let content = resp.text().await?;
13021        let entity: Option<RetrieveWebAuthnCredentialsForUserWithIdError> = serde_json::from_str(&content).ok();
13022        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13023    }
13024}
13025
13026/// Retrieves the webhook for the given Id. If you pass in null for the Id, this will return all the webhooks.
13027pub async fn retrieve_webhook(configuration: &configuration::Configuration, ) -> Result<models::WebhookResponse, Error<RetrieveWebhookError>> {
13028
13029    let uri_str = format!("{}/api/webhook", configuration.base_path);
13030    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13031
13032    if let Some(ref user_agent) = configuration.user_agent {
13033        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13034    }
13035    if let Some(ref apikey) = configuration.api_key {
13036        let key = apikey.key.clone();
13037        let value = match apikey.prefix {
13038            Some(ref prefix) => format!("{} {}", prefix, key),
13039            None => key,
13040        };
13041        req_builder = req_builder.header("Authorization", value);
13042    };
13043
13044    let req = req_builder.build()?;
13045    let resp = configuration.client.execute(req).await?;
13046
13047    let status = resp.status();
13048    let content_type = resp
13049        .headers()
13050        .get("content-type")
13051        .and_then(|v| v.to_str().ok())
13052        .unwrap_or("application/octet-stream");
13053    let content_type = super::ContentType::from(content_type);
13054
13055    if !status.is_client_error() && !status.is_server_error() {
13056        let content = resp.text().await?;
13057        match content_type {
13058            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13059            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
13060            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`")))),
13061        }
13062    } else {
13063        let content = resp.text().await?;
13064        let entity: Option<RetrieveWebhookError> = serde_json::from_str(&content).ok();
13065        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13066    }
13067}
13068
13069/// Retrieves a single webhook attempt log for the given Id.
13070pub async fn retrieve_webhook_attempt_log_with_id(configuration: &configuration::Configuration, webhook_attempt_log_id: &str) -> Result<models::WebhookAttemptLogResponse, Error<RetrieveWebhookAttemptLogWithIdError>> {
13071    // add a prefix to parameters to efficiently prevent name collisions
13072    let p_path_webhook_attempt_log_id = webhook_attempt_log_id;
13073
13074    let uri_str = format!("{}/api/system/webhook-attempt-log/{webhookAttemptLogId}", configuration.base_path, webhookAttemptLogId=crate::apis::urlencode(p_path_webhook_attempt_log_id));
13075    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13076
13077    if let Some(ref user_agent) = configuration.user_agent {
13078        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13079    }
13080    if let Some(ref apikey) = configuration.api_key {
13081        let key = apikey.key.clone();
13082        let value = match apikey.prefix {
13083            Some(ref prefix) => format!("{} {}", prefix, key),
13084            None => key,
13085        };
13086        req_builder = req_builder.header("Authorization", value);
13087    };
13088
13089    let req = req_builder.build()?;
13090    let resp = configuration.client.execute(req).await?;
13091
13092    let status = resp.status();
13093    let content_type = resp
13094        .headers()
13095        .get("content-type")
13096        .and_then(|v| v.to_str().ok())
13097        .unwrap_or("application/octet-stream");
13098    let content_type = super::ContentType::from(content_type);
13099
13100    if !status.is_client_error() && !status.is_server_error() {
13101        let content = resp.text().await?;
13102        match content_type {
13103            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13104            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookAttemptLogResponse`"))),
13105            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`")))),
13106        }
13107    } else {
13108        let content = resp.text().await?;
13109        let entity: Option<RetrieveWebhookAttemptLogWithIdError> = serde_json::from_str(&content).ok();
13110        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13111    }
13112}
13113
13114/// Retrieves a single webhook event log for the given Id.
13115pub async fn retrieve_webhook_event_log_with_id(configuration: &configuration::Configuration, webhook_event_log_id: &str) -> Result<models::WebhookEventLogResponse, Error<RetrieveWebhookEventLogWithIdError>> {
13116    // add a prefix to parameters to efficiently prevent name collisions
13117    let p_path_webhook_event_log_id = webhook_event_log_id;
13118
13119    let uri_str = format!("{}/api/system/webhook-event-log/{webhookEventLogId}", configuration.base_path, webhookEventLogId=crate::apis::urlencode(p_path_webhook_event_log_id));
13120    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13121
13122    if let Some(ref user_agent) = configuration.user_agent {
13123        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13124    }
13125    if let Some(ref apikey) = configuration.api_key {
13126        let key = apikey.key.clone();
13127        let value = match apikey.prefix {
13128            Some(ref prefix) => format!("{} {}", prefix, key),
13129            None => key,
13130        };
13131        req_builder = req_builder.header("Authorization", value);
13132    };
13133
13134    let req = req_builder.build()?;
13135    let resp = configuration.client.execute(req).await?;
13136
13137    let status = resp.status();
13138    let content_type = resp
13139        .headers()
13140        .get("content-type")
13141        .and_then(|v| v.to_str().ok())
13142        .unwrap_or("application/octet-stream");
13143    let content_type = super::ContentType::from(content_type);
13144
13145    if !status.is_client_error() && !status.is_server_error() {
13146        let content = resp.text().await?;
13147        match content_type {
13148            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13149            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookEventLogResponse`"))),
13150            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`")))),
13151        }
13152    } else {
13153        let content = resp.text().await?;
13154        let entity: Option<RetrieveWebhookEventLogWithIdError> = serde_json::from_str(&content).ok();
13155        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13156    }
13157}
13158
13159/// Retrieves the webhook for the given Id. If you pass in null for the Id, this will return all the webhooks.
13160pub async fn retrieve_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str) -> Result<models::WebhookResponse, Error<RetrieveWebhookWithIdError>> {
13161    // add a prefix to parameters to efficiently prevent name collisions
13162    let p_path_webhook_id = webhook_id;
13163
13164    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
13165    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13166
13167    if let Some(ref user_agent) = configuration.user_agent {
13168        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13169    }
13170    if let Some(ref apikey) = configuration.api_key {
13171        let key = apikey.key.clone();
13172        let value = match apikey.prefix {
13173            Some(ref prefix) => format!("{} {}", prefix, key),
13174            None => key,
13175        };
13176        req_builder = req_builder.header("Authorization", value);
13177    };
13178
13179    let req = req_builder.build()?;
13180    let resp = configuration.client.execute(req).await?;
13181
13182    let status = resp.status();
13183    let content_type = resp
13184        .headers()
13185        .get("content-type")
13186        .and_then(|v| v.to_str().ok())
13187        .unwrap_or("application/octet-stream");
13188    let content_type = super::ContentType::from(content_type);
13189
13190    if !status.is_client_error() && !status.is_server_error() {
13191        let content = resp.text().await?;
13192        match content_type {
13193            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13194            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
13195            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`")))),
13196        }
13197    } else {
13198        let content = resp.text().await?;
13199        let entity: Option<RetrieveWebhookWithIdError> = serde_json::from_str(&content).ok();
13200        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13201    }
13202}
13203
13204/// Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.
13205pub async fn revoke_refresh_token_by_id_with_id(configuration: &configuration::Configuration, token_id: &str) -> Result<(), Error<RevokeRefreshTokenByIdWithIdError>> {
13206    // add a prefix to parameters to efficiently prevent name collisions
13207    let p_path_token_id = token_id;
13208
13209    let uri_str = format!("{}/api/jwt/refresh/{tokenId}", configuration.base_path, tokenId=crate::apis::urlencode(p_path_token_id));
13210    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
13211
13212    if let Some(ref user_agent) = configuration.user_agent {
13213        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13214    }
13215    if let Some(ref apikey) = configuration.api_key {
13216        let key = apikey.key.clone();
13217        let value = match apikey.prefix {
13218            Some(ref prefix) => format!("{} {}", prefix, key),
13219            None => key,
13220        };
13221        req_builder = req_builder.header("Authorization", value);
13222    };
13223
13224    let req = req_builder.build()?;
13225    let resp = configuration.client.execute(req).await?;
13226
13227    let status = resp.status();
13228
13229    if !status.is_client_error() && !status.is_server_error() {
13230        Ok(())
13231    } else {
13232        let content = resp.text().await?;
13233        let entity: Option<RevokeRefreshTokenByIdWithIdError> = serde_json::from_str(&content).ok();
13234        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13235    }
13236}
13237
13238/// Revokes a single User consent by Id.
13239pub async fn revoke_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str) -> Result<(), Error<RevokeUserConsentWithIdError>> {
13240    // add a prefix to parameters to efficiently prevent name collisions
13241    let p_path_user_consent_id = user_consent_id;
13242
13243    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
13244    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
13245
13246    if let Some(ref user_agent) = configuration.user_agent {
13247        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13248    }
13249    if let Some(ref apikey) = configuration.api_key {
13250        let key = apikey.key.clone();
13251        let value = match apikey.prefix {
13252            Some(ref prefix) => format!("{} {}", prefix, key),
13253            None => key,
13254        };
13255        req_builder = req_builder.header("Authorization", value);
13256    };
13257
13258    let req = req_builder.build()?;
13259    let resp = configuration.client.execute(req).await?;
13260
13261    let status = resp.status();
13262
13263    if !status.is_client_error() && !status.is_server_error() {
13264        Ok(())
13265    } else {
13266        let content = resp.text().await?;
13267        let entity: Option<RevokeUserConsentWithIdError> = serde_json::from_str(&content).ok();
13268        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13269    }
13270}
13271
13272/// Searches applications with the specified criteria and pagination.
13273pub async fn search_applications_with_id(configuration: &configuration::Configuration, application_search_request: Option<models::ApplicationSearchRequest>) -> Result<models::ApplicationSearchResponse, Error<SearchApplicationsWithIdError>> {
13274    // add a prefix to parameters to efficiently prevent name collisions
13275    let p_body_application_search_request = application_search_request;
13276
13277    let uri_str = format!("{}/api/application/search", configuration.base_path);
13278    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13279
13280    if let Some(ref user_agent) = configuration.user_agent {
13281        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13282    }
13283    if let Some(ref apikey) = configuration.api_key {
13284        let key = apikey.key.clone();
13285        let value = match apikey.prefix {
13286            Some(ref prefix) => format!("{} {}", prefix, key),
13287            None => key,
13288        };
13289        req_builder = req_builder.header("Authorization", value);
13290    };
13291    req_builder = req_builder.json(&p_body_application_search_request);
13292
13293    let req = req_builder.build()?;
13294    let resp = configuration.client.execute(req).await?;
13295
13296    let status = resp.status();
13297    let content_type = resp
13298        .headers()
13299        .get("content-type")
13300        .and_then(|v| v.to_str().ok())
13301        .unwrap_or("application/octet-stream");
13302    let content_type = super::ContentType::from(content_type);
13303
13304    if !status.is_client_error() && !status.is_server_error() {
13305        let content = resp.text().await?;
13306        match content_type {
13307            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13308            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationSearchResponse`"))),
13309            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`")))),
13310        }
13311    } else {
13312        let content = resp.text().await?;
13313        let entity: Option<SearchApplicationsWithIdError> = serde_json::from_str(&content).ok();
13314        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13315    }
13316}
13317
13318/// Searches the audit logs with the specified criteria and pagination.
13319pub async fn search_audit_logs_with_id(configuration: &configuration::Configuration, audit_log_search_request: Option<models::AuditLogSearchRequest>) -> Result<models::AuditLogSearchResponse, Error<SearchAuditLogsWithIdError>> {
13320    // add a prefix to parameters to efficiently prevent name collisions
13321    let p_body_audit_log_search_request = audit_log_search_request;
13322
13323    let uri_str = format!("{}/api/system/audit-log/search", configuration.base_path);
13324    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13325
13326    if let Some(ref user_agent) = configuration.user_agent {
13327        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13328    }
13329    if let Some(ref apikey) = configuration.api_key {
13330        let key = apikey.key.clone();
13331        let value = match apikey.prefix {
13332            Some(ref prefix) => format!("{} {}", prefix, key),
13333            None => key,
13334        };
13335        req_builder = req_builder.header("Authorization", value);
13336    };
13337    req_builder = req_builder.json(&p_body_audit_log_search_request);
13338
13339    let req = req_builder.build()?;
13340    let resp = configuration.client.execute(req).await?;
13341
13342    let status = resp.status();
13343    let content_type = resp
13344        .headers()
13345        .get("content-type")
13346        .and_then(|v| v.to_str().ok())
13347        .unwrap_or("application/octet-stream");
13348    let content_type = super::ContentType::from(content_type);
13349
13350    if !status.is_client_error() && !status.is_server_error() {
13351        let content = resp.text().await?;
13352        match content_type {
13353            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13354            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogSearchResponse`"))),
13355            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`")))),
13356        }
13357    } else {
13358        let content = resp.text().await?;
13359        let entity: Option<SearchAuditLogsWithIdError> = serde_json::from_str(&content).ok();
13360        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13361    }
13362}
13363
13364/// Searches consents with the specified criteria and pagination.
13365pub async fn search_consents_with_id(configuration: &configuration::Configuration, consent_search_request: Option<models::ConsentSearchRequest>) -> Result<models::ConsentSearchResponse, Error<SearchConsentsWithIdError>> {
13366    // add a prefix to parameters to efficiently prevent name collisions
13367    let p_body_consent_search_request = consent_search_request;
13368
13369    let uri_str = format!("{}/api/consent/search", configuration.base_path);
13370    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13371
13372    if let Some(ref user_agent) = configuration.user_agent {
13373        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13374    }
13375    if let Some(ref apikey) = configuration.api_key {
13376        let key = apikey.key.clone();
13377        let value = match apikey.prefix {
13378            Some(ref prefix) => format!("{} {}", prefix, key),
13379            None => key,
13380        };
13381        req_builder = req_builder.header("Authorization", value);
13382    };
13383    req_builder = req_builder.json(&p_body_consent_search_request);
13384
13385    let req = req_builder.build()?;
13386    let resp = configuration.client.execute(req).await?;
13387
13388    let status = resp.status();
13389    let content_type = resp
13390        .headers()
13391        .get("content-type")
13392        .and_then(|v| v.to_str().ok())
13393        .unwrap_or("application/octet-stream");
13394    let content_type = super::ContentType::from(content_type);
13395
13396    if !status.is_client_error() && !status.is_server_error() {
13397        let content = resp.text().await?;
13398        match content_type {
13399            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13400            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentSearchResponse`"))),
13401            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`")))),
13402        }
13403    } else {
13404        let content = resp.text().await?;
13405        let entity: Option<SearchConsentsWithIdError> = serde_json::from_str(&content).ok();
13406        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13407    }
13408}
13409
13410/// Searches email templates with the specified criteria and pagination.
13411pub async fn search_email_templates_with_id(configuration: &configuration::Configuration, email_template_search_request: Option<models::EmailTemplateSearchRequest>) -> Result<models::EmailTemplateSearchResponse, Error<SearchEmailTemplatesWithIdError>> {
13412    // add a prefix to parameters to efficiently prevent name collisions
13413    let p_body_email_template_search_request = email_template_search_request;
13414
13415    let uri_str = format!("{}/api/email/template/search", configuration.base_path);
13416    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13417
13418    if let Some(ref user_agent) = configuration.user_agent {
13419        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13420    }
13421    if let Some(ref apikey) = configuration.api_key {
13422        let key = apikey.key.clone();
13423        let value = match apikey.prefix {
13424            Some(ref prefix) => format!("{} {}", prefix, key),
13425            None => key,
13426        };
13427        req_builder = req_builder.header("Authorization", value);
13428    };
13429    req_builder = req_builder.json(&p_body_email_template_search_request);
13430
13431    let req = req_builder.build()?;
13432    let resp = configuration.client.execute(req).await?;
13433
13434    let status = resp.status();
13435    let content_type = resp
13436        .headers()
13437        .get("content-type")
13438        .and_then(|v| v.to_str().ok())
13439        .unwrap_or("application/octet-stream");
13440    let content_type = super::ContentType::from(content_type);
13441
13442    if !status.is_client_error() && !status.is_server_error() {
13443        let content = resp.text().await?;
13444        match content_type {
13445            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13446            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateSearchResponse`"))),
13447            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`")))),
13448        }
13449    } else {
13450        let content = resp.text().await?;
13451        let entity: Option<SearchEmailTemplatesWithIdError> = serde_json::from_str(&content).ok();
13452        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13453    }
13454}
13455
13456/// Retrieves the entities for the given Ids. If any Id is invalid, it is ignored.
13457pub async fn search_entities_by_ids_with_id(configuration: &configuration::Configuration, ids: Option<&str>) -> Result<models::EntitySearchResponse, Error<SearchEntitiesByIdsWithIdError>> {
13458    // add a prefix to parameters to efficiently prevent name collisions
13459    let p_query_ids = ids;
13460
13461    let uri_str = format!("{}/api/entity/search", configuration.base_path);
13462    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13463
13464    if let Some(ref param_value) = p_query_ids {
13465        req_builder = req_builder.query(&[("ids", &param_value.to_string())]);
13466    }
13467    if let Some(ref user_agent) = configuration.user_agent {
13468        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13469    }
13470    if let Some(ref apikey) = configuration.api_key {
13471        let key = apikey.key.clone();
13472        let value = match apikey.prefix {
13473            Some(ref prefix) => format!("{} {}", prefix, key),
13474            None => key,
13475        };
13476        req_builder = req_builder.header("Authorization", value);
13477    };
13478
13479    let req = req_builder.build()?;
13480    let resp = configuration.client.execute(req).await?;
13481
13482    let status = resp.status();
13483    let content_type = resp
13484        .headers()
13485        .get("content-type")
13486        .and_then(|v| v.to_str().ok())
13487        .unwrap_or("application/octet-stream");
13488    let content_type = super::ContentType::from(content_type);
13489
13490    if !status.is_client_error() && !status.is_server_error() {
13491        let content = resp.text().await?;
13492        match content_type {
13493            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13494            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntitySearchResponse`"))),
13495            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`")))),
13496        }
13497    } else {
13498        let content = resp.text().await?;
13499        let entity: Option<SearchEntitiesByIdsWithIdError> = serde_json::from_str(&content).ok();
13500        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13501    }
13502}
13503
13504/// Searches entities with the specified criteria and pagination.
13505pub async fn search_entities_with_id(configuration: &configuration::Configuration, entity_search_request: Option<models::EntitySearchRequest>) -> Result<models::EntitySearchResponse, Error<SearchEntitiesWithIdError>> {
13506    // add a prefix to parameters to efficiently prevent name collisions
13507    let p_body_entity_search_request = entity_search_request;
13508
13509    let uri_str = format!("{}/api/entity/search", configuration.base_path);
13510    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13511
13512    if let Some(ref user_agent) = configuration.user_agent {
13513        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13514    }
13515    if let Some(ref apikey) = configuration.api_key {
13516        let key = apikey.key.clone();
13517        let value = match apikey.prefix {
13518            Some(ref prefix) => format!("{} {}", prefix, key),
13519            None => key,
13520        };
13521        req_builder = req_builder.header("Authorization", value);
13522    };
13523    req_builder = req_builder.json(&p_body_entity_search_request);
13524
13525    let req = req_builder.build()?;
13526    let resp = configuration.client.execute(req).await?;
13527
13528    let status = resp.status();
13529    let content_type = resp
13530        .headers()
13531        .get("content-type")
13532        .and_then(|v| v.to_str().ok())
13533        .unwrap_or("application/octet-stream");
13534    let content_type = super::ContentType::from(content_type);
13535
13536    if !status.is_client_error() && !status.is_server_error() {
13537        let content = resp.text().await?;
13538        match content_type {
13539            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13540            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntitySearchResponse`"))),
13541            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`")))),
13542        }
13543    } else {
13544        let content = resp.text().await?;
13545        let entity: Option<SearchEntitiesWithIdError> = serde_json::from_str(&content).ok();
13546        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13547    }
13548}
13549
13550/// Searches Entity Grants with the specified criteria and pagination.
13551pub async fn search_entity_grants_with_id(configuration: &configuration::Configuration, entity_grant_search_request: Option<models::EntityGrantSearchRequest>) -> Result<models::EntityGrantSearchResponse, Error<SearchEntityGrantsWithIdError>> {
13552    // add a prefix to parameters to efficiently prevent name collisions
13553    let p_body_entity_grant_search_request = entity_grant_search_request;
13554
13555    let uri_str = format!("{}/api/entity/grant/search", configuration.base_path);
13556    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13557
13558    if let Some(ref user_agent) = configuration.user_agent {
13559        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13560    }
13561    if let Some(ref apikey) = configuration.api_key {
13562        let key = apikey.key.clone();
13563        let value = match apikey.prefix {
13564            Some(ref prefix) => format!("{} {}", prefix, key),
13565            None => key,
13566        };
13567        req_builder = req_builder.header("Authorization", value);
13568    };
13569    req_builder = req_builder.json(&p_body_entity_grant_search_request);
13570
13571    let req = req_builder.build()?;
13572    let resp = configuration.client.execute(req).await?;
13573
13574    let status = resp.status();
13575    let content_type = resp
13576        .headers()
13577        .get("content-type")
13578        .and_then(|v| v.to_str().ok())
13579        .unwrap_or("application/octet-stream");
13580    let content_type = super::ContentType::from(content_type);
13581
13582    if !status.is_client_error() && !status.is_server_error() {
13583        let content = resp.text().await?;
13584        match content_type {
13585            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13586            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityGrantSearchResponse`"))),
13587            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`")))),
13588        }
13589    } else {
13590        let content = resp.text().await?;
13591        let entity: Option<SearchEntityGrantsWithIdError> = serde_json::from_str(&content).ok();
13592        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13593    }
13594}
13595
13596/// Searches the entity types with the specified criteria and pagination.
13597pub async fn search_entity_types_with_id(configuration: &configuration::Configuration, entity_type_search_request: Option<models::EntityTypeSearchRequest>) -> Result<models::EntityTypeSearchResponse, Error<SearchEntityTypesWithIdError>> {
13598    // add a prefix to parameters to efficiently prevent name collisions
13599    let p_body_entity_type_search_request = entity_type_search_request;
13600
13601    let uri_str = format!("{}/api/entity/type/search", configuration.base_path);
13602    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13603
13604    if let Some(ref user_agent) = configuration.user_agent {
13605        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13606    }
13607    if let Some(ref apikey) = configuration.api_key {
13608        let key = apikey.key.clone();
13609        let value = match apikey.prefix {
13610            Some(ref prefix) => format!("{} {}", prefix, key),
13611            None => key,
13612        };
13613        req_builder = req_builder.header("Authorization", value);
13614    };
13615    req_builder = req_builder.json(&p_body_entity_type_search_request);
13616
13617    let req = req_builder.build()?;
13618    let resp = configuration.client.execute(req).await?;
13619
13620    let status = resp.status();
13621    let content_type = resp
13622        .headers()
13623        .get("content-type")
13624        .and_then(|v| v.to_str().ok())
13625        .unwrap_or("application/octet-stream");
13626    let content_type = super::ContentType::from(content_type);
13627
13628    if !status.is_client_error() && !status.is_server_error() {
13629        let content = resp.text().await?;
13630        match content_type {
13631            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13632            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeSearchResponse`"))),
13633            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`")))),
13634        }
13635    } else {
13636        let content = resp.text().await?;
13637        let entity: Option<SearchEntityTypesWithIdError> = serde_json::from_str(&content).ok();
13638        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13639    }
13640}
13641
13642/// Searches the event logs with the specified criteria and pagination.
13643pub async fn search_event_logs_with_id(configuration: &configuration::Configuration, event_log_search_request: Option<models::EventLogSearchRequest>) -> Result<models::EventLogSearchResponse, Error<SearchEventLogsWithIdError>> {
13644    // add a prefix to parameters to efficiently prevent name collisions
13645    let p_body_event_log_search_request = event_log_search_request;
13646
13647    let uri_str = format!("{}/api/system/event-log/search", configuration.base_path);
13648    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13649
13650    if let Some(ref user_agent) = configuration.user_agent {
13651        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13652    }
13653    if let Some(ref apikey) = configuration.api_key {
13654        let key = apikey.key.clone();
13655        let value = match apikey.prefix {
13656            Some(ref prefix) => format!("{} {}", prefix, key),
13657            None => key,
13658        };
13659        req_builder = req_builder.header("Authorization", value);
13660    };
13661    req_builder = req_builder.json(&p_body_event_log_search_request);
13662
13663    let req = req_builder.build()?;
13664    let resp = configuration.client.execute(req).await?;
13665
13666    let status = resp.status();
13667    let content_type = resp
13668        .headers()
13669        .get("content-type")
13670        .and_then(|v| v.to_str().ok())
13671        .unwrap_or("application/octet-stream");
13672    let content_type = super::ContentType::from(content_type);
13673
13674    if !status.is_client_error() && !status.is_server_error() {
13675        let content = resp.text().await?;
13676        match content_type {
13677            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13678            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventLogSearchResponse`"))),
13679            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`")))),
13680        }
13681    } else {
13682        let content = resp.text().await?;
13683        let entity: Option<SearchEventLogsWithIdError> = serde_json::from_str(&content).ok();
13684        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13685    }
13686}
13687
13688/// Searches group members with the specified criteria and pagination.
13689pub async fn search_group_members_with_id(configuration: &configuration::Configuration, group_member_search_request: Option<models::GroupMemberSearchRequest>) -> Result<models::GroupMemberSearchResponse, Error<SearchGroupMembersWithIdError>> {
13690    // add a prefix to parameters to efficiently prevent name collisions
13691    let p_body_group_member_search_request = group_member_search_request;
13692
13693    let uri_str = format!("{}/api/group/member/search", configuration.base_path);
13694    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13695
13696    if let Some(ref user_agent) = configuration.user_agent {
13697        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13698    }
13699    if let Some(ref apikey) = configuration.api_key {
13700        let key = apikey.key.clone();
13701        let value = match apikey.prefix {
13702            Some(ref prefix) => format!("{} {}", prefix, key),
13703            None => key,
13704        };
13705        req_builder = req_builder.header("Authorization", value);
13706    };
13707    req_builder = req_builder.json(&p_body_group_member_search_request);
13708
13709    let req = req_builder.build()?;
13710    let resp = configuration.client.execute(req).await?;
13711
13712    let status = resp.status();
13713    let content_type = resp
13714        .headers()
13715        .get("content-type")
13716        .and_then(|v| v.to_str().ok())
13717        .unwrap_or("application/octet-stream");
13718    let content_type = super::ContentType::from(content_type);
13719
13720    if !status.is_client_error() && !status.is_server_error() {
13721        let content = resp.text().await?;
13722        match content_type {
13723            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13724            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupMemberSearchResponse`"))),
13725            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`")))),
13726        }
13727    } else {
13728        let content = resp.text().await?;
13729        let entity: Option<SearchGroupMembersWithIdError> = serde_json::from_str(&content).ok();
13730        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13731    }
13732}
13733
13734/// Searches groups with the specified criteria and pagination.
13735pub async fn search_groups_with_id(configuration: &configuration::Configuration, group_search_request: Option<models::GroupSearchRequest>) -> Result<models::GroupSearchResponse, Error<SearchGroupsWithIdError>> {
13736    // add a prefix to parameters to efficiently prevent name collisions
13737    let p_body_group_search_request = group_search_request;
13738
13739    let uri_str = format!("{}/api/group/search", configuration.base_path);
13740    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13741
13742    if let Some(ref user_agent) = configuration.user_agent {
13743        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13744    }
13745    if let Some(ref apikey) = configuration.api_key {
13746        let key = apikey.key.clone();
13747        let value = match apikey.prefix {
13748            Some(ref prefix) => format!("{} {}", prefix, key),
13749            None => key,
13750        };
13751        req_builder = req_builder.header("Authorization", value);
13752    };
13753    req_builder = req_builder.json(&p_body_group_search_request);
13754
13755    let req = req_builder.build()?;
13756    let resp = configuration.client.execute(req).await?;
13757
13758    let status = resp.status();
13759    let content_type = resp
13760        .headers()
13761        .get("content-type")
13762        .and_then(|v| v.to_str().ok())
13763        .unwrap_or("application/octet-stream");
13764    let content_type = super::ContentType::from(content_type);
13765
13766    if !status.is_client_error() && !status.is_server_error() {
13767        let content = resp.text().await?;
13768        match content_type {
13769            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13770            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSearchResponse`"))),
13771            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`")))),
13772        }
13773    } else {
13774        let content = resp.text().await?;
13775        let entity: Option<SearchGroupsWithIdError> = serde_json::from_str(&content).ok();
13776        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13777    }
13778}
13779
13780/// Searches identity providers with the specified criteria and pagination.
13781pub async fn search_identity_providers_with_id(configuration: &configuration::Configuration, identity_provider_search_request: Option<models::IdentityProviderSearchRequest>) -> Result<models::IdentityProviderSearchResponse, Error<SearchIdentityProvidersWithIdError>> {
13782    // add a prefix to parameters to efficiently prevent name collisions
13783    let p_body_identity_provider_search_request = identity_provider_search_request;
13784
13785    let uri_str = format!("{}/api/identity-provider/search", configuration.base_path);
13786    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13787
13788    if let Some(ref user_agent) = configuration.user_agent {
13789        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13790    }
13791    if let Some(ref apikey) = configuration.api_key {
13792        let key = apikey.key.clone();
13793        let value = match apikey.prefix {
13794            Some(ref prefix) => format!("{} {}", prefix, key),
13795            None => key,
13796        };
13797        req_builder = req_builder.header("Authorization", value);
13798    };
13799    req_builder = req_builder.json(&p_body_identity_provider_search_request);
13800
13801    let req = req_builder.build()?;
13802    let resp = configuration.client.execute(req).await?;
13803
13804    let status = resp.status();
13805    let content_type = resp
13806        .headers()
13807        .get("content-type")
13808        .and_then(|v| v.to_str().ok())
13809        .unwrap_or("application/octet-stream");
13810    let content_type = super::ContentType::from(content_type);
13811
13812    if !status.is_client_error() && !status.is_server_error() {
13813        let content = resp.text().await?;
13814        match content_type {
13815            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13816            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderSearchResponse`"))),
13817            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`")))),
13818        }
13819    } else {
13820        let content = resp.text().await?;
13821        let entity: Option<SearchIdentityProvidersWithIdError> = serde_json::from_str(&content).ok();
13822        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13823    }
13824}
13825
13826/// Searches the IP Access Control Lists with the specified criteria and pagination.
13827pub 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>> {
13828    // add a prefix to parameters to efficiently prevent name collisions
13829    let p_body_ip_access_control_list_search_request = ip_access_control_list_search_request;
13830
13831    let uri_str = format!("{}/api/ip-acl/search", configuration.base_path);
13832    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13833
13834    if let Some(ref user_agent) = configuration.user_agent {
13835        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13836    }
13837    if let Some(ref apikey) = configuration.api_key {
13838        let key = apikey.key.clone();
13839        let value = match apikey.prefix {
13840            Some(ref prefix) => format!("{} {}", prefix, key),
13841            None => key,
13842        };
13843        req_builder = req_builder.header("Authorization", value);
13844    };
13845    req_builder = req_builder.json(&p_body_ip_access_control_list_search_request);
13846
13847    let req = req_builder.build()?;
13848    let resp = configuration.client.execute(req).await?;
13849
13850    let status = resp.status();
13851    let content_type = resp
13852        .headers()
13853        .get("content-type")
13854        .and_then(|v| v.to_str().ok())
13855        .unwrap_or("application/octet-stream");
13856    let content_type = super::ContentType::from(content_type);
13857
13858    if !status.is_client_error() && !status.is_server_error() {
13859        let content = resp.text().await?;
13860        match content_type {
13861            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13862            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListSearchResponse`"))),
13863            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`")))),
13864        }
13865    } else {
13866        let content = resp.text().await?;
13867        let entity: Option<SearchIpAccessControlListsWithIdError> = serde_json::from_str(&content).ok();
13868        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13869    }
13870}
13871
13872/// Searches keys with the specified criteria and pagination.
13873pub async fn search_keys_with_id(configuration: &configuration::Configuration, key_search_request: Option<models::KeySearchRequest>) -> Result<models::KeySearchResponse, Error<SearchKeysWithIdError>> {
13874    // add a prefix to parameters to efficiently prevent name collisions
13875    let p_body_key_search_request = key_search_request;
13876
13877    let uri_str = format!("{}/api/key/search", configuration.base_path);
13878    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13879
13880    if let Some(ref user_agent) = configuration.user_agent {
13881        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13882    }
13883    if let Some(ref apikey) = configuration.api_key {
13884        let key = apikey.key.clone();
13885        let value = match apikey.prefix {
13886            Some(ref prefix) => format!("{} {}", prefix, key),
13887            None => key,
13888        };
13889        req_builder = req_builder.header("Authorization", value);
13890    };
13891    req_builder = req_builder.json(&p_body_key_search_request);
13892
13893    let req = req_builder.build()?;
13894    let resp = configuration.client.execute(req).await?;
13895
13896    let status = resp.status();
13897    let content_type = resp
13898        .headers()
13899        .get("content-type")
13900        .and_then(|v| v.to_str().ok())
13901        .unwrap_or("application/octet-stream");
13902    let content_type = super::ContentType::from(content_type);
13903
13904    if !status.is_client_error() && !status.is_server_error() {
13905        let content = resp.text().await?;
13906        match content_type {
13907            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13908            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeySearchResponse`"))),
13909            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`")))),
13910        }
13911    } else {
13912        let content = resp.text().await?;
13913        let entity: Option<SearchKeysWithIdError> = serde_json::from_str(&content).ok();
13914        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13915    }
13916}
13917
13918/// Searches lambdas with the specified criteria and pagination.
13919pub async fn search_lambdas_with_id(configuration: &configuration::Configuration, lambda_search_request: Option<models::LambdaSearchRequest>) -> Result<models::LambdaSearchResponse, Error<SearchLambdasWithIdError>> {
13920    // add a prefix to parameters to efficiently prevent name collisions
13921    let p_body_lambda_search_request = lambda_search_request;
13922
13923    let uri_str = format!("{}/api/lambda/search", configuration.base_path);
13924    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13925
13926    if let Some(ref user_agent) = configuration.user_agent {
13927        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13928    }
13929    if let Some(ref apikey) = configuration.api_key {
13930        let key = apikey.key.clone();
13931        let value = match apikey.prefix {
13932            Some(ref prefix) => format!("{} {}", prefix, key),
13933            None => key,
13934        };
13935        req_builder = req_builder.header("Authorization", value);
13936    };
13937    req_builder = req_builder.json(&p_body_lambda_search_request);
13938
13939    let req = req_builder.build()?;
13940    let resp = configuration.client.execute(req).await?;
13941
13942    let status = resp.status();
13943    let content_type = resp
13944        .headers()
13945        .get("content-type")
13946        .and_then(|v| v.to_str().ok())
13947        .unwrap_or("application/octet-stream");
13948    let content_type = super::ContentType::from(content_type);
13949
13950    if !status.is_client_error() && !status.is_server_error() {
13951        let content = resp.text().await?;
13952        match content_type {
13953            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13954            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaSearchResponse`"))),
13955            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`")))),
13956        }
13957    } else {
13958        let content = resp.text().await?;
13959        let entity: Option<SearchLambdasWithIdError> = serde_json::from_str(&content).ok();
13960        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13961    }
13962}
13963
13964/// Searches the login records with the specified criteria and pagination.
13965pub async fn search_login_records_with_id(configuration: &configuration::Configuration, login_record_search_request: Option<models::LoginRecordSearchRequest>) -> Result<models::LoginRecordSearchResponse, Error<SearchLoginRecordsWithIdError>> {
13966    // add a prefix to parameters to efficiently prevent name collisions
13967    let p_body_login_record_search_request = login_record_search_request;
13968
13969    let uri_str = format!("{}/api/system/login-record/search", configuration.base_path);
13970    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13971
13972    if let Some(ref user_agent) = configuration.user_agent {
13973        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13974    }
13975    if let Some(ref apikey) = configuration.api_key {
13976        let key = apikey.key.clone();
13977        let value = match apikey.prefix {
13978            Some(ref prefix) => format!("{} {}", prefix, key),
13979            None => key,
13980        };
13981        req_builder = req_builder.header("Authorization", value);
13982    };
13983    req_builder = req_builder.json(&p_body_login_record_search_request);
13984
13985    let req = req_builder.build()?;
13986    let resp = configuration.client.execute(req).await?;
13987
13988    let status = resp.status();
13989    let content_type = resp
13990        .headers()
13991        .get("content-type")
13992        .and_then(|v| v.to_str().ok())
13993        .unwrap_or("application/octet-stream");
13994    let content_type = super::ContentType::from(content_type);
13995
13996    if !status.is_client_error() && !status.is_server_error() {
13997        let content = resp.text().await?;
13998        match content_type {
13999            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14000            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginRecordSearchResponse`"))),
14001            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`")))),
14002        }
14003    } else {
14004        let content = resp.text().await?;
14005        let entity: Option<SearchLoginRecordsWithIdError> = serde_json::from_str(&content).ok();
14006        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14007    }
14008}
14009
14010/// Searches tenants with the specified criteria and pagination.
14011pub async fn search_tenants_with_id(configuration: &configuration::Configuration, tenant_search_request: Option<models::TenantSearchRequest>) -> Result<models::TenantSearchResponse, Error<SearchTenantsWithIdError>> {
14012    // add a prefix to parameters to efficiently prevent name collisions
14013    let p_body_tenant_search_request = tenant_search_request;
14014
14015    let uri_str = format!("{}/api/tenant/search", configuration.base_path);
14016    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14017
14018    if let Some(ref user_agent) = configuration.user_agent {
14019        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14020    }
14021    if let Some(ref apikey) = configuration.api_key {
14022        let key = apikey.key.clone();
14023        let value = match apikey.prefix {
14024            Some(ref prefix) => format!("{} {}", prefix, key),
14025            None => key,
14026        };
14027        req_builder = req_builder.header("Authorization", value);
14028    };
14029    req_builder = req_builder.json(&p_body_tenant_search_request);
14030
14031    let req = req_builder.build()?;
14032    let resp = configuration.client.execute(req).await?;
14033
14034    let status = resp.status();
14035    let content_type = resp
14036        .headers()
14037        .get("content-type")
14038        .and_then(|v| v.to_str().ok())
14039        .unwrap_or("application/octet-stream");
14040    let content_type = super::ContentType::from(content_type);
14041
14042    if !status.is_client_error() && !status.is_server_error() {
14043        let content = resp.text().await?;
14044        match content_type {
14045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14046            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantSearchResponse`"))),
14047            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`")))),
14048        }
14049    } else {
14050        let content = resp.text().await?;
14051        let entity: Option<SearchTenantsWithIdError> = serde_json::from_str(&content).ok();
14052        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14053    }
14054}
14055
14056/// Searches themes with the specified criteria and pagination.
14057pub async fn search_themes_with_id(configuration: &configuration::Configuration, theme_search_request: Option<models::ThemeSearchRequest>) -> Result<models::ThemeSearchResponse, Error<SearchThemesWithIdError>> {
14058    // add a prefix to parameters to efficiently prevent name collisions
14059    let p_body_theme_search_request = theme_search_request;
14060
14061    let uri_str = format!("{}/api/theme/search", configuration.base_path);
14062    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14063
14064    if let Some(ref user_agent) = configuration.user_agent {
14065        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14066    }
14067    if let Some(ref apikey) = configuration.api_key {
14068        let key = apikey.key.clone();
14069        let value = match apikey.prefix {
14070            Some(ref prefix) => format!("{} {}", prefix, key),
14071            None => key,
14072        };
14073        req_builder = req_builder.header("Authorization", value);
14074    };
14075    req_builder = req_builder.json(&p_body_theme_search_request);
14076
14077    let req = req_builder.build()?;
14078    let resp = configuration.client.execute(req).await?;
14079
14080    let status = resp.status();
14081    let content_type = resp
14082        .headers()
14083        .get("content-type")
14084        .and_then(|v| v.to_str().ok())
14085        .unwrap_or("application/octet-stream");
14086    let content_type = super::ContentType::from(content_type);
14087
14088    if !status.is_client_error() && !status.is_server_error() {
14089        let content = resp.text().await?;
14090        match content_type {
14091            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14092            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeSearchResponse`"))),
14093            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`")))),
14094        }
14095    } else {
14096        let content = resp.text().await?;
14097        let entity: Option<SearchThemesWithIdError> = serde_json::from_str(&content).ok();
14098        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14099    }
14100}
14101
14102/// Searches user comments with the specified criteria and pagination.
14103pub async fn search_user_comments_with_id(configuration: &configuration::Configuration, user_comment_search_request: Option<models::UserCommentSearchRequest>) -> Result<models::UserCommentSearchResponse, Error<SearchUserCommentsWithIdError>> {
14104    // add a prefix to parameters to efficiently prevent name collisions
14105    let p_body_user_comment_search_request = user_comment_search_request;
14106
14107    let uri_str = format!("{}/api/user/comment/search", configuration.base_path);
14108    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14109
14110    if let Some(ref user_agent) = configuration.user_agent {
14111        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14112    }
14113    if let Some(ref apikey) = configuration.api_key {
14114        let key = apikey.key.clone();
14115        let value = match apikey.prefix {
14116            Some(ref prefix) => format!("{} {}", prefix, key),
14117            None => key,
14118        };
14119        req_builder = req_builder.header("Authorization", value);
14120    };
14121    req_builder = req_builder.json(&p_body_user_comment_search_request);
14122
14123    let req = req_builder.build()?;
14124    let resp = configuration.client.execute(req).await?;
14125
14126    let status = resp.status();
14127    let content_type = resp
14128        .headers()
14129        .get("content-type")
14130        .and_then(|v| v.to_str().ok())
14131        .unwrap_or("application/octet-stream");
14132    let content_type = super::ContentType::from(content_type);
14133
14134    if !status.is_client_error() && !status.is_server_error() {
14135        let content = resp.text().await?;
14136        match content_type {
14137            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14138            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentSearchResponse`"))),
14139            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`")))),
14140        }
14141    } else {
14142        let content = resp.text().await?;
14143        let entity: Option<SearchUserCommentsWithIdError> = serde_json::from_str(&content).ok();
14144        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14145    }
14146}
14147
14148/// Retrieves the users for the given Ids. If any Id is invalid, it is ignored.
14149pub async fn search_users_by_ids_with_id(configuration: &configuration::Configuration, ids: Option<&str>) -> Result<models::SearchResponse, Error<SearchUsersByIdsWithIdError>> {
14150    // add a prefix to parameters to efficiently prevent name collisions
14151    let p_query_ids = ids;
14152
14153    let uri_str = format!("{}/api/user/search", configuration.base_path);
14154    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
14155
14156    if let Some(ref param_value) = p_query_ids {
14157        req_builder = req_builder.query(&[("ids", &param_value.to_string())]);
14158    }
14159    if let Some(ref user_agent) = configuration.user_agent {
14160        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14161    }
14162    if let Some(ref apikey) = configuration.api_key {
14163        let key = apikey.key.clone();
14164        let value = match apikey.prefix {
14165            Some(ref prefix) => format!("{} {}", prefix, key),
14166            None => key,
14167        };
14168        req_builder = req_builder.header("Authorization", value);
14169    };
14170
14171    let req = req_builder.build()?;
14172    let resp = configuration.client.execute(req).await?;
14173
14174    let status = resp.status();
14175    let content_type = resp
14176        .headers()
14177        .get("content-type")
14178        .and_then(|v| v.to_str().ok())
14179        .unwrap_or("application/octet-stream");
14180    let content_type = super::ContentType::from(content_type);
14181
14182    if !status.is_client_error() && !status.is_server_error() {
14183        let content = resp.text().await?;
14184        match content_type {
14185            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14186            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResponse`"))),
14187            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`")))),
14188        }
14189    } else {
14190        let content = resp.text().await?;
14191        let entity: Option<SearchUsersByIdsWithIdError> = serde_json::from_str(&content).ok();
14192        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14193    }
14194}
14195
14196/// Retrieves the users for the given search criteria and pagination.
14197pub async fn search_users_by_query_with_id(configuration: &configuration::Configuration, search_request: Option<models::SearchRequest>) -> Result<models::SearchResponse, Error<SearchUsersByQueryWithIdError>> {
14198    // add a prefix to parameters to efficiently prevent name collisions
14199    let p_body_search_request = search_request;
14200
14201    let uri_str = format!("{}/api/user/search", configuration.base_path);
14202    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14203
14204    if let Some(ref user_agent) = configuration.user_agent {
14205        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14206    }
14207    if let Some(ref apikey) = configuration.api_key {
14208        let key = apikey.key.clone();
14209        let value = match apikey.prefix {
14210            Some(ref prefix) => format!("{} {}", prefix, key),
14211            None => key,
14212        };
14213        req_builder = req_builder.header("Authorization", value);
14214    };
14215    req_builder = req_builder.json(&p_body_search_request);
14216
14217    let req = req_builder.build()?;
14218    let resp = configuration.client.execute(req).await?;
14219
14220    let status = resp.status();
14221    let content_type = resp
14222        .headers()
14223        .get("content-type")
14224        .and_then(|v| v.to_str().ok())
14225        .unwrap_or("application/octet-stream");
14226    let content_type = super::ContentType::from(content_type);
14227
14228    if !status.is_client_error() && !status.is_server_error() {
14229        let content = resp.text().await?;
14230        match content_type {
14231            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14232            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResponse`"))),
14233            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`")))),
14234        }
14235    } else {
14236        let content = resp.text().await?;
14237        let entity: Option<SearchUsersByQueryWithIdError> = serde_json::from_str(&content).ok();
14238        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14239    }
14240}
14241
14242/// Searches the webhook event logs with the specified criteria and pagination.
14243pub async fn search_webhook_event_logs_with_id(configuration: &configuration::Configuration, webhook_event_log_search_request: Option<models::WebhookEventLogSearchRequest>) -> Result<models::WebhookEventLogSearchResponse, Error<SearchWebhookEventLogsWithIdError>> {
14244    // add a prefix to parameters to efficiently prevent name collisions
14245    let p_body_webhook_event_log_search_request = webhook_event_log_search_request;
14246
14247    let uri_str = format!("{}/api/system/webhook-event-log/search", configuration.base_path);
14248    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14249
14250    if let Some(ref user_agent) = configuration.user_agent {
14251        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14252    }
14253    if let Some(ref apikey) = configuration.api_key {
14254        let key = apikey.key.clone();
14255        let value = match apikey.prefix {
14256            Some(ref prefix) => format!("{} {}", prefix, key),
14257            None => key,
14258        };
14259        req_builder = req_builder.header("Authorization", value);
14260    };
14261    req_builder = req_builder.json(&p_body_webhook_event_log_search_request);
14262
14263    let req = req_builder.build()?;
14264    let resp = configuration.client.execute(req).await?;
14265
14266    let status = resp.status();
14267    let content_type = resp
14268        .headers()
14269        .get("content-type")
14270        .and_then(|v| v.to_str().ok())
14271        .unwrap_or("application/octet-stream");
14272    let content_type = super::ContentType::from(content_type);
14273
14274    if !status.is_client_error() && !status.is_server_error() {
14275        let content = resp.text().await?;
14276        match content_type {
14277            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14278            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookEventLogSearchResponse`"))),
14279            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`")))),
14280        }
14281    } else {
14282        let content = resp.text().await?;
14283        let entity: Option<SearchWebhookEventLogsWithIdError> = serde_json::from_str(&content).ok();
14284        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14285    }
14286}
14287
14288/// Searches webhooks with the specified criteria and pagination.
14289pub async fn search_webhooks_with_id(configuration: &configuration::Configuration, webhook_search_request: Option<models::WebhookSearchRequest>) -> Result<models::WebhookSearchResponse, Error<SearchWebhooksWithIdError>> {
14290    // add a prefix to parameters to efficiently prevent name collisions
14291    let p_body_webhook_search_request = webhook_search_request;
14292
14293    let uri_str = format!("{}/api/webhook/search", configuration.base_path);
14294    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14295
14296    if let Some(ref user_agent) = configuration.user_agent {
14297        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14298    }
14299    if let Some(ref apikey) = configuration.api_key {
14300        let key = apikey.key.clone();
14301        let value = match apikey.prefix {
14302            Some(ref prefix) => format!("{} {}", prefix, key),
14303            None => key,
14304        };
14305        req_builder = req_builder.header("Authorization", value);
14306    };
14307    req_builder = req_builder.json(&p_body_webhook_search_request);
14308
14309    let req = req_builder.build()?;
14310    let resp = configuration.client.execute(req).await?;
14311
14312    let status = resp.status();
14313    let content_type = resp
14314        .headers()
14315        .get("content-type")
14316        .and_then(|v| v.to_str().ok())
14317        .unwrap_or("application/octet-stream");
14318    let content_type = super::ContentType::from(content_type);
14319
14320    if !status.is_client_error() && !status.is_server_error() {
14321        let content = resp.text().await?;
14322        match content_type {
14323            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14324            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookSearchResponse`"))),
14325            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`")))),
14326        }
14327    } else {
14328        let content = resp.text().await?;
14329        let entity: Option<SearchWebhooksWithIdError> = serde_json::from_str(&content).ok();
14330        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14331    }
14332}
14333
14334/// Send an email using an email template Id. You can optionally provide <code>requestData</code> to access key value pairs in the email template.
14335pub async fn send_email_with_id(configuration: &configuration::Configuration, email_template_id: &str, send_request: Option<models::SendRequest>) -> Result<models::SendResponse, Error<SendEmailWithIdError>> {
14336    // add a prefix to parameters to efficiently prevent name collisions
14337    let p_path_email_template_id = email_template_id;
14338    let p_body_send_request = send_request;
14339
14340    let uri_str = format!("{}/api/email/send/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
14341    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14342
14343    if let Some(ref user_agent) = configuration.user_agent {
14344        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14345    }
14346    if let Some(ref apikey) = configuration.api_key {
14347        let key = apikey.key.clone();
14348        let value = match apikey.prefix {
14349            Some(ref prefix) => format!("{} {}", prefix, key),
14350            None => key,
14351        };
14352        req_builder = req_builder.header("Authorization", value);
14353    };
14354    req_builder = req_builder.json(&p_body_send_request);
14355
14356    let req = req_builder.build()?;
14357    let resp = configuration.client.execute(req).await?;
14358
14359    let status = resp.status();
14360    let content_type = resp
14361        .headers()
14362        .get("content-type")
14363        .and_then(|v| v.to_str().ok())
14364        .unwrap_or("application/octet-stream");
14365    let content_type = super::ContentType::from(content_type);
14366
14367    if !status.is_client_error() && !status.is_server_error() {
14368        let content = resp.text().await?;
14369        match content_type {
14370            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14371            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponse`"))),
14372            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`")))),
14373        }
14374    } else {
14375        let content = resp.text().await?;
14376        let entity: Option<SendEmailWithIdError> = serde_json::from_str(&content).ok();
14377        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14378    }
14379}
14380
14381/// 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.
14382pub async fn send_family_request_email_with_id(configuration: &configuration::Configuration, family_email_request: Option<models::FamilyEmailRequest>) -> Result<(), Error<SendFamilyRequestEmailWithIdError>> {
14383    // add a prefix to parameters to efficiently prevent name collisions
14384    let p_body_family_email_request = family_email_request;
14385
14386    let uri_str = format!("{}/api/user/family/request", configuration.base_path);
14387    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14388
14389    if let Some(ref user_agent) = configuration.user_agent {
14390        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14391    }
14392    if let Some(ref apikey) = configuration.api_key {
14393        let key = apikey.key.clone();
14394        let value = match apikey.prefix {
14395            Some(ref prefix) => format!("{} {}", prefix, key),
14396            None => key,
14397        };
14398        req_builder = req_builder.header("Authorization", value);
14399    };
14400    req_builder = req_builder.json(&p_body_family_email_request);
14401
14402    let req = req_builder.build()?;
14403    let resp = configuration.client.execute(req).await?;
14404
14405    let status = resp.status();
14406
14407    if !status.is_client_error() && !status.is_server_error() {
14408        Ok(())
14409    } else {
14410        let content = resp.text().await?;
14411        let entity: Option<SendFamilyRequestEmailWithIdError> = serde_json::from_str(&content).ok();
14412        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14413    }
14414}
14415
14416/// Send a passwordless authentication code in an email to complete login.
14417pub async fn send_passwordless_code_with_id(configuration: &configuration::Configuration, passwordless_send_request: Option<models::PasswordlessSendRequest>) -> Result<(), Error<SendPasswordlessCodeWithIdError>> {
14418    // add a prefix to parameters to efficiently prevent name collisions
14419    let p_body_passwordless_send_request = passwordless_send_request;
14420
14421    let uri_str = format!("{}/api/passwordless/send", configuration.base_path);
14422    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14423
14424    if let Some(ref user_agent) = configuration.user_agent {
14425        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14426    }
14427    if let Some(ref apikey) = configuration.api_key {
14428        let key = apikey.key.clone();
14429        let value = match apikey.prefix {
14430            Some(ref prefix) => format!("{} {}", prefix, key),
14431            None => key,
14432        };
14433        req_builder = req_builder.header("Authorization", value);
14434    };
14435    req_builder = req_builder.json(&p_body_passwordless_send_request);
14436
14437    let req = req_builder.build()?;
14438    let resp = configuration.client.execute(req).await?;
14439
14440    let status = resp.status();
14441
14442    if !status.is_client_error() && !status.is_server_error() {
14443        Ok(())
14444    } else {
14445        let content = resp.text().await?;
14446        let entity: Option<SendPasswordlessCodeWithIdError> = serde_json::from_str(&content).ok();
14447        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14448    }
14449}
14450
14451/// Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
14452pub async fn send_two_factor_code_for_enable_disable_with_id(configuration: &configuration::Configuration, two_factor_send_request: Option<models::TwoFactorSendRequest>) -> Result<(), Error<SendTwoFactorCodeForEnableDisableWithIdError>> {
14453    // add a prefix to parameters to efficiently prevent name collisions
14454    let p_body_two_factor_send_request = two_factor_send_request;
14455
14456    let uri_str = format!("{}/api/two-factor/send", configuration.base_path);
14457    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14458
14459    if let Some(ref user_agent) = configuration.user_agent {
14460        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14461    }
14462    if let Some(ref apikey) = configuration.api_key {
14463        let key = apikey.key.clone();
14464        let value = match apikey.prefix {
14465            Some(ref prefix) => format!("{} {}", prefix, key),
14466            None => key,
14467        };
14468        req_builder = req_builder.header("Authorization", value);
14469    };
14470    req_builder = req_builder.json(&p_body_two_factor_send_request);
14471
14472    let req = req_builder.build()?;
14473    let resp = configuration.client.execute(req).await?;
14474
14475    let status = resp.status();
14476
14477    if !status.is_client_error() && !status.is_server_error() {
14478        Ok(())
14479    } else {
14480        let content = resp.text().await?;
14481        let entity: Option<SendTwoFactorCodeForEnableDisableWithIdError> = serde_json::from_str(&content).ok();
14482        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14483    }
14484}
14485
14486/// Send a Two Factor authentication code to allow the completion of Two Factor authentication.
14487pub 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>> {
14488    // add a prefix to parameters to efficiently prevent name collisions
14489    let p_path_two_factor_id = two_factor_id;
14490    let p_body_two_factor_send_request = two_factor_send_request;
14491
14492    let uri_str = format!("{}/api/two-factor/send/{twoFactorId}", configuration.base_path, twoFactorId=crate::apis::urlencode(p_path_two_factor_id));
14493    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14494
14495    if let Some(ref user_agent) = configuration.user_agent {
14496        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14497    }
14498    if let Some(ref apikey) = configuration.api_key {
14499        let key = apikey.key.clone();
14500        let value = match apikey.prefix {
14501            Some(ref prefix) => format!("{} {}", prefix, key),
14502            None => key,
14503        };
14504        req_builder = req_builder.header("Authorization", value);
14505    };
14506    req_builder = req_builder.json(&p_body_two_factor_send_request);
14507
14508    let req = req_builder.build()?;
14509    let resp = configuration.client.execute(req).await?;
14510
14511    let status = resp.status();
14512
14513    if !status.is_client_error() && !status.is_server_error() {
14514        Ok(())
14515    } else {
14516        let content = resp.text().await?;
14517        let entity: Option<SendTwoFactorCodeForLoginUsingMethodWithIdError> = serde_json::from_str(&content).ok();
14518        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14519    }
14520}
14521
14522/// Send a verification code using the appropriate transport for the identity type being verified.
14523pub async fn send_verify_identity_with_id(configuration: &configuration::Configuration, verify_send_request: Option<models::VerifySendRequest>) -> Result<(), Error<SendVerifyIdentityWithIdError>> {
14524    // add a prefix to parameters to efficiently prevent name collisions
14525    let p_body_verify_send_request = verify_send_request;
14526
14527    let uri_str = format!("{}/api/identity/verify/send", configuration.base_path);
14528    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14529
14530    if let Some(ref user_agent) = configuration.user_agent {
14531        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14532    }
14533    if let Some(ref apikey) = configuration.api_key {
14534        let key = apikey.key.clone();
14535        let value = match apikey.prefix {
14536            Some(ref prefix) => format!("{} {}", prefix, key),
14537            None => key,
14538        };
14539        req_builder = req_builder.header("Authorization", value);
14540    };
14541    req_builder = req_builder.json(&p_body_verify_send_request);
14542
14543    let req = req_builder.build()?;
14544    let resp = configuration.client.execute(req).await?;
14545
14546    let status = resp.status();
14547
14548    if !status.is_client_error() && !status.is_server_error() {
14549        Ok(())
14550    } else {
14551        let content = resp.text().await?;
14552        let entity: Option<SendVerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
14553        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14554    }
14555}
14556
14557/// Begins a login request for a 3rd party login that requires user interaction such as HYPR.
14558pub async fn start_identity_provider_login_with_id(configuration: &configuration::Configuration, identity_provider_start_login_request: Option<models::IdentityProviderStartLoginRequest>) -> Result<models::IdentityProviderStartLoginResponse, Error<StartIdentityProviderLoginWithIdError>> {
14559    // add a prefix to parameters to efficiently prevent name collisions
14560    let p_body_identity_provider_start_login_request = identity_provider_start_login_request;
14561
14562    let uri_str = format!("{}/api/identity-provider/start", configuration.base_path);
14563    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14564
14565    if let Some(ref user_agent) = configuration.user_agent {
14566        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14567    }
14568    if let Some(ref apikey) = configuration.api_key {
14569        let key = apikey.key.clone();
14570        let value = match apikey.prefix {
14571            Some(ref prefix) => format!("{} {}", prefix, key),
14572            None => key,
14573        };
14574        req_builder = req_builder.header("Authorization", value);
14575    };
14576    req_builder = req_builder.json(&p_body_identity_provider_start_login_request);
14577
14578    let req = req_builder.build()?;
14579    let resp = configuration.client.execute(req).await?;
14580
14581    let status = resp.status();
14582    let content_type = resp
14583        .headers()
14584        .get("content-type")
14585        .and_then(|v| v.to_str().ok())
14586        .unwrap_or("application/octet-stream");
14587    let content_type = super::ContentType::from(content_type);
14588
14589    if !status.is_client_error() && !status.is_server_error() {
14590        let content = resp.text().await?;
14591        match content_type {
14592            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14593            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderStartLoginResponse`"))),
14594            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`")))),
14595        }
14596    } else {
14597        let content = resp.text().await?;
14598        let entity: Option<StartIdentityProviderLoginWithIdError> = serde_json::from_str(&content).ok();
14599        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14600    }
14601}
14602
14603/// 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.
14604pub async fn start_passwordless_login_with_id(configuration: &configuration::Configuration, passwordless_start_request: Option<models::PasswordlessStartRequest>) -> Result<models::PasswordlessStartResponse, Error<StartPasswordlessLoginWithIdError>> {
14605    // add a prefix to parameters to efficiently prevent name collisions
14606    let p_body_passwordless_start_request = passwordless_start_request;
14607
14608    let uri_str = format!("{}/api/passwordless/start", configuration.base_path);
14609    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14610
14611    if let Some(ref user_agent) = configuration.user_agent {
14612        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14613    }
14614    if let Some(ref apikey) = configuration.api_key {
14615        let key = apikey.key.clone();
14616        let value = match apikey.prefix {
14617            Some(ref prefix) => format!("{} {}", prefix, key),
14618            None => key,
14619        };
14620        req_builder = req_builder.header("Authorization", value);
14621    };
14622    req_builder = req_builder.json(&p_body_passwordless_start_request);
14623
14624    let req = req_builder.build()?;
14625    let resp = configuration.client.execute(req).await?;
14626
14627    let status = resp.status();
14628    let content_type = resp
14629        .headers()
14630        .get("content-type")
14631        .and_then(|v| v.to_str().ok())
14632        .unwrap_or("application/octet-stream");
14633    let content_type = super::ContentType::from(content_type);
14634
14635    if !status.is_client_error() && !status.is_server_error() {
14636        let content = resp.text().await?;
14637        match content_type {
14638            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14639            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordlessStartResponse`"))),
14640            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`")))),
14641        }
14642    } else {
14643        let content = resp.text().await?;
14644        let entity: Option<StartPasswordlessLoginWithIdError> = serde_json::from_str(&content).ok();
14645        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14646    }
14647}
14648
14649/// 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).
14650pub async fn start_two_factor_login_with_id(configuration: &configuration::Configuration, two_factor_start_request: Option<models::TwoFactorStartRequest>) -> Result<models::TwoFactorStartResponse, Error<StartTwoFactorLoginWithIdError>> {
14651    // add a prefix to parameters to efficiently prevent name collisions
14652    let p_body_two_factor_start_request = two_factor_start_request;
14653
14654    let uri_str = format!("{}/api/two-factor/start", configuration.base_path);
14655    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14656
14657    if let Some(ref user_agent) = configuration.user_agent {
14658        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14659    }
14660    if let Some(ref apikey) = configuration.api_key {
14661        let key = apikey.key.clone();
14662        let value = match apikey.prefix {
14663            Some(ref prefix) => format!("{} {}", prefix, key),
14664            None => key,
14665        };
14666        req_builder = req_builder.header("Authorization", value);
14667    };
14668    req_builder = req_builder.json(&p_body_two_factor_start_request);
14669
14670    let req = req_builder.build()?;
14671    let resp = configuration.client.execute(req).await?;
14672
14673    let status = resp.status();
14674    let content_type = resp
14675        .headers()
14676        .get("content-type")
14677        .and_then(|v| v.to_str().ok())
14678        .unwrap_or("application/octet-stream");
14679    let content_type = super::ContentType::from(content_type);
14680
14681    if !status.is_client_error() && !status.is_server_error() {
14682        let content = resp.text().await?;
14683        match content_type {
14684            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14685            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStartResponse`"))),
14686            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`")))),
14687        }
14688    } else {
14689        let content = resp.text().await?;
14690        let entity: Option<StartTwoFactorLoginWithIdError> = serde_json::from_str(&content).ok();
14691        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14692    }
14693}
14694
14695/// Start a verification of an identity by generating a code. This code can be sent to the User using the Verify Send API Verification Code API or using a mechanism outside of FusionAuth. The verification is completed by using the Verify Complete API with this code.
14696pub async fn start_verify_identity_with_id(configuration: &configuration::Configuration, verify_start_request: Option<models::VerifyStartRequest>) -> Result<models::VerifyStartResponse, Error<StartVerifyIdentityWithIdError>> {
14697    // add a prefix to parameters to efficiently prevent name collisions
14698    let p_body_verify_start_request = verify_start_request;
14699
14700    let uri_str = format!("{}/api/identity/verify/start", configuration.base_path);
14701    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14702
14703    if let Some(ref user_agent) = configuration.user_agent {
14704        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14705    }
14706    if let Some(ref apikey) = configuration.api_key {
14707        let key = apikey.key.clone();
14708        let value = match apikey.prefix {
14709            Some(ref prefix) => format!("{} {}", prefix, key),
14710            None => key,
14711        };
14712        req_builder = req_builder.header("Authorization", value);
14713    };
14714    req_builder = req_builder.json(&p_body_verify_start_request);
14715
14716    let req = req_builder.build()?;
14717    let resp = configuration.client.execute(req).await?;
14718
14719    let status = resp.status();
14720    let content_type = resp
14721        .headers()
14722        .get("content-type")
14723        .and_then(|v| v.to_str().ok())
14724        .unwrap_or("application/octet-stream");
14725    let content_type = super::ContentType::from(content_type);
14726
14727    if !status.is_client_error() && !status.is_server_error() {
14728        let content = resp.text().await?;
14729        match content_type {
14730            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14731            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyStartResponse`"))),
14732            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::VerifyStartResponse`")))),
14733        }
14734    } else {
14735        let content = resp.text().await?;
14736        let entity: Option<StartVerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
14737        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14738    }
14739}
14740
14741/// Start a WebAuthn authentication ceremony by generating a new challenge for the user
14742pub async fn start_web_authn_login_with_id(configuration: &configuration::Configuration, web_authn_start_request: Option<models::WebAuthnStartRequest>) -> Result<models::WebAuthnStartResponse, Error<StartWebAuthnLoginWithIdError>> {
14743    // add a prefix to parameters to efficiently prevent name collisions
14744    let p_body_web_authn_start_request = web_authn_start_request;
14745
14746    let uri_str = format!("{}/api/webauthn/start", configuration.base_path);
14747    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14748
14749    if let Some(ref user_agent) = configuration.user_agent {
14750        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14751    }
14752    if let Some(ref apikey) = configuration.api_key {
14753        let key = apikey.key.clone();
14754        let value = match apikey.prefix {
14755            Some(ref prefix) => format!("{} {}", prefix, key),
14756            None => key,
14757        };
14758        req_builder = req_builder.header("Authorization", value);
14759    };
14760    req_builder = req_builder.json(&p_body_web_authn_start_request);
14761
14762    let req = req_builder.build()?;
14763    let resp = configuration.client.execute(req).await?;
14764
14765    let status = resp.status();
14766    let content_type = resp
14767        .headers()
14768        .get("content-type")
14769        .and_then(|v| v.to_str().ok())
14770        .unwrap_or("application/octet-stream");
14771    let content_type = super::ContentType::from(content_type);
14772
14773    if !status.is_client_error() && !status.is_server_error() {
14774        let content = resp.text().await?;
14775        match content_type {
14776            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14777            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnStartResponse`"))),
14778            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`")))),
14779        }
14780    } else {
14781        let content = resp.text().await?;
14782        let entity: Option<StartWebAuthnLoginWithIdError> = serde_json::from_str(&content).ok();
14783        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14784    }
14785}
14786
14787/// Start a WebAuthn registration ceremony by generating a new challenge for the user
14788pub async fn start_web_authn_registration_with_id(configuration: &configuration::Configuration, web_authn_register_start_request: Option<models::WebAuthnRegisterStartRequest>) -> Result<models::WebAuthnRegisterStartResponse, Error<StartWebAuthnRegistrationWithIdError>> {
14789    // add a prefix to parameters to efficiently prevent name collisions
14790    let p_body_web_authn_register_start_request = web_authn_register_start_request;
14791
14792    let uri_str = format!("{}/api/webauthn/register/start", configuration.base_path);
14793    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14794
14795    if let Some(ref user_agent) = configuration.user_agent {
14796        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14797    }
14798    if let Some(ref apikey) = configuration.api_key {
14799        let key = apikey.key.clone();
14800        let value = match apikey.prefix {
14801            Some(ref prefix) => format!("{} {}", prefix, key),
14802            None => key,
14803        };
14804        req_builder = req_builder.header("Authorization", value);
14805    };
14806    req_builder = req_builder.json(&p_body_web_authn_register_start_request);
14807
14808    let req = req_builder.build()?;
14809    let resp = configuration.client.execute(req).await?;
14810
14811    let status = resp.status();
14812    let content_type = resp
14813        .headers()
14814        .get("content-type")
14815        .and_then(|v| v.to_str().ok())
14816        .unwrap_or("application/octet-stream");
14817    let content_type = super::ContentType::from(content_type);
14818
14819    if !status.is_client_error() && !status.is_server_error() {
14820        let content = resp.text().await?;
14821        match content_type {
14822            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14823            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnRegisterStartResponse`"))),
14824            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`")))),
14825        }
14826    } else {
14827        let content = resp.text().await?;
14828        let entity: Option<StartWebAuthnRegistrationWithIdError> = serde_json::from_str(&content).ok();
14829        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14830    }
14831}
14832
14833/// Complete login using a 2FA challenge
14834pub async fn two_factor_login_with_id(configuration: &configuration::Configuration, two_factor_login_request: Option<models::TwoFactorLoginRequest>) -> Result<models::LoginResponse, Error<TwoFactorLoginWithIdError>> {
14835    // add a prefix to parameters to efficiently prevent name collisions
14836    let p_body_two_factor_login_request = two_factor_login_request;
14837
14838    let uri_str = format!("{}/api/two-factor/login", configuration.base_path);
14839    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14840
14841    if let Some(ref user_agent) = configuration.user_agent {
14842        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14843    }
14844    if let Some(ref apikey) = configuration.api_key {
14845        let key = apikey.key.clone();
14846        let value = match apikey.prefix {
14847            Some(ref prefix) => format!("{} {}", prefix, key),
14848            None => key,
14849        };
14850        req_builder = req_builder.header("Authorization", value);
14851    };
14852    req_builder = req_builder.json(&p_body_two_factor_login_request);
14853
14854    let req = req_builder.build()?;
14855    let resp = configuration.client.execute(req).await?;
14856
14857    let status = resp.status();
14858    let content_type = resp
14859        .headers()
14860        .get("content-type")
14861        .and_then(|v| v.to_str().ok())
14862        .unwrap_or("application/octet-stream");
14863    let content_type = super::ContentType::from(content_type);
14864
14865    if !status.is_client_error() && !status.is_server_error() {
14866        let content = resp.text().await?;
14867        match content_type {
14868            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14869            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
14870            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`")))),
14871        }
14872    } else {
14873        let content = resp.text().await?;
14874        let entity: Option<TwoFactorLoginWithIdError> = serde_json::from_str(&content).ok();
14875        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14876    }
14877}
14878
14879/// Updates an API key with the given Id.
14880pub async fn update_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<UpdateApiKeyWithIdError>> {
14881    // add a prefix to parameters to efficiently prevent name collisions
14882    let p_path_key_id = key_id;
14883    let p_body_api_key_request = api_key_request;
14884
14885    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
14886    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14887
14888    if let Some(ref user_agent) = configuration.user_agent {
14889        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14890    }
14891    if let Some(ref apikey) = configuration.api_key {
14892        let key = apikey.key.clone();
14893        let value = match apikey.prefix {
14894            Some(ref prefix) => format!("{} {}", prefix, key),
14895            None => key,
14896        };
14897        req_builder = req_builder.header("Authorization", value);
14898    };
14899    req_builder = req_builder.json(&p_body_api_key_request);
14900
14901    let req = req_builder.build()?;
14902    let resp = configuration.client.execute(req).await?;
14903
14904    let status = resp.status();
14905    let content_type = resp
14906        .headers()
14907        .get("content-type")
14908        .and_then(|v| v.to_str().ok())
14909        .unwrap_or("application/octet-stream");
14910    let content_type = super::ContentType::from(content_type);
14911
14912    if !status.is_client_error() && !status.is_server_error() {
14913        let content = resp.text().await?;
14914        match content_type {
14915            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14916            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
14917            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`")))),
14918        }
14919    } else {
14920        let content = resp.text().await?;
14921        let entity: Option<UpdateApiKeyWithIdError> = serde_json::from_str(&content).ok();
14922        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14923    }
14924}
14925
14926/// Updates the application role with the given Id for the application.
14927pub 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>> {
14928    // add a prefix to parameters to efficiently prevent name collisions
14929    let p_path_application_id = application_id;
14930    let p_path_role_id = role_id;
14931    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
14932    let p_body_application_request = application_request;
14933
14934    let uri_str = format!("{}/api/application/{applicationId}/role/{roleId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), roleId=crate::apis::urlencode(p_path_role_id));
14935    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14936
14937    if let Some(ref user_agent) = configuration.user_agent {
14938        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14939    }
14940    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
14941        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
14942    }
14943    if let Some(ref apikey) = configuration.api_key {
14944        let key = apikey.key.clone();
14945        let value = match apikey.prefix {
14946            Some(ref prefix) => format!("{} {}", prefix, key),
14947            None => key,
14948        };
14949        req_builder = req_builder.header("Authorization", value);
14950    };
14951    req_builder = req_builder.json(&p_body_application_request);
14952
14953    let req = req_builder.build()?;
14954    let resp = configuration.client.execute(req).await?;
14955
14956    let status = resp.status();
14957    let content_type = resp
14958        .headers()
14959        .get("content-type")
14960        .and_then(|v| v.to_str().ok())
14961        .unwrap_or("application/octet-stream");
14962    let content_type = super::ContentType::from(content_type);
14963
14964    if !status.is_client_error() && !status.is_server_error() {
14965        let content = resp.text().await?;
14966        match content_type {
14967            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14968            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
14969            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`")))),
14970        }
14971    } else {
14972        let content = resp.text().await?;
14973        let entity: Option<UpdateApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
14974        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14975    }
14976}
14977
14978/// Updates the application with the given Id. OR Reactivates the application with the given Id.
14979pub 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>> {
14980    // add a prefix to parameters to efficiently prevent name collisions
14981    let p_path_application_id = application_id;
14982    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
14983    let p_query_reactivate = reactivate;
14984    let p_body_application_request = application_request;
14985
14986    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
14987    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
14988
14989    if let Some(ref param_value) = p_query_reactivate {
14990        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
14991    }
14992    if let Some(ref user_agent) = configuration.user_agent {
14993        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14994    }
14995    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
14996        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
14997    }
14998    if let Some(ref apikey) = configuration.api_key {
14999        let key = apikey.key.clone();
15000        let value = match apikey.prefix {
15001            Some(ref prefix) => format!("{} {}", prefix, key),
15002            None => key,
15003        };
15004        req_builder = req_builder.header("Authorization", value);
15005    };
15006    req_builder = req_builder.json(&p_body_application_request);
15007
15008    let req = req_builder.build()?;
15009    let resp = configuration.client.execute(req).await?;
15010
15011    let status = resp.status();
15012    let content_type = resp
15013        .headers()
15014        .get("content-type")
15015        .and_then(|v| v.to_str().ok())
15016        .unwrap_or("application/octet-stream");
15017    let content_type = super::ContentType::from(content_type);
15018
15019    if !status.is_client_error() && !status.is_server_error() {
15020        let content = resp.text().await?;
15021        match content_type {
15022            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15023            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
15024            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`")))),
15025        }
15026    } else {
15027        let content = resp.text().await?;
15028        let entity: Option<UpdateApplicationWithIdError> = serde_json::from_str(&content).ok();
15029        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15030    }
15031}
15032
15033/// Updates the connector with the given Id.
15034pub async fn update_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<UpdateConnectorWithIdError>> {
15035    // add a prefix to parameters to efficiently prevent name collisions
15036    let p_path_connector_id = connector_id;
15037    let p_body_connector_request = connector_request;
15038
15039    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
15040    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15041
15042    if let Some(ref user_agent) = configuration.user_agent {
15043        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15044    }
15045    if let Some(ref apikey) = configuration.api_key {
15046        let key = apikey.key.clone();
15047        let value = match apikey.prefix {
15048            Some(ref prefix) => format!("{} {}", prefix, key),
15049            None => key,
15050        };
15051        req_builder = req_builder.header("Authorization", value);
15052    };
15053    req_builder = req_builder.json(&p_body_connector_request);
15054
15055    let req = req_builder.build()?;
15056    let resp = configuration.client.execute(req).await?;
15057
15058    let status = resp.status();
15059    let content_type = resp
15060        .headers()
15061        .get("content-type")
15062        .and_then(|v| v.to_str().ok())
15063        .unwrap_or("application/octet-stream");
15064    let content_type = super::ContentType::from(content_type);
15065
15066    if !status.is_client_error() && !status.is_server_error() {
15067        let content = resp.text().await?;
15068        match content_type {
15069            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15070            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
15071            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`")))),
15072        }
15073    } else {
15074        let content = resp.text().await?;
15075        let entity: Option<UpdateConnectorWithIdError> = serde_json::from_str(&content).ok();
15076        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15077    }
15078}
15079
15080/// Updates the consent with the given Id.
15081pub 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>> {
15082    // add a prefix to parameters to efficiently prevent name collisions
15083    let p_path_consent_id = consent_id;
15084    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15085    let p_body_consent_request = consent_request;
15086
15087    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
15088    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15089
15090    if let Some(ref user_agent) = configuration.user_agent {
15091        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15092    }
15093    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15094        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15095    }
15096    if let Some(ref apikey) = configuration.api_key {
15097        let key = apikey.key.clone();
15098        let value = match apikey.prefix {
15099            Some(ref prefix) => format!("{} {}", prefix, key),
15100            None => key,
15101        };
15102        req_builder = req_builder.header("Authorization", value);
15103    };
15104    req_builder = req_builder.json(&p_body_consent_request);
15105
15106    let req = req_builder.build()?;
15107    let resp = configuration.client.execute(req).await?;
15108
15109    let status = resp.status();
15110    let content_type = resp
15111        .headers()
15112        .get("content-type")
15113        .and_then(|v| v.to_str().ok())
15114        .unwrap_or("application/octet-stream");
15115    let content_type = super::ContentType::from(content_type);
15116
15117    if !status.is_client_error() && !status.is_server_error() {
15118        let content = resp.text().await?;
15119        match content_type {
15120            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15121            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
15122            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`")))),
15123        }
15124    } else {
15125        let content = resp.text().await?;
15126        let entity: Option<UpdateConsentWithIdError> = serde_json::from_str(&content).ok();
15127        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15128    }
15129}
15130
15131/// Updates the email template with the given Id.
15132pub 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>> {
15133    // add a prefix to parameters to efficiently prevent name collisions
15134    let p_path_email_template_id = email_template_id;
15135    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15136    let p_body_email_template_request = email_template_request;
15137
15138    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
15139    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15140
15141    if let Some(ref user_agent) = configuration.user_agent {
15142        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15143    }
15144    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15145        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15146    }
15147    if let Some(ref apikey) = configuration.api_key {
15148        let key = apikey.key.clone();
15149        let value = match apikey.prefix {
15150            Some(ref prefix) => format!("{} {}", prefix, key),
15151            None => key,
15152        };
15153        req_builder = req_builder.header("Authorization", value);
15154    };
15155    req_builder = req_builder.json(&p_body_email_template_request);
15156
15157    let req = req_builder.build()?;
15158    let resp = configuration.client.execute(req).await?;
15159
15160    let status = resp.status();
15161    let content_type = resp
15162        .headers()
15163        .get("content-type")
15164        .and_then(|v| v.to_str().ok())
15165        .unwrap_or("application/octet-stream");
15166    let content_type = super::ContentType::from(content_type);
15167
15168    if !status.is_client_error() && !status.is_server_error() {
15169        let content = resp.text().await?;
15170        match content_type {
15171            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15172            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
15173            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`")))),
15174        }
15175    } else {
15176        let content = resp.text().await?;
15177        let entity: Option<UpdateEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
15178        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15179    }
15180}
15181
15182/// Updates the permission with the given Id for the entity type.
15183pub 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>> {
15184    // add a prefix to parameters to efficiently prevent name collisions
15185    let p_path_entity_type_id = entity_type_id;
15186    let p_path_permission_id = permission_id;
15187    let p_body_entity_type_request = entity_type_request;
15188
15189    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission/{permissionId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id), permissionId=crate::apis::urlencode(p_path_permission_id));
15190    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15191
15192    if let Some(ref user_agent) = configuration.user_agent {
15193        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15194    }
15195    if let Some(ref apikey) = configuration.api_key {
15196        let key = apikey.key.clone();
15197        let value = match apikey.prefix {
15198            Some(ref prefix) => format!("{} {}", prefix, key),
15199            None => key,
15200        };
15201        req_builder = req_builder.header("Authorization", value);
15202    };
15203    req_builder = req_builder.json(&p_body_entity_type_request);
15204
15205    let req = req_builder.build()?;
15206    let resp = configuration.client.execute(req).await?;
15207
15208    let status = resp.status();
15209    let content_type = resp
15210        .headers()
15211        .get("content-type")
15212        .and_then(|v| v.to_str().ok())
15213        .unwrap_or("application/octet-stream");
15214    let content_type = super::ContentType::from(content_type);
15215
15216    if !status.is_client_error() && !status.is_server_error() {
15217        let content = resp.text().await?;
15218        match content_type {
15219            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15220            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
15221            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`")))),
15222        }
15223    } else {
15224        let content = resp.text().await?;
15225        let entity: Option<UpdateEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
15226        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15227    }
15228}
15229
15230/// Updates the Entity Type with the given Id.
15231pub 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>> {
15232    // add a prefix to parameters to efficiently prevent name collisions
15233    let p_path_entity_type_id = entity_type_id;
15234    let p_body_entity_type_request = entity_type_request;
15235
15236    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
15237    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15238
15239    if let Some(ref user_agent) = configuration.user_agent {
15240        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15241    }
15242    if let Some(ref apikey) = configuration.api_key {
15243        let key = apikey.key.clone();
15244        let value = match apikey.prefix {
15245            Some(ref prefix) => format!("{} {}", prefix, key),
15246            None => key,
15247        };
15248        req_builder = req_builder.header("Authorization", value);
15249    };
15250    req_builder = req_builder.json(&p_body_entity_type_request);
15251
15252    let req = req_builder.build()?;
15253    let resp = configuration.client.execute(req).await?;
15254
15255    let status = resp.status();
15256    let content_type = resp
15257        .headers()
15258        .get("content-type")
15259        .and_then(|v| v.to_str().ok())
15260        .unwrap_or("application/octet-stream");
15261    let content_type = super::ContentType::from(content_type);
15262
15263    if !status.is_client_error() && !status.is_server_error() {
15264        let content = resp.text().await?;
15265        match content_type {
15266            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15267            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
15268            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`")))),
15269        }
15270    } else {
15271        let content = resp.text().await?;
15272        let entity: Option<UpdateEntityTypeWithIdError> = serde_json::from_str(&content).ok();
15273        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15274    }
15275}
15276
15277/// Updates the Entity with the given Id.
15278pub 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>> {
15279    // add a prefix to parameters to efficiently prevent name collisions
15280    let p_path_entity_id = entity_id;
15281    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15282    let p_body_entity_request = entity_request;
15283
15284    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
15285    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15286
15287    if let Some(ref user_agent) = configuration.user_agent {
15288        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15289    }
15290    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15291        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15292    }
15293    if let Some(ref apikey) = configuration.api_key {
15294        let key = apikey.key.clone();
15295        let value = match apikey.prefix {
15296            Some(ref prefix) => format!("{} {}", prefix, key),
15297            None => key,
15298        };
15299        req_builder = req_builder.header("Authorization", value);
15300    };
15301    req_builder = req_builder.json(&p_body_entity_request);
15302
15303    let req = req_builder.build()?;
15304    let resp = configuration.client.execute(req).await?;
15305
15306    let status = resp.status();
15307    let content_type = resp
15308        .headers()
15309        .get("content-type")
15310        .and_then(|v| v.to_str().ok())
15311        .unwrap_or("application/octet-stream");
15312    let content_type = super::ContentType::from(content_type);
15313
15314    if !status.is_client_error() && !status.is_server_error() {
15315        let content = resp.text().await?;
15316        match content_type {
15317            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15318            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
15319            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`")))),
15320        }
15321    } else {
15322        let content = resp.text().await?;
15323        let entity: Option<UpdateEntityWithIdError> = serde_json::from_str(&content).ok();
15324        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15325    }
15326}
15327
15328/// Updates the form field with the given Id.
15329pub async fn update_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<UpdateFormFieldWithIdError>> {
15330    // add a prefix to parameters to efficiently prevent name collisions
15331    let p_path_field_id = field_id;
15332    let p_body_form_field_request = form_field_request;
15333
15334    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
15335    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15336
15337    if let Some(ref user_agent) = configuration.user_agent {
15338        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15339    }
15340    if let Some(ref apikey) = configuration.api_key {
15341        let key = apikey.key.clone();
15342        let value = match apikey.prefix {
15343            Some(ref prefix) => format!("{} {}", prefix, key),
15344            None => key,
15345        };
15346        req_builder = req_builder.header("Authorization", value);
15347    };
15348    req_builder = req_builder.json(&p_body_form_field_request);
15349
15350    let req = req_builder.build()?;
15351    let resp = configuration.client.execute(req).await?;
15352
15353    let status = resp.status();
15354    let content_type = resp
15355        .headers()
15356        .get("content-type")
15357        .and_then(|v| v.to_str().ok())
15358        .unwrap_or("application/octet-stream");
15359    let content_type = super::ContentType::from(content_type);
15360
15361    if !status.is_client_error() && !status.is_server_error() {
15362        let content = resp.text().await?;
15363        match content_type {
15364            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15365            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
15366            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`")))),
15367        }
15368    } else {
15369        let content = resp.text().await?;
15370        let entity: Option<UpdateFormFieldWithIdError> = serde_json::from_str(&content).ok();
15371        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15372    }
15373}
15374
15375/// Updates the form with the given Id.
15376pub async fn update_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<UpdateFormWithIdError>> {
15377    // add a prefix to parameters to efficiently prevent name collisions
15378    let p_path_form_id = form_id;
15379    let p_body_form_request = form_request;
15380
15381    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
15382    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15383
15384    if let Some(ref user_agent) = configuration.user_agent {
15385        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15386    }
15387    if let Some(ref apikey) = configuration.api_key {
15388        let key = apikey.key.clone();
15389        let value = match apikey.prefix {
15390            Some(ref prefix) => format!("{} {}", prefix, key),
15391            None => key,
15392        };
15393        req_builder = req_builder.header("Authorization", value);
15394    };
15395    req_builder = req_builder.json(&p_body_form_request);
15396
15397    let req = req_builder.build()?;
15398    let resp = configuration.client.execute(req).await?;
15399
15400    let status = resp.status();
15401    let content_type = resp
15402        .headers()
15403        .get("content-type")
15404        .and_then(|v| v.to_str().ok())
15405        .unwrap_or("application/octet-stream");
15406    let content_type = super::ContentType::from(content_type);
15407
15408    if !status.is_client_error() && !status.is_server_error() {
15409        let content = resp.text().await?;
15410        match content_type {
15411            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15412            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
15413            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`")))),
15414        }
15415    } else {
15416        let content = resp.text().await?;
15417        let entity: Option<UpdateFormWithIdError> = serde_json::from_str(&content).ok();
15418        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15419    }
15420}
15421
15422/// Creates a member in a group.
15423pub async fn update_group_members_with_id(configuration: &configuration::Configuration, member_request: Option<models::MemberRequest>) -> Result<models::MemberResponse, Error<UpdateGroupMembersWithIdError>> {
15424    // add a prefix to parameters to efficiently prevent name collisions
15425    let p_body_member_request = member_request;
15426
15427    let uri_str = format!("{}/api/group/member", configuration.base_path);
15428    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15429
15430    if let Some(ref user_agent) = configuration.user_agent {
15431        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15432    }
15433    if let Some(ref apikey) = configuration.api_key {
15434        let key = apikey.key.clone();
15435        let value = match apikey.prefix {
15436            Some(ref prefix) => format!("{} {}", prefix, key),
15437            None => key,
15438        };
15439        req_builder = req_builder.header("Authorization", value);
15440    };
15441    req_builder = req_builder.json(&p_body_member_request);
15442
15443    let req = req_builder.build()?;
15444    let resp = configuration.client.execute(req).await?;
15445
15446    let status = resp.status();
15447    let content_type = resp
15448        .headers()
15449        .get("content-type")
15450        .and_then(|v| v.to_str().ok())
15451        .unwrap_or("application/octet-stream");
15452    let content_type = super::ContentType::from(content_type);
15453
15454    if !status.is_client_error() && !status.is_server_error() {
15455        let content = resp.text().await?;
15456        match content_type {
15457            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15458            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MemberResponse`"))),
15459            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`")))),
15460        }
15461    } else {
15462        let content = resp.text().await?;
15463        let entity: Option<UpdateGroupMembersWithIdError> = serde_json::from_str(&content).ok();
15464        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15465    }
15466}
15467
15468/// Updates the group with the given Id.
15469pub 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>> {
15470    // add a prefix to parameters to efficiently prevent name collisions
15471    let p_path_group_id = group_id;
15472    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15473    let p_body_group_request = group_request;
15474
15475    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
15476    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15477
15478    if let Some(ref user_agent) = configuration.user_agent {
15479        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15480    }
15481    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15482        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15483    }
15484    if let Some(ref apikey) = configuration.api_key {
15485        let key = apikey.key.clone();
15486        let value = match apikey.prefix {
15487            Some(ref prefix) => format!("{} {}", prefix, key),
15488            None => key,
15489        };
15490        req_builder = req_builder.header("Authorization", value);
15491    };
15492    req_builder = req_builder.json(&p_body_group_request);
15493
15494    let req = req_builder.build()?;
15495    let resp = configuration.client.execute(req).await?;
15496
15497    let status = resp.status();
15498    let content_type = resp
15499        .headers()
15500        .get("content-type")
15501        .and_then(|v| v.to_str().ok())
15502        .unwrap_or("application/octet-stream");
15503    let content_type = super::ContentType::from(content_type);
15504
15505    if !status.is_client_error() && !status.is_server_error() {
15506        let content = resp.text().await?;
15507        match content_type {
15508            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15509            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
15510            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`")))),
15511        }
15512    } else {
15513        let content = resp.text().await?;
15514        let entity: Option<UpdateGroupWithIdError> = serde_json::from_str(&content).ok();
15515        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15516    }
15517}
15518
15519/// Updates the identity provider with the given Id.
15520pub 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>> {
15521    // add a prefix to parameters to efficiently prevent name collisions
15522    let p_path_identity_provider_id = identity_provider_id;
15523    let p_body_identity_provider_request = identity_provider_request;
15524
15525    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
15526    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15527
15528    if let Some(ref user_agent) = configuration.user_agent {
15529        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15530    }
15531    if let Some(ref apikey) = configuration.api_key {
15532        let key = apikey.key.clone();
15533        let value = match apikey.prefix {
15534            Some(ref prefix) => format!("{} {}", prefix, key),
15535            None => key,
15536        };
15537        req_builder = req_builder.header("Authorization", value);
15538    };
15539    req_builder = req_builder.json(&p_body_identity_provider_request);
15540
15541    let req = req_builder.build()?;
15542    let resp = configuration.client.execute(req).await?;
15543
15544    let status = resp.status();
15545    let content_type = resp
15546        .headers()
15547        .get("content-type")
15548        .and_then(|v| v.to_str().ok())
15549        .unwrap_or("application/octet-stream");
15550    let content_type = super::ContentType::from(content_type);
15551
15552    if !status.is_client_error() && !status.is_server_error() {
15553        let content = resp.text().await?;
15554        match content_type {
15555            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15556            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
15557            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`")))),
15558        }
15559    } else {
15560        let content = resp.text().await?;
15561        let entity: Option<UpdateIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
15562        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15563    }
15564}
15565
15566/// Updates the available integrations.
15567pub async fn update_integrations_with_id(configuration: &configuration::Configuration, integration_request: Option<models::IntegrationRequest>) -> Result<models::IntegrationResponse, Error<UpdateIntegrationsWithIdError>> {
15568    // add a prefix to parameters to efficiently prevent name collisions
15569    let p_body_integration_request = integration_request;
15570
15571    let uri_str = format!("{}/api/integration", configuration.base_path);
15572    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15573
15574    if let Some(ref user_agent) = configuration.user_agent {
15575        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15576    }
15577    if let Some(ref apikey) = configuration.api_key {
15578        let key = apikey.key.clone();
15579        let value = match apikey.prefix {
15580            Some(ref prefix) => format!("{} {}", prefix, key),
15581            None => key,
15582        };
15583        req_builder = req_builder.header("Authorization", value);
15584    };
15585    req_builder = req_builder.json(&p_body_integration_request);
15586
15587    let req = req_builder.build()?;
15588    let resp = configuration.client.execute(req).await?;
15589
15590    let status = resp.status();
15591    let content_type = resp
15592        .headers()
15593        .get("content-type")
15594        .and_then(|v| v.to_str().ok())
15595        .unwrap_or("application/octet-stream");
15596    let content_type = super::ContentType::from(content_type);
15597
15598    if !status.is_client_error() && !status.is_server_error() {
15599        let content = resp.text().await?;
15600        match content_type {
15601            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15602            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationResponse`"))),
15603            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`")))),
15604        }
15605    } else {
15606        let content = resp.text().await?;
15607        let entity: Option<UpdateIntegrationsWithIdError> = serde_json::from_str(&content).ok();
15608        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15609    }
15610}
15611
15612/// Updates the IP Access Control List with the given Id.
15613pub 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>> {
15614    // add a prefix to parameters to efficiently prevent name collisions
15615    let p_path_access_control_list_id = access_control_list_id;
15616    let p_body_ip_access_control_list_request = ip_access_control_list_request;
15617
15618    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_path_access_control_list_id));
15619    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15620
15621    if let Some(ref user_agent) = configuration.user_agent {
15622        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15623    }
15624    if let Some(ref apikey) = configuration.api_key {
15625        let key = apikey.key.clone();
15626        let value = match apikey.prefix {
15627            Some(ref prefix) => format!("{} {}", prefix, key),
15628            None => key,
15629        };
15630        req_builder = req_builder.header("Authorization", value);
15631    };
15632    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
15633
15634    let req = req_builder.build()?;
15635    let resp = configuration.client.execute(req).await?;
15636
15637    let status = resp.status();
15638    let content_type = resp
15639        .headers()
15640        .get("content-type")
15641        .and_then(|v| v.to_str().ok())
15642        .unwrap_or("application/octet-stream");
15643    let content_type = super::ContentType::from(content_type);
15644
15645    if !status.is_client_error() && !status.is_server_error() {
15646        let content = resp.text().await?;
15647        match content_type {
15648            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15649            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
15650            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`")))),
15651        }
15652    } else {
15653        let content = resp.text().await?;
15654        let entity: Option<UpdateIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
15655        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15656    }
15657}
15658
15659/// Updates the key with the given Id.
15660pub async fn update_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<UpdateKeyWithIdError>> {
15661    // add a prefix to parameters to efficiently prevent name collisions
15662    let p_path_key_id = key_id;
15663    let p_body_key_request = key_request;
15664
15665    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
15666    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15667
15668    if let Some(ref user_agent) = configuration.user_agent {
15669        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15670    }
15671    if let Some(ref apikey) = configuration.api_key {
15672        let key = apikey.key.clone();
15673        let value = match apikey.prefix {
15674            Some(ref prefix) => format!("{} {}", prefix, key),
15675            None => key,
15676        };
15677        req_builder = req_builder.header("Authorization", value);
15678    };
15679    req_builder = req_builder.json(&p_body_key_request);
15680
15681    let req = req_builder.build()?;
15682    let resp = configuration.client.execute(req).await?;
15683
15684    let status = resp.status();
15685    let content_type = resp
15686        .headers()
15687        .get("content-type")
15688        .and_then(|v| v.to_str().ok())
15689        .unwrap_or("application/octet-stream");
15690    let content_type = super::ContentType::from(content_type);
15691
15692    if !status.is_client_error() && !status.is_server_error() {
15693        let content = resp.text().await?;
15694        match content_type {
15695            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15696            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
15697            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`")))),
15698        }
15699    } else {
15700        let content = resp.text().await?;
15701        let entity: Option<UpdateKeyWithIdError> = serde_json::from_str(&content).ok();
15702        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15703    }
15704}
15705
15706/// Updates the lambda with the given Id.
15707pub async fn update_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<UpdateLambdaWithIdError>> {
15708    // add a prefix to parameters to efficiently prevent name collisions
15709    let p_path_lambda_id = lambda_id;
15710    let p_body_lambda_request = lambda_request;
15711
15712    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
15713    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15714
15715    if let Some(ref user_agent) = configuration.user_agent {
15716        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15717    }
15718    if let Some(ref apikey) = configuration.api_key {
15719        let key = apikey.key.clone();
15720        let value = match apikey.prefix {
15721            Some(ref prefix) => format!("{} {}", prefix, key),
15722            None => key,
15723        };
15724        req_builder = req_builder.header("Authorization", value);
15725    };
15726    req_builder = req_builder.json(&p_body_lambda_request);
15727
15728    let req = req_builder.build()?;
15729    let resp = configuration.client.execute(req).await?;
15730
15731    let status = resp.status();
15732    let content_type = resp
15733        .headers()
15734        .get("content-type")
15735        .and_then(|v| v.to_str().ok())
15736        .unwrap_or("application/octet-stream");
15737    let content_type = super::ContentType::from(content_type);
15738
15739    if !status.is_client_error() && !status.is_server_error() {
15740        let content = resp.text().await?;
15741        match content_type {
15742            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15743            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
15744            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`")))),
15745        }
15746    } else {
15747        let content = resp.text().await?;
15748        let entity: Option<UpdateLambdaWithIdError> = serde_json::from_str(&content).ok();
15749        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15750    }
15751}
15752
15753/// Updates the message template with the given Id.
15754pub 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>> {
15755    // add a prefix to parameters to efficiently prevent name collisions
15756    let p_path_message_template_id = message_template_id;
15757    let p_body_message_template_request = message_template_request;
15758
15759    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
15760    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15761
15762    if let Some(ref user_agent) = configuration.user_agent {
15763        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15764    }
15765    if let Some(ref apikey) = configuration.api_key {
15766        let key = apikey.key.clone();
15767        let value = match apikey.prefix {
15768            Some(ref prefix) => format!("{} {}", prefix, key),
15769            None => key,
15770        };
15771        req_builder = req_builder.header("Authorization", value);
15772    };
15773    req_builder = req_builder.json(&p_body_message_template_request);
15774
15775    let req = req_builder.build()?;
15776    let resp = configuration.client.execute(req).await?;
15777
15778    let status = resp.status();
15779    let content_type = resp
15780        .headers()
15781        .get("content-type")
15782        .and_then(|v| v.to_str().ok())
15783        .unwrap_or("application/octet-stream");
15784    let content_type = super::ContentType::from(content_type);
15785
15786    if !status.is_client_error() && !status.is_server_error() {
15787        let content = resp.text().await?;
15788        match content_type {
15789            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15790            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
15791            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`")))),
15792        }
15793    } else {
15794        let content = resp.text().await?;
15795        let entity: Option<UpdateMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
15796        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15797    }
15798}
15799
15800/// Updates the messenger with the given Id.
15801pub async fn update_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<UpdateMessengerWithIdError>> {
15802    // add a prefix to parameters to efficiently prevent name collisions
15803    let p_path_messenger_id = messenger_id;
15804    let p_body_messenger_request = messenger_request;
15805
15806    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
15807    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15808
15809    if let Some(ref user_agent) = configuration.user_agent {
15810        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15811    }
15812    if let Some(ref apikey) = configuration.api_key {
15813        let key = apikey.key.clone();
15814        let value = match apikey.prefix {
15815            Some(ref prefix) => format!("{} {}", prefix, key),
15816            None => key,
15817        };
15818        req_builder = req_builder.header("Authorization", value);
15819    };
15820    req_builder = req_builder.json(&p_body_messenger_request);
15821
15822    let req = req_builder.build()?;
15823    let resp = configuration.client.execute(req).await?;
15824
15825    let status = resp.status();
15826    let content_type = resp
15827        .headers()
15828        .get("content-type")
15829        .and_then(|v| v.to_str().ok())
15830        .unwrap_or("application/octet-stream");
15831    let content_type = super::ContentType::from(content_type);
15832
15833    if !status.is_client_error() && !status.is_server_error() {
15834        let content = resp.text().await?;
15835        match content_type {
15836            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15837            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
15838            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`")))),
15839        }
15840    } else {
15841        let content = resp.text().await?;
15842        let entity: Option<UpdateMessengerWithIdError> = serde_json::from_str(&content).ok();
15843        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15844    }
15845}
15846
15847/// Updates the OAuth scope with the given Id for the application.
15848pub 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>> {
15849    // add a prefix to parameters to efficiently prevent name collisions
15850    let p_path_application_id = application_id;
15851    let p_path_scope_id = scope_id;
15852    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15853    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
15854
15855    let uri_str = format!("{}/api/application/{applicationId}/scope/{scopeId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id), scopeId=crate::apis::urlencode(p_path_scope_id));
15856    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15857
15858    if let Some(ref user_agent) = configuration.user_agent {
15859        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15860    }
15861    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15862        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15863    }
15864    if let Some(ref apikey) = configuration.api_key {
15865        let key = apikey.key.clone();
15866        let value = match apikey.prefix {
15867            Some(ref prefix) => format!("{} {}", prefix, key),
15868            None => key,
15869        };
15870        req_builder = req_builder.header("Authorization", value);
15871    };
15872    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
15873
15874    let req = req_builder.build()?;
15875    let resp = configuration.client.execute(req).await?;
15876
15877    let status = resp.status();
15878    let content_type = resp
15879        .headers()
15880        .get("content-type")
15881        .and_then(|v| v.to_str().ok())
15882        .unwrap_or("application/octet-stream");
15883    let content_type = super::ContentType::from(content_type);
15884
15885    if !status.is_client_error() && !status.is_server_error() {
15886        let content = resp.text().await?;
15887        match content_type {
15888            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15889            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
15890            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`")))),
15891        }
15892    } else {
15893        let content = resp.text().await?;
15894        let entity: Option<UpdateOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
15895        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15896    }
15897}
15898
15899/// Updates the registration for the user with the given Id and the application defined in the request.
15900pub 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>> {
15901    // add a prefix to parameters to efficiently prevent name collisions
15902    let p_path_user_id = user_id;
15903    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15904    let p_body_registration_request = registration_request;
15905
15906    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
15907    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15908
15909    if let Some(ref user_agent) = configuration.user_agent {
15910        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15911    }
15912    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15913        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15914    }
15915    if let Some(ref apikey) = configuration.api_key {
15916        let key = apikey.key.clone();
15917        let value = match apikey.prefix {
15918            Some(ref prefix) => format!("{} {}", prefix, key),
15919            None => key,
15920        };
15921        req_builder = req_builder.header("Authorization", value);
15922    };
15923    req_builder = req_builder.json(&p_body_registration_request);
15924
15925    let req = req_builder.build()?;
15926    let resp = configuration.client.execute(req).await?;
15927
15928    let status = resp.status();
15929    let content_type = resp
15930        .headers()
15931        .get("content-type")
15932        .and_then(|v| v.to_str().ok())
15933        .unwrap_or("application/octet-stream");
15934    let content_type = super::ContentType::from(content_type);
15935
15936    if !status.is_client_error() && !status.is_server_error() {
15937        let content = resp.text().await?;
15938        match content_type {
15939            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15940            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
15941            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`")))),
15942        }
15943    } else {
15944        let content = resp.text().await?;
15945        let entity: Option<UpdateRegistrationWithIdError> = serde_json::from_str(&content).ok();
15946        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15947    }
15948}
15949
15950/// Updates the system configuration.
15951pub async fn update_system_configuration_with_id(configuration: &configuration::Configuration, system_configuration_request: Option<models::SystemConfigurationRequest>) -> Result<models::SystemConfigurationResponse, Error<UpdateSystemConfigurationWithIdError>> {
15952    // add a prefix to parameters to efficiently prevent name collisions
15953    let p_body_system_configuration_request = system_configuration_request;
15954
15955    let uri_str = format!("{}/api/system-configuration", configuration.base_path);
15956    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15957
15958    if let Some(ref user_agent) = configuration.user_agent {
15959        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15960    }
15961    if let Some(ref apikey) = configuration.api_key {
15962        let key = apikey.key.clone();
15963        let value = match apikey.prefix {
15964            Some(ref prefix) => format!("{} {}", prefix, key),
15965            None => key,
15966        };
15967        req_builder = req_builder.header("Authorization", value);
15968    };
15969    req_builder = req_builder.json(&p_body_system_configuration_request);
15970
15971    let req = req_builder.build()?;
15972    let resp = configuration.client.execute(req).await?;
15973
15974    let status = resp.status();
15975    let content_type = resp
15976        .headers()
15977        .get("content-type")
15978        .and_then(|v| v.to_str().ok())
15979        .unwrap_or("application/octet-stream");
15980    let content_type = super::ContentType::from(content_type);
15981
15982    if !status.is_client_error() && !status.is_server_error() {
15983        let content = resp.text().await?;
15984        match content_type {
15985            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15986            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SystemConfigurationResponse`"))),
15987            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`")))),
15988        }
15989    } else {
15990        let content = resp.text().await?;
15991        let entity: Option<UpdateSystemConfigurationWithIdError> = serde_json::from_str(&content).ok();
15992        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15993    }
15994}
15995
15996/// Updates the tenant with the given Id.
15997pub 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>> {
15998    // add a prefix to parameters to efficiently prevent name collisions
15999    let p_path_tenant_id = tenant_id;
16000    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16001    let p_body_tenant_request = tenant_request;
16002
16003    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
16004    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16005
16006    if let Some(ref user_agent) = configuration.user_agent {
16007        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16008    }
16009    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16010        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16011    }
16012    if let Some(ref apikey) = configuration.api_key {
16013        let key = apikey.key.clone();
16014        let value = match apikey.prefix {
16015            Some(ref prefix) => format!("{} {}", prefix, key),
16016            None => key,
16017        };
16018        req_builder = req_builder.header("Authorization", value);
16019    };
16020    req_builder = req_builder.json(&p_body_tenant_request);
16021
16022    let req = req_builder.build()?;
16023    let resp = configuration.client.execute(req).await?;
16024
16025    let status = resp.status();
16026    let content_type = resp
16027        .headers()
16028        .get("content-type")
16029        .and_then(|v| v.to_str().ok())
16030        .unwrap_or("application/octet-stream");
16031    let content_type = super::ContentType::from(content_type);
16032
16033    if !status.is_client_error() && !status.is_server_error() {
16034        let content = resp.text().await?;
16035        match content_type {
16036            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16037            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
16038            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`")))),
16039        }
16040    } else {
16041        let content = resp.text().await?;
16042        let entity: Option<UpdateTenantWithIdError> = serde_json::from_str(&content).ok();
16043        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16044    }
16045}
16046
16047/// Updates the theme with the given Id.
16048pub async fn update_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<UpdateThemeWithIdError>> {
16049    // add a prefix to parameters to efficiently prevent name collisions
16050    let p_path_theme_id = theme_id;
16051    let p_body_theme_request = theme_request;
16052
16053    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
16054    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16055
16056    if let Some(ref user_agent) = configuration.user_agent {
16057        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16058    }
16059    if let Some(ref apikey) = configuration.api_key {
16060        let key = apikey.key.clone();
16061        let value = match apikey.prefix {
16062            Some(ref prefix) => format!("{} {}", prefix, key),
16063            None => key,
16064        };
16065        req_builder = req_builder.header("Authorization", value);
16066    };
16067    req_builder = req_builder.json(&p_body_theme_request);
16068
16069    let req = req_builder.build()?;
16070    let resp = configuration.client.execute(req).await?;
16071
16072    let status = resp.status();
16073    let content_type = resp
16074        .headers()
16075        .get("content-type")
16076        .and_then(|v| v.to_str().ok())
16077        .unwrap_or("application/octet-stream");
16078    let content_type = super::ContentType::from(content_type);
16079
16080    if !status.is_client_error() && !status.is_server_error() {
16081        let content = resp.text().await?;
16082        match content_type {
16083            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16084            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
16085            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`")))),
16086        }
16087    } else {
16088        let content = resp.text().await?;
16089        let entity: Option<UpdateThemeWithIdError> = serde_json::from_str(&content).ok();
16090        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16091    }
16092}
16093
16094/// Updates the user action reason with the given Id.
16095pub 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>> {
16096    // add a prefix to parameters to efficiently prevent name collisions
16097    let p_path_user_action_reason_id = user_action_reason_id;
16098    let p_body_user_action_reason_request = user_action_reason_request;
16099
16100    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
16101    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16102
16103    if let Some(ref user_agent) = configuration.user_agent {
16104        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16105    }
16106    if let Some(ref apikey) = configuration.api_key {
16107        let key = apikey.key.clone();
16108        let value = match apikey.prefix {
16109            Some(ref prefix) => format!("{} {}", prefix, key),
16110            None => key,
16111        };
16112        req_builder = req_builder.header("Authorization", value);
16113    };
16114    req_builder = req_builder.json(&p_body_user_action_reason_request);
16115
16116    let req = req_builder.build()?;
16117    let resp = configuration.client.execute(req).await?;
16118
16119    let status = resp.status();
16120    let content_type = resp
16121        .headers()
16122        .get("content-type")
16123        .and_then(|v| v.to_str().ok())
16124        .unwrap_or("application/octet-stream");
16125    let content_type = super::ContentType::from(content_type);
16126
16127    if !status.is_client_error() && !status.is_server_error() {
16128        let content = resp.text().await?;
16129        match content_type {
16130            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16131            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
16132            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`")))),
16133        }
16134    } else {
16135        let content = resp.text().await?;
16136        let entity: Option<UpdateUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
16137        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16138    }
16139}
16140
16141/// Updates the user action with the given Id. OR Reactivates the user action with the given Id.
16142pub async fn update_user_action_with_id(configuration: &configuration::Configuration, user_action_id: &str, x_fusion_auth_tenant_id: Option<&str>, reactivate: Option<&str>, user_action_request: Option<models::UserActionRequest>) -> Result<models::UserActionResponse, Error<UpdateUserActionWithIdError>> {
16143    // add a prefix to parameters to efficiently prevent name collisions
16144    let p_path_user_action_id = user_action_id;
16145    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16146    let p_query_reactivate = reactivate;
16147    let p_body_user_action_request = user_action_request;
16148
16149    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
16150    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16151
16152    if let Some(ref param_value) = p_query_reactivate {
16153        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
16154    }
16155    if let Some(ref user_agent) = configuration.user_agent {
16156        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16157    }
16158    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16159        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16160    }
16161    if let Some(ref apikey) = configuration.api_key {
16162        let key = apikey.key.clone();
16163        let value = match apikey.prefix {
16164            Some(ref prefix) => format!("{} {}", prefix, key),
16165            None => key,
16166        };
16167        req_builder = req_builder.header("Authorization", value);
16168    };
16169    req_builder = req_builder.json(&p_body_user_action_request);
16170
16171    let req = req_builder.build()?;
16172    let resp = configuration.client.execute(req).await?;
16173
16174    let status = resp.status();
16175    let content_type = resp
16176        .headers()
16177        .get("content-type")
16178        .and_then(|v| v.to_str().ok())
16179        .unwrap_or("application/octet-stream");
16180    let content_type = super::ContentType::from(content_type);
16181
16182    if !status.is_client_error() && !status.is_server_error() {
16183        let content = resp.text().await?;
16184        match content_type {
16185            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16186            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
16187            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`")))),
16188        }
16189    } else {
16190        let content = resp.text().await?;
16191        let entity: Option<UpdateUserActionWithIdError> = serde_json::from_str(&content).ok();
16192        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16193    }
16194}
16195
16196/// Updates a single User consent by Id.
16197pub 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>> {
16198    // add a prefix to parameters to efficiently prevent name collisions
16199    let p_path_user_consent_id = user_consent_id;
16200    let p_body_user_consent_request = user_consent_request;
16201
16202    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
16203    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16204
16205    if let Some(ref user_agent) = configuration.user_agent {
16206        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16207    }
16208    if let Some(ref apikey) = configuration.api_key {
16209        let key = apikey.key.clone();
16210        let value = match apikey.prefix {
16211            Some(ref prefix) => format!("{} {}", prefix, key),
16212            None => key,
16213        };
16214        req_builder = req_builder.header("Authorization", value);
16215    };
16216    req_builder = req_builder.json(&p_body_user_consent_request);
16217
16218    let req = req_builder.build()?;
16219    let resp = configuration.client.execute(req).await?;
16220
16221    let status = resp.status();
16222    let content_type = resp
16223        .headers()
16224        .get("content-type")
16225        .and_then(|v| v.to_str().ok())
16226        .unwrap_or("application/octet-stream");
16227    let content_type = super::ContentType::from(content_type);
16228
16229    if !status.is_client_error() && !status.is_server_error() {
16230        let content = resp.text().await?;
16231        match content_type {
16232            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16233            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
16234            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`")))),
16235        }
16236    } else {
16237        let content = resp.text().await?;
16238        let entity: Option<UpdateUserConsentWithIdError> = serde_json::from_str(&content).ok();
16239        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16240    }
16241}
16242
16243/// Updates a family with a given Id. OR Adds a user to an existing family. The family Id must be specified.
16244pub 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>> {
16245    // add a prefix to parameters to efficiently prevent name collisions
16246    let p_path_family_id = family_id;
16247    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16248    let p_body_family_request = family_request;
16249
16250    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_id));
16251    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16252
16253    if let Some(ref user_agent) = configuration.user_agent {
16254        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16255    }
16256    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16257        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16258    }
16259    if let Some(ref apikey) = configuration.api_key {
16260        let key = apikey.key.clone();
16261        let value = match apikey.prefix {
16262            Some(ref prefix) => format!("{} {}", prefix, key),
16263            None => key,
16264        };
16265        req_builder = req_builder.header("Authorization", value);
16266    };
16267    req_builder = req_builder.json(&p_body_family_request);
16268
16269    let req = req_builder.build()?;
16270    let resp = configuration.client.execute(req).await?;
16271
16272    let status = resp.status();
16273    let content_type = resp
16274        .headers()
16275        .get("content-type")
16276        .and_then(|v| v.to_str().ok())
16277        .unwrap_or("application/octet-stream");
16278    let content_type = super::ContentType::from(content_type);
16279
16280    if !status.is_client_error() && !status.is_server_error() {
16281        let content = resp.text().await?;
16282        match content_type {
16283            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16284            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
16285            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`")))),
16286        }
16287    } else {
16288        let content = resp.text().await?;
16289        let entity: Option<UpdateUserFamilyWithIdError> = serde_json::from_str(&content).ok();
16290        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16291    }
16292}
16293
16294/// 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 Re-sends the verification email to the user. 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.
16295pub async fn update_user_verify_email(configuration: &configuration::Configuration, application_id: Option<&str>, email: Option<&str>, send_verify_email: Option<&str>) -> Result<models::VerifyEmailResponse, Error<UpdateUserVerifyEmailError>> {
16296    // add a prefix to parameters to efficiently prevent name collisions
16297    let p_query_application_id = application_id;
16298    let p_query_email = email;
16299    let p_query_send_verify_email = send_verify_email;
16300
16301    let uri_str = format!("{}/api/user/verify-email", configuration.base_path);
16302    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16303
16304    if let Some(ref param_value) = p_query_application_id {
16305        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
16306    }
16307    if let Some(ref param_value) = p_query_email {
16308        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
16309    }
16310    if let Some(ref param_value) = p_query_send_verify_email {
16311        req_builder = req_builder.query(&[("sendVerifyEmail", &param_value.to_string())]);
16312    }
16313    if let Some(ref user_agent) = configuration.user_agent {
16314        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16315    }
16316    if let Some(ref apikey) = configuration.api_key {
16317        let key = apikey.key.clone();
16318        let value = match apikey.prefix {
16319            Some(ref prefix) => format!("{} {}", prefix, key),
16320            None => key,
16321        };
16322        req_builder = req_builder.header("Authorization", value);
16323    };
16324
16325    let req = req_builder.build()?;
16326    let resp = configuration.client.execute(req).await?;
16327
16328    let status = resp.status();
16329    let content_type = resp
16330        .headers()
16331        .get("content-type")
16332        .and_then(|v| v.to_str().ok())
16333        .unwrap_or("application/octet-stream");
16334    let content_type = super::ContentType::from(content_type);
16335
16336    if !status.is_client_error() && !status.is_server_error() {
16337        let content = resp.text().await?;
16338        match content_type {
16339            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16340            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyEmailResponse`"))),
16341            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`")))),
16342        }
16343    } else {
16344        let content = resp.text().await?;
16345        let entity: Option<UpdateUserVerifyEmailError> = serde_json::from_str(&content).ok();
16346        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16347    }
16348}
16349
16350/// Re-sends the application registration verification email to the user. OR 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.
16351pub async fn update_user_verify_registration(configuration: &configuration::Configuration, email: Option<&str>, application_id: Option<&str>, send_verify_password_email: Option<&str>) -> Result<models::VerifyRegistrationResponse, Error<UpdateUserVerifyRegistrationError>> {
16352    // add a prefix to parameters to efficiently prevent name collisions
16353    let p_query_email = email;
16354    let p_query_application_id = application_id;
16355    let p_query_send_verify_password_email = send_verify_password_email;
16356
16357    let uri_str = format!("{}/api/user/verify-registration", configuration.base_path);
16358    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16359
16360    if let Some(ref param_value) = p_query_email {
16361        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
16362    }
16363    if let Some(ref param_value) = p_query_application_id {
16364        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
16365    }
16366    if let Some(ref param_value) = p_query_send_verify_password_email {
16367        req_builder = req_builder.query(&[("sendVerifyPasswordEmail", &param_value.to_string())]);
16368    }
16369    if let Some(ref user_agent) = configuration.user_agent {
16370        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16371    }
16372    if let Some(ref apikey) = configuration.api_key {
16373        let key = apikey.key.clone();
16374        let value = match apikey.prefix {
16375            Some(ref prefix) => format!("{} {}", prefix, key),
16376            None => key,
16377        };
16378        req_builder = req_builder.header("Authorization", value);
16379    };
16380
16381    let req = req_builder.build()?;
16382    let resp = configuration.client.execute(req).await?;
16383
16384    let status = resp.status();
16385    let content_type = resp
16386        .headers()
16387        .get("content-type")
16388        .and_then(|v| v.to_str().ok())
16389        .unwrap_or("application/octet-stream");
16390    let content_type = super::ContentType::from(content_type);
16391
16392    if !status.is_client_error() && !status.is_server_error() {
16393        let content = resp.text().await?;
16394        match content_type {
16395            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16396            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyRegistrationResponse`"))),
16397            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`")))),
16398        }
16399    } else {
16400        let content = resp.text().await?;
16401        let entity: Option<UpdateUserVerifyRegistrationError> = serde_json::from_str(&content).ok();
16402        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16403    }
16404}
16405
16406/// Updates the user with the given Id. OR Reactivates the user with the given Id.
16407pub async fn update_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>, reactivate: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<UpdateUserWithIdError>> {
16408    // add a prefix to parameters to efficiently prevent name collisions
16409    let p_path_user_id = user_id;
16410    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16411    let p_query_reactivate = reactivate;
16412    let p_body_user_request = user_request;
16413
16414    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
16415    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16416
16417    if let Some(ref param_value) = p_query_reactivate {
16418        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
16419    }
16420    if let Some(ref user_agent) = configuration.user_agent {
16421        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16422    }
16423    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16424        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16425    }
16426    if let Some(ref apikey) = configuration.api_key {
16427        let key = apikey.key.clone();
16428        let value = match apikey.prefix {
16429            Some(ref prefix) => format!("{} {}", prefix, key),
16430            None => key,
16431        };
16432        req_builder = req_builder.header("Authorization", value);
16433    };
16434    req_builder = req_builder.json(&p_body_user_request);
16435
16436    let req = req_builder.build()?;
16437    let resp = configuration.client.execute(req).await?;
16438
16439    let status = resp.status();
16440    let content_type = resp
16441        .headers()
16442        .get("content-type")
16443        .and_then(|v| v.to_str().ok())
16444        .unwrap_or("application/octet-stream");
16445    let content_type = super::ContentType::from(content_type);
16446
16447    if !status.is_client_error() && !status.is_server_error() {
16448        let content = resp.text().await?;
16449        match content_type {
16450            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16451            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
16452            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`")))),
16453        }
16454    } else {
16455        let content = resp.text().await?;
16456        let entity: Option<UpdateUserWithIdError> = serde_json::from_str(&content).ok();
16457        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16458    }
16459}
16460
16461/// Updates the webhook with the given Id.
16462pub async fn update_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<UpdateWebhookWithIdError>> {
16463    // add a prefix to parameters to efficiently prevent name collisions
16464    let p_path_webhook_id = webhook_id;
16465    let p_body_webhook_request = webhook_request;
16466
16467    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
16468    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16469
16470    if let Some(ref user_agent) = configuration.user_agent {
16471        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16472    }
16473    if let Some(ref apikey) = configuration.api_key {
16474        let key = apikey.key.clone();
16475        let value = match apikey.prefix {
16476            Some(ref prefix) => format!("{} {}", prefix, key),
16477            None => key,
16478        };
16479        req_builder = req_builder.header("Authorization", value);
16480    };
16481    req_builder = req_builder.json(&p_body_webhook_request);
16482
16483    let req = req_builder.build()?;
16484    let resp = configuration.client.execute(req).await?;
16485
16486    let status = resp.status();
16487    let content_type = resp
16488        .headers()
16489        .get("content-type")
16490        .and_then(|v| v.to_str().ok())
16491        .unwrap_or("application/octet-stream");
16492    let content_type = super::ContentType::from(content_type);
16493
16494    if !status.is_client_error() && !status.is_server_error() {
16495        let content = resp.text().await?;
16496        match content_type {
16497            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16498            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
16499            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`")))),
16500        }
16501    } else {
16502        let content = resp.text().await?;
16503        let entity: Option<UpdateWebhookWithIdError> = serde_json::from_str(&content).ok();
16504        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16505    }
16506}
16507
16508/// Creates or updates an Entity Grant. This is when a User/Entity is granted permissions to an Entity.
16509pub 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>> {
16510    // add a prefix to parameters to efficiently prevent name collisions
16511    let p_path_entity_id = entity_id;
16512    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16513    let p_body_entity_grant_request = entity_grant_request;
16514
16515    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
16516    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16517
16518    if let Some(ref user_agent) = configuration.user_agent {
16519        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16520    }
16521    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16522        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16523    }
16524    if let Some(ref apikey) = configuration.api_key {
16525        let key = apikey.key.clone();
16526        let value = match apikey.prefix {
16527            Some(ref prefix) => format!("{} {}", prefix, key),
16528            None => key,
16529        };
16530        req_builder = req_builder.header("Authorization", value);
16531    };
16532    req_builder = req_builder.json(&p_body_entity_grant_request);
16533
16534    let req = req_builder.build()?;
16535    let resp = configuration.client.execute(req).await?;
16536
16537    let status = resp.status();
16538
16539    if !status.is_client_error() && !status.is_server_error() {
16540        Ok(())
16541    } else {
16542        let content = resp.text().await?;
16543        let entity: Option<UpsertEntityGrantWithIdError> = serde_json::from_str(&content).ok();
16544        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16545    }
16546}
16547
16548/// 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.
16549pub async fn validate_device_with_id(configuration: &configuration::Configuration, user_code: Option<&str>, client_id: Option<&str>) -> Result<(), Error<ValidateDeviceWithIdError>> {
16550    // add a prefix to parameters to efficiently prevent name collisions
16551    let p_query_user_code = user_code;
16552    let p_query_client_id = client_id;
16553
16554    let uri_str = format!("{}/oauth2/device/validate", configuration.base_path);
16555    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
16556
16557    if let Some(ref param_value) = p_query_user_code {
16558        req_builder = req_builder.query(&[("user_code", &param_value.to_string())]);
16559    }
16560    if let Some(ref param_value) = p_query_client_id {
16561        req_builder = req_builder.query(&[("client_id", &param_value.to_string())]);
16562    }
16563    if let Some(ref user_agent) = configuration.user_agent {
16564        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16565    }
16566    if let Some(ref apikey) = configuration.api_key {
16567        let key = apikey.key.clone();
16568        let value = match apikey.prefix {
16569            Some(ref prefix) => format!("{} {}", prefix, key),
16570            None => key,
16571        };
16572        req_builder = req_builder.header("Authorization", value);
16573    };
16574
16575    let req = req_builder.build()?;
16576    let resp = configuration.client.execute(req).await?;
16577
16578    let status = resp.status();
16579
16580    if !status.is_client_error() && !status.is_server_error() {
16581        Ok(())
16582    } else {
16583        let content = resp.text().await?;
16584        let entity: Option<ValidateDeviceWithIdError> = serde_json::from_str(&content).ok();
16585        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16586    }
16587}
16588
16589/// 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.
16590pub async fn validate_jwt_with_id(configuration: &configuration::Configuration, ) -> Result<models::ValidateResponse, Error<ValidateJwtWithIdError>> {
16591
16592    let uri_str = format!("{}/api/jwt/validate", configuration.base_path);
16593    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
16594
16595    if let Some(ref user_agent) = configuration.user_agent {
16596        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16597    }
16598    if let Some(ref token) = configuration.bearer_access_token {
16599        req_builder = req_builder.bearer_auth(token.to_owned());
16600    };
16601
16602    let req = req_builder.build()?;
16603    let resp = configuration.client.execute(req).await?;
16604
16605    let status = resp.status();
16606    let content_type = resp
16607        .headers()
16608        .get("content-type")
16609        .and_then(|v| v.to_str().ok())
16610        .unwrap_or("application/octet-stream");
16611    let content_type = super::ContentType::from(content_type);
16612
16613    if !status.is_client_error() && !status.is_server_error() {
16614        let content = resp.text().await?;
16615        match content_type {
16616            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16617            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ValidateResponse`"))),
16618            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`")))),
16619        }
16620    } else {
16621        let content = resp.text().await?;
16622        let entity: Option<ValidateJwtWithIdError> = serde_json::from_str(&content).ok();
16623        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16624    }
16625}
16626
16627/// 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.
16628pub async fn vend_jwt_with_id(configuration: &configuration::Configuration, jwt_vend_request: Option<models::JwtVendRequest>) -> Result<models::JwtVendResponse, Error<VendJwtWithIdError>> {
16629    // add a prefix to parameters to efficiently prevent name collisions
16630    let p_body_jwt_vend_request = jwt_vend_request;
16631
16632    let uri_str = format!("{}/api/jwt/vend", configuration.base_path);
16633    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16634
16635    if let Some(ref user_agent) = configuration.user_agent {
16636        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16637    }
16638    if let Some(ref apikey) = configuration.api_key {
16639        let key = apikey.key.clone();
16640        let value = match apikey.prefix {
16641            Some(ref prefix) => format!("{} {}", prefix, key),
16642            None => key,
16643        };
16644        req_builder = req_builder.header("Authorization", value);
16645    };
16646    req_builder = req_builder.json(&p_body_jwt_vend_request);
16647
16648    let req = req_builder.build()?;
16649    let resp = configuration.client.execute(req).await?;
16650
16651    let status = resp.status();
16652    let content_type = resp
16653        .headers()
16654        .get("content-type")
16655        .and_then(|v| v.to_str().ok())
16656        .unwrap_or("application/octet-stream");
16657    let content_type = super::ContentType::from(content_type);
16658
16659    if !status.is_client_error() && !status.is_server_error() {
16660        let content = resp.text().await?;
16661        match content_type {
16662            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16663            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwtVendResponse`"))),
16664            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`")))),
16665        }
16666    } else {
16667        let content = resp.text().await?;
16668        let entity: Option<VendJwtWithIdError> = serde_json::from_str(&content).ok();
16669        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16670    }
16671}
16672
16673/// Administratively verify a user identity.
16674pub async fn verify_identity_with_id(configuration: &configuration::Configuration, verify_request: Option<models::VerifyRequest>) -> Result<(), Error<VerifyIdentityWithIdError>> {
16675    // add a prefix to parameters to efficiently prevent name collisions
16676    let p_body_verify_request = verify_request;
16677
16678    let uri_str = format!("{}/api/identity/verify", configuration.base_path);
16679    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16680
16681    if let Some(ref user_agent) = configuration.user_agent {
16682        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16683    }
16684    if let Some(ref apikey) = configuration.api_key {
16685        let key = apikey.key.clone();
16686        let value = match apikey.prefix {
16687            Some(ref prefix) => format!("{} {}", prefix, key),
16688            None => key,
16689        };
16690        req_builder = req_builder.header("Authorization", value);
16691    };
16692    req_builder = req_builder.json(&p_body_verify_request);
16693
16694    let req = req_builder.build()?;
16695    let resp = configuration.client.execute(req).await?;
16696
16697    let status = resp.status();
16698
16699    if !status.is_client_error() && !status.is_server_error() {
16700        Ok(())
16701    } else {
16702        let content = resp.text().await?;
16703        let entity: Option<VerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
16704        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16705    }
16706}
16707
16708/// 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.
16709pub async fn verify_user_registration_with_id(configuration: &configuration::Configuration, verify_registration_request: Option<models::VerifyRegistrationRequest>) -> Result<(), Error<VerifyUserRegistrationWithIdError>> {
16710    // add a prefix to parameters to efficiently prevent name collisions
16711    let p_body_verify_registration_request = verify_registration_request;
16712
16713    let uri_str = format!("{}/api/user/verify-registration", configuration.base_path);
16714    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16715
16716    if let Some(ref user_agent) = configuration.user_agent {
16717        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16718    }
16719    if let Some(ref apikey) = configuration.api_key {
16720        let key = apikey.key.clone();
16721        let value = match apikey.prefix {
16722            Some(ref prefix) => format!("{} {}", prefix, key),
16723            None => key,
16724        };
16725        req_builder = req_builder.header("Authorization", value);
16726    };
16727    req_builder = req_builder.json(&p_body_verify_registration_request);
16728
16729    let req = req_builder.build()?;
16730    let resp = configuration.client.execute(req).await?;
16731
16732    let status = resp.status();
16733
16734    if !status.is_client_error() && !status.is_server_error() {
16735        Ok(())
16736    } else {
16737        let content = resp.text().await?;
16738        let entity: Option<VerifyUserRegistrationWithIdError> = serde_json::from_str(&content).ok();
16739        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16740    }
16741}
16742