Skip to main content

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.62.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 [`cancel_action_with_id`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum CancelActionWithIdError {
38    DefaultResponse(models::Errors),
39    UnknownValue(serde_json::Value),
40}
41
42/// struct for typed errors of method [`change_password_with_id`]
43#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum ChangePasswordWithIdError {
46    DefaultResponse(models::Errors),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`comment_on_user_with_id`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum CommentOnUserWithIdError {
54    DefaultResponse(models::Errors),
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`complete_verify_identity_with_id`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum CompleteVerifyIdentityWithIdError {
62    DefaultResponse(models::Errors),
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`complete_web_authn_assertion_with_id`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum CompleteWebAuthnAssertionWithIdError {
70    DefaultResponse(models::Errors),
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`complete_web_authn_login_with_id`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CompleteWebAuthnLoginWithIdError {
78    DefaultResponse(models::Errors),
79    UnknownValue(serde_json::Value),
80}
81
82/// struct for typed errors of method [`complete_web_authn_registration_with_id`]
83#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum CompleteWebAuthnRegistrationWithIdError {
86    DefaultResponse(models::Errors),
87    UnknownValue(serde_json::Value),
88}
89
90/// struct for typed errors of method [`create_api_key`]
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum CreateApiKeyError {
94    DefaultResponse(models::Errors),
95    UnknownValue(serde_json::Value),
96}
97
98/// struct for typed errors of method [`create_api_key_with_id`]
99#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum CreateApiKeyWithIdError {
102    DefaultResponse(models::Errors),
103    UnknownValue(serde_json::Value),
104}
105
106/// struct for typed errors of method [`create_application`]
107#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum CreateApplicationError {
110    DefaultResponse(models::Errors),
111    UnknownValue(serde_json::Value),
112}
113
114/// struct for typed errors of method [`create_application_role`]
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum CreateApplicationRoleError {
118    DefaultResponse(models::Errors),
119    UnknownValue(serde_json::Value),
120}
121
122/// struct for typed errors of method [`create_application_role_with_id`]
123#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum CreateApplicationRoleWithIdError {
126    DefaultResponse(models::Errors),
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`create_application_with_id`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum CreateApplicationWithIdError {
134    DefaultResponse(models::Errors),
135    UnknownValue(serde_json::Value),
136}
137
138/// struct for typed errors of method [`create_audit_log_with_id`]
139#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum CreateAuditLogWithIdError {
142    DefaultResponse(models::Errors),
143    UnknownValue(serde_json::Value),
144}
145
146/// struct for typed errors of method [`create_connector`]
147#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum CreateConnectorError {
150    DefaultResponse(models::Errors),
151    UnknownValue(serde_json::Value),
152}
153
154/// struct for typed errors of method [`create_connector_with_id`]
155#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum CreateConnectorWithIdError {
158    DefaultResponse(models::Errors),
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`create_consent`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum CreateConsentError {
166    DefaultResponse(models::Errors),
167    UnknownValue(serde_json::Value),
168}
169
170/// struct for typed errors of method [`create_consent_with_id`]
171#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum CreateConsentWithIdError {
174    DefaultResponse(models::Errors),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`create_device_approve`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum CreateDeviceApproveError {
182    DefaultResponse(models::Errors),
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`create_device_authorize`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum CreateDeviceAuthorizeError {
190    DefaultResponse(models::OAuthError),
191    UnknownValue(serde_json::Value),
192}
193
194/// struct for typed errors of method [`create_device_user_code`]
195#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(untagged)]
197pub enum CreateDeviceUserCodeError {
198    DefaultResponse(),
199    UnknownValue(serde_json::Value),
200}
201
202/// struct for typed errors of method [`create_email_template`]
203#[derive(Debug, Clone, Serialize, Deserialize)]
204#[serde(untagged)]
205pub enum CreateEmailTemplateError {
206    DefaultResponse(models::Errors),
207    UnknownValue(serde_json::Value),
208}
209
210/// struct for typed errors of method [`create_email_template_with_id`]
211#[derive(Debug, Clone, Serialize, Deserialize)]
212#[serde(untagged)]
213pub enum CreateEmailTemplateWithIdError {
214    DefaultResponse(models::Errors),
215    UnknownValue(serde_json::Value),
216}
217
218/// struct for typed errors of method [`create_entity`]
219#[derive(Debug, Clone, Serialize, Deserialize)]
220#[serde(untagged)]
221pub enum CreateEntityError {
222    DefaultResponse(models::Errors),
223    UnknownValue(serde_json::Value),
224}
225
226/// struct for typed errors of method [`create_entity_type`]
227#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum CreateEntityTypeError {
230    DefaultResponse(models::Errors),
231    UnknownValue(serde_json::Value),
232}
233
234/// struct for typed errors of method [`create_entity_type_permission`]
235#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum CreateEntityTypePermissionError {
238    DefaultResponse(models::Errors),
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`create_entity_type_permission_with_id`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum CreateEntityTypePermissionWithIdError {
246    DefaultResponse(models::Errors),
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`create_entity_type_with_id`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum CreateEntityTypeWithIdError {
254    DefaultResponse(models::Errors),
255    UnknownValue(serde_json::Value),
256}
257
258/// struct for typed errors of method [`create_entity_with_id`]
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum CreateEntityWithIdError {
262    DefaultResponse(models::Errors),
263    UnknownValue(serde_json::Value),
264}
265
266/// struct for typed errors of method [`create_family`]
267#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum CreateFamilyError {
270    DefaultResponse(models::Errors),
271    UnknownValue(serde_json::Value),
272}
273
274/// struct for typed errors of method [`create_family_with_id`]
275#[derive(Debug, Clone, Serialize, Deserialize)]
276#[serde(untagged)]
277pub enum CreateFamilyWithIdError {
278    DefaultResponse(models::Errors),
279    UnknownValue(serde_json::Value),
280}
281
282/// struct for typed errors of method [`create_form`]
283#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum CreateFormError {
286    DefaultResponse(models::Errors),
287    UnknownValue(serde_json::Value),
288}
289
290/// struct for typed errors of method [`create_form_field`]
291#[derive(Debug, Clone, Serialize, Deserialize)]
292#[serde(untagged)]
293pub enum CreateFormFieldError {
294    DefaultResponse(models::Errors),
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`create_form_field_with_id`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum CreateFormFieldWithIdError {
302    DefaultResponse(models::Errors),
303    UnknownValue(serde_json::Value),
304}
305
306/// struct for typed errors of method [`create_form_with_id`]
307#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum CreateFormWithIdError {
310    DefaultResponse(models::Errors),
311    UnknownValue(serde_json::Value),
312}
313
314/// struct for typed errors of method [`create_group`]
315#[derive(Debug, Clone, Serialize, Deserialize)]
316#[serde(untagged)]
317pub enum CreateGroupError {
318    DefaultResponse(models::Errors),
319    UnknownValue(serde_json::Value),
320}
321
322/// struct for typed errors of method [`create_group_members_with_id`]
323#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum CreateGroupMembersWithIdError {
326    DefaultResponse(models::Errors),
327    UnknownValue(serde_json::Value),
328}
329
330/// struct for typed errors of method [`create_group_with_id`]
331#[derive(Debug, Clone, Serialize, Deserialize)]
332#[serde(untagged)]
333pub enum CreateGroupWithIdError {
334    DefaultResponse(models::Errors),
335    UnknownValue(serde_json::Value),
336}
337
338/// struct for typed errors of method [`create_identity_provider`]
339#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum CreateIdentityProviderError {
342    DefaultResponse(models::Errors),
343    UnknownValue(serde_json::Value),
344}
345
346/// struct for typed errors of method [`create_identity_provider_with_id`]
347#[derive(Debug, Clone, Serialize, Deserialize)]
348#[serde(untagged)]
349pub enum CreateIdentityProviderWithIdError {
350    DefaultResponse(models::Errors),
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`create_introspect`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum CreateIntrospectError {
358    DefaultResponse(models::OAuthError),
359    UnknownValue(serde_json::Value),
360}
361
362/// struct for typed errors of method [`create_ip_access_control_list`]
363#[derive(Debug, Clone, Serialize, Deserialize)]
364#[serde(untagged)]
365pub enum CreateIpAccessControlListError {
366    DefaultResponse(models::Errors),
367    UnknownValue(serde_json::Value),
368}
369
370/// struct for typed errors of method [`create_ip_access_control_list_with_id`]
371#[derive(Debug, Clone, Serialize, Deserialize)]
372#[serde(untagged)]
373pub enum CreateIpAccessControlListWithIdError {
374    DefaultResponse(models::Errors),
375    UnknownValue(serde_json::Value),
376}
377
378/// struct for typed errors of method [`create_lambda`]
379#[derive(Debug, Clone, Serialize, Deserialize)]
380#[serde(untagged)]
381pub enum CreateLambdaError {
382    DefaultResponse(models::Errors),
383    UnknownValue(serde_json::Value),
384}
385
386/// struct for typed errors of method [`create_lambda_with_id`]
387#[derive(Debug, Clone, Serialize, Deserialize)]
388#[serde(untagged)]
389pub enum CreateLambdaWithIdError {
390    DefaultResponse(models::Errors),
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`create_logout`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum CreateLogoutError {
398    DefaultResponse(),
399    UnknownValue(serde_json::Value),
400}
401
402/// struct for typed errors of method [`create_message_template`]
403#[derive(Debug, Clone, Serialize, Deserialize)]
404#[serde(untagged)]
405pub enum CreateMessageTemplateError {
406    DefaultResponse(models::Errors),
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`create_message_template_with_id`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum CreateMessageTemplateWithIdError {
414    DefaultResponse(models::Errors),
415    UnknownValue(serde_json::Value),
416}
417
418/// struct for typed errors of method [`create_messenger`]
419#[derive(Debug, Clone, Serialize, Deserialize)]
420#[serde(untagged)]
421pub enum CreateMessengerError {
422    DefaultResponse(models::Errors),
423    UnknownValue(serde_json::Value),
424}
425
426/// struct for typed errors of method [`create_messenger_with_id`]
427#[derive(Debug, Clone, Serialize, Deserialize)]
428#[serde(untagged)]
429pub enum CreateMessengerWithIdError {
430    DefaultResponse(models::Errors),
431    UnknownValue(serde_json::Value),
432}
433
434/// struct for typed errors of method [`create_o_auth_scope`]
435#[derive(Debug, Clone, Serialize, Deserialize)]
436#[serde(untagged)]
437pub enum CreateOAuthScopeError {
438    DefaultResponse(models::Errors),
439    UnknownValue(serde_json::Value),
440}
441
442/// struct for typed errors of method [`create_o_auth_scope_with_id`]
443#[derive(Debug, Clone, Serialize, Deserialize)]
444#[serde(untagged)]
445pub enum CreateOAuthScopeWithIdError {
446    DefaultResponse(models::Errors),
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`create_tenant`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum CreateTenantError {
454    DefaultResponse(models::Errors),
455    UnknownValue(serde_json::Value),
456}
457
458/// struct for typed errors of method [`create_tenant_with_id`]
459#[derive(Debug, Clone, Serialize, Deserialize)]
460#[serde(untagged)]
461pub enum CreateTenantWithIdError {
462    DefaultResponse(models::Errors),
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`create_theme`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum CreateThemeError {
470    DefaultResponse(models::Errors),
471    UnknownValue(serde_json::Value),
472}
473
474/// struct for typed errors of method [`create_theme_with_id`]
475#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(untagged)]
477pub enum CreateThemeWithIdError {
478    DefaultResponse(models::Errors),
479    UnknownValue(serde_json::Value),
480}
481
482/// struct for typed errors of method [`create_token`]
483#[derive(Debug, Clone, Serialize, Deserialize)]
484#[serde(untagged)]
485pub enum CreateTokenError {
486    DefaultResponse(models::OAuthError),
487    UnknownValue(serde_json::Value),
488}
489
490/// struct for typed errors of method [`create_user`]
491#[derive(Debug, Clone, Serialize, Deserialize)]
492#[serde(untagged)]
493pub enum CreateUserError {
494    DefaultResponse(models::Errors),
495    UnknownValue(serde_json::Value),
496}
497
498/// struct for typed errors of method [`create_user_action`]
499#[derive(Debug, Clone, Serialize, Deserialize)]
500#[serde(untagged)]
501pub enum CreateUserActionError {
502    DefaultResponse(models::Errors),
503    UnknownValue(serde_json::Value),
504}
505
506/// struct for typed errors of method [`create_user_action_reason`]
507#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum CreateUserActionReasonError {
510    DefaultResponse(models::Errors),
511    UnknownValue(serde_json::Value),
512}
513
514/// struct for typed errors of method [`create_user_action_reason_with_id`]
515#[derive(Debug, Clone, Serialize, Deserialize)]
516#[serde(untagged)]
517pub enum CreateUserActionReasonWithIdError {
518    DefaultResponse(models::Errors),
519    UnknownValue(serde_json::Value),
520}
521
522/// struct for typed errors of method [`create_user_action_with_id`]
523#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum CreateUserActionWithIdError {
526    DefaultResponse(models::Errors),
527    UnknownValue(serde_json::Value),
528}
529
530/// struct for typed errors of method [`create_user_change_password`]
531#[derive(Debug, Clone, Serialize, Deserialize)]
532#[serde(untagged)]
533pub enum CreateUserChangePasswordError {
534    DefaultResponse(models::Errors),
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`create_user_consent`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum CreateUserConsentError {
542    DefaultResponse(models::Errors),
543    UnknownValue(serde_json::Value),
544}
545
546/// struct for typed errors of method [`create_user_consent_with_id`]
547#[derive(Debug, Clone, Serialize, Deserialize)]
548#[serde(untagged)]
549pub enum CreateUserConsentWithIdError {
550    DefaultResponse(models::Errors),
551    UnknownValue(serde_json::Value),
552}
553
554/// struct for typed errors of method [`create_user_link_with_id`]
555#[derive(Debug, Clone, Serialize, Deserialize)]
556#[serde(untagged)]
557pub enum CreateUserLinkWithIdError {
558    DefaultResponse(models::Errors),
559    UnknownValue(serde_json::Value),
560}
561
562/// struct for typed errors of method [`create_user_verify_email`]
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum CreateUserVerifyEmailError {
566    DefaultResponse(models::Errors),
567    UnknownValue(serde_json::Value),
568}
569
570/// struct for typed errors of method [`create_user_with_id`]
571#[derive(Debug, Clone, Serialize, Deserialize)]
572#[serde(untagged)]
573pub enum CreateUserWithIdError {
574    DefaultResponse(models::Errors),
575    UnknownValue(serde_json::Value),
576}
577
578/// struct for typed errors of method [`create_webhook`]
579#[derive(Debug, Clone, Serialize, Deserialize)]
580#[serde(untagged)]
581pub enum CreateWebhookError {
582    DefaultResponse(models::Errors),
583    UnknownValue(serde_json::Value),
584}
585
586/// struct for typed errors of method [`create_webhook_with_id`]
587#[derive(Debug, Clone, Serialize, Deserialize)]
588#[serde(untagged)]
589pub enum CreateWebhookWithIdError {
590    DefaultResponse(models::Errors),
591    UnknownValue(serde_json::Value),
592}
593
594/// struct for typed errors of method [`delete_api_key_with_id`]
595#[derive(Debug, Clone, Serialize, Deserialize)]
596#[serde(untagged)]
597pub enum DeleteApiKeyWithIdError {
598    DefaultResponse(models::Errors),
599    UnknownValue(serde_json::Value),
600}
601
602/// struct for typed errors of method [`delete_application_role_with_id`]
603#[derive(Debug, Clone, Serialize, Deserialize)]
604#[serde(untagged)]
605pub enum DeleteApplicationRoleWithIdError {
606    DefaultResponse(models::Errors),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`delete_application_with_id`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum DeleteApplicationWithIdError {
614    DefaultResponse(models::Errors),
615    UnknownValue(serde_json::Value),
616}
617
618/// struct for typed errors of method [`delete_connector_with_id`]
619#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum DeleteConnectorWithIdError {
622    DefaultResponse(models::Errors),
623    UnknownValue(serde_json::Value),
624}
625
626/// struct for typed errors of method [`delete_consent_with_id`]
627#[derive(Debug, Clone, Serialize, Deserialize)]
628#[serde(untagged)]
629pub enum DeleteConsentWithIdError {
630    DefaultResponse(models::Errors),
631    UnknownValue(serde_json::Value),
632}
633
634/// struct for typed errors of method [`delete_email_template_with_id`]
635#[derive(Debug, Clone, Serialize, Deserialize)]
636#[serde(untagged)]
637pub enum DeleteEmailTemplateWithIdError {
638    DefaultResponse(models::Errors),
639    UnknownValue(serde_json::Value),
640}
641
642/// struct for typed errors of method [`delete_entity_grant_with_id`]
643#[derive(Debug, Clone, Serialize, Deserialize)]
644#[serde(untagged)]
645pub enum DeleteEntityGrantWithIdError {
646    DefaultResponse(models::Errors),
647    UnknownValue(serde_json::Value),
648}
649
650/// struct for typed errors of method [`delete_entity_type_permission_with_id`]
651#[derive(Debug, Clone, Serialize, Deserialize)]
652#[serde(untagged)]
653pub enum DeleteEntityTypePermissionWithIdError {
654    DefaultResponse(models::Errors),
655    UnknownValue(serde_json::Value),
656}
657
658/// struct for typed errors of method [`delete_entity_type_with_id`]
659#[derive(Debug, Clone, Serialize, Deserialize)]
660#[serde(untagged)]
661pub enum DeleteEntityTypeWithIdError {
662    DefaultResponse(models::Errors),
663    UnknownValue(serde_json::Value),
664}
665
666/// struct for typed errors of method [`delete_entity_with_id`]
667#[derive(Debug, Clone, Serialize, Deserialize)]
668#[serde(untagged)]
669pub enum DeleteEntityWithIdError {
670    DefaultResponse(models::Errors),
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`delete_form_field_with_id`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum DeleteFormFieldWithIdError {
678    DefaultResponse(models::Errors),
679    UnknownValue(serde_json::Value),
680}
681
682/// struct for typed errors of method [`delete_form_with_id`]
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum DeleteFormWithIdError {
686    DefaultResponse(models::Errors),
687    UnknownValue(serde_json::Value),
688}
689
690/// struct for typed errors of method [`delete_group_members_with_id`]
691#[derive(Debug, Clone, Serialize, Deserialize)]
692#[serde(untagged)]
693pub enum DeleteGroupMembersWithIdError {
694    DefaultResponse(models::Errors),
695    UnknownValue(serde_json::Value),
696}
697
698/// struct for typed errors of method [`delete_group_with_id`]
699#[derive(Debug, Clone, Serialize, Deserialize)]
700#[serde(untagged)]
701pub enum DeleteGroupWithIdError {
702    DefaultResponse(models::Errors),
703    UnknownValue(serde_json::Value),
704}
705
706/// struct for typed errors of method [`delete_identity_provider_with_id`]
707#[derive(Debug, Clone, Serialize, Deserialize)]
708#[serde(untagged)]
709pub enum DeleteIdentityProviderWithIdError {
710    DefaultResponse(models::Errors),
711    UnknownValue(serde_json::Value),
712}
713
714/// struct for typed errors of method [`delete_ip_access_control_list_with_id`]
715#[derive(Debug, Clone, Serialize, Deserialize)]
716#[serde(untagged)]
717pub enum DeleteIpAccessControlListWithIdError {
718    DefaultResponse(models::Errors),
719    UnknownValue(serde_json::Value),
720}
721
722/// struct for typed errors of method [`delete_jwt_refresh`]
723#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum DeleteJwtRefreshError {
726    DefaultResponse(models::Errors),
727    UnknownValue(serde_json::Value),
728}
729
730/// struct for typed errors of method [`delete_key_with_id`]
731#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum DeleteKeyWithIdError {
734    DefaultResponse(models::Errors),
735    UnknownValue(serde_json::Value),
736}
737
738/// struct for typed errors of method [`delete_lambda_with_id`]
739#[derive(Debug, Clone, Serialize, Deserialize)]
740#[serde(untagged)]
741pub enum DeleteLambdaWithIdError {
742    DefaultResponse(models::Errors),
743    UnknownValue(serde_json::Value),
744}
745
746/// struct for typed errors of method [`delete_message_template_with_id`]
747#[derive(Debug, Clone, Serialize, Deserialize)]
748#[serde(untagged)]
749pub enum DeleteMessageTemplateWithIdError {
750    DefaultResponse(models::Errors),
751    UnknownValue(serde_json::Value),
752}
753
754/// struct for typed errors of method [`delete_messenger_with_id`]
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum DeleteMessengerWithIdError {
758    DefaultResponse(models::Errors),
759    UnknownValue(serde_json::Value),
760}
761
762/// struct for typed errors of method [`delete_o_auth_scope_with_id`]
763#[derive(Debug, Clone, Serialize, Deserialize)]
764#[serde(untagged)]
765pub enum DeleteOAuthScopeWithIdError {
766    DefaultResponse(models::Errors),
767    UnknownValue(serde_json::Value),
768}
769
770/// struct for typed errors of method [`delete_tenant_with_id`]
771#[derive(Debug, Clone, Serialize, Deserialize)]
772#[serde(untagged)]
773pub enum DeleteTenantWithIdError {
774    DefaultResponse(models::Errors),
775    UnknownValue(serde_json::Value),
776}
777
778/// struct for typed errors of method [`delete_theme_with_id`]
779#[derive(Debug, Clone, Serialize, Deserialize)]
780#[serde(untagged)]
781pub enum DeleteThemeWithIdError {
782    DefaultResponse(models::Errors),
783    UnknownValue(serde_json::Value),
784}
785
786/// struct for typed errors of method [`delete_user_action_reason_with_id`]
787#[derive(Debug, Clone, Serialize, Deserialize)]
788#[serde(untagged)]
789pub enum DeleteUserActionReasonWithIdError {
790    DefaultResponse(models::Errors),
791    UnknownValue(serde_json::Value),
792}
793
794/// struct for typed errors of method [`delete_user_action_with_id`]
795#[derive(Debug, Clone, Serialize, Deserialize)]
796#[serde(untagged)]
797pub enum DeleteUserActionWithIdError {
798    DefaultResponse(models::Errors),
799    UnknownValue(serde_json::Value),
800}
801
802/// struct for typed errors of method [`delete_user_bulk`]
803#[derive(Debug, Clone, Serialize, Deserialize)]
804#[serde(untagged)]
805pub enum DeleteUserBulkError {
806    DefaultResponse(models::Errors),
807    UnknownValue(serde_json::Value),
808}
809
810/// struct for typed errors of method [`delete_user_link_with_id`]
811#[derive(Debug, Clone, Serialize, Deserialize)]
812#[serde(untagged)]
813pub enum DeleteUserLinkWithIdError {
814    DefaultResponse(models::Errors),
815    UnknownValue(serde_json::Value),
816}
817
818/// struct for typed errors of method [`delete_user_registration_with_id`]
819#[derive(Debug, Clone, Serialize, Deserialize)]
820#[serde(untagged)]
821pub enum DeleteUserRegistrationWithIdError {
822    DefaultResponse(models::Errors),
823    UnknownValue(serde_json::Value),
824}
825
826/// struct for typed errors of method [`delete_user_two_factor_with_id`]
827#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum DeleteUserTwoFactorWithIdError {
830    DefaultResponse(models::Errors),
831    UnknownValue(serde_json::Value),
832}
833
834/// struct for typed errors of method [`delete_user_with_id`]
835#[derive(Debug, Clone, Serialize, Deserialize)]
836#[serde(untagged)]
837pub enum DeleteUserWithIdError {
838    DefaultResponse(models::Errors),
839    UnknownValue(serde_json::Value),
840}
841
842/// struct for typed errors of method [`delete_web_authn_credential_with_id`]
843#[derive(Debug, Clone, Serialize, Deserialize)]
844#[serde(untagged)]
845pub enum DeleteWebAuthnCredentialWithIdError {
846    DefaultResponse(models::Errors),
847    UnknownValue(serde_json::Value),
848}
849
850/// struct for typed errors of method [`delete_webhook_with_id`]
851#[derive(Debug, Clone, Serialize, Deserialize)]
852#[serde(untagged)]
853pub enum DeleteWebhookWithIdError {
854    DefaultResponse(models::Errors),
855    UnknownValue(serde_json::Value),
856}
857
858/// struct for typed errors of method [`enable_two_factor_with_id`]
859#[derive(Debug, Clone, Serialize, Deserialize)]
860#[serde(untagged)]
861pub enum EnableTwoFactorWithIdError {
862    DefaultResponse(models::Errors),
863    UnknownValue(serde_json::Value),
864}
865
866/// struct for typed errors of method [`exchange_refresh_token_for_jwt_with_id`]
867#[derive(Debug, Clone, Serialize, Deserialize)]
868#[serde(untagged)]
869pub enum ExchangeRefreshTokenForJwtWithIdError {
870    DefaultResponse(models::Errors),
871    UnknownValue(serde_json::Value),
872}
873
874/// struct for typed errors of method [`forgot_password_with_id`]
875#[derive(Debug, Clone, Serialize, Deserialize)]
876#[serde(untagged)]
877pub enum ForgotPasswordWithIdError {
878    DefaultResponse(models::Errors),
879    UnknownValue(serde_json::Value),
880}
881
882/// struct for typed errors of method [`generate_key`]
883#[derive(Debug, Clone, Serialize, Deserialize)]
884#[serde(untagged)]
885pub enum GenerateKeyError {
886    DefaultResponse(models::Errors),
887    UnknownValue(serde_json::Value),
888}
889
890/// struct for typed errors of method [`generate_key_with_id`]
891#[derive(Debug, Clone, Serialize, Deserialize)]
892#[serde(untagged)]
893pub enum GenerateKeyWithIdError {
894    DefaultResponse(models::Errors),
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`generate_two_factor_recovery_codes_with_id`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum GenerateTwoFactorRecoveryCodesWithIdError {
902    DefaultResponse(models::Errors),
903    UnknownValue(serde_json::Value),
904}
905
906/// struct for typed errors of method [`generate_two_factor_secret_using_jwt_with_id`]
907#[derive(Debug, Clone, Serialize, Deserialize)]
908#[serde(untagged)]
909pub enum GenerateTwoFactorSecretUsingJwtWithIdError {
910    DefaultResponse(),
911    UnknownValue(serde_json::Value),
912}
913
914/// struct for typed errors of method [`identity_provider_login_with_id`]
915#[derive(Debug, Clone, Serialize, Deserialize)]
916#[serde(untagged)]
917pub enum IdentityProviderLoginWithIdError {
918    DefaultResponse(models::Errors),
919    UnknownValue(serde_json::Value),
920}
921
922/// struct for typed errors of method [`import_key`]
923#[derive(Debug, Clone, Serialize, Deserialize)]
924#[serde(untagged)]
925pub enum ImportKeyError {
926    DefaultResponse(models::Errors),
927    UnknownValue(serde_json::Value),
928}
929
930/// struct for typed errors of method [`import_key_with_id`]
931#[derive(Debug, Clone, Serialize, Deserialize)]
932#[serde(untagged)]
933pub enum ImportKeyWithIdError {
934    DefaultResponse(models::Errors),
935    UnknownValue(serde_json::Value),
936}
937
938/// struct for typed errors of method [`import_refresh_tokens_with_id`]
939#[derive(Debug, Clone, Serialize, Deserialize)]
940#[serde(untagged)]
941pub enum ImportRefreshTokensWithIdError {
942    DefaultResponse(models::Errors),
943    UnknownValue(serde_json::Value),
944}
945
946/// struct for typed errors of method [`import_users_with_id`]
947#[derive(Debug, Clone, Serialize, Deserialize)]
948#[serde(untagged)]
949pub enum ImportUsersWithIdError {
950    DefaultResponse(models::Errors),
951    UnknownValue(serde_json::Value),
952}
953
954/// struct for typed errors of method [`import_web_authn_credential_with_id`]
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(untagged)]
957pub enum ImportWebAuthnCredentialWithIdError {
958    DefaultResponse(models::Errors),
959    UnknownValue(serde_json::Value),
960}
961
962/// struct for typed errors of method [`issue_jwt_with_id`]
963#[derive(Debug, Clone, Serialize, Deserialize)]
964#[serde(untagged)]
965pub enum IssueJwtWithIdError {
966    DefaultResponse(models::Errors),
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`login_ping_with_id`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum LoginPingWithIdError {
974    DefaultResponse(models::Errors),
975    UnknownValue(serde_json::Value),
976}
977
978/// struct for typed errors of method [`login_ping_with_request_with_id`]
979#[derive(Debug, Clone, Serialize, Deserialize)]
980#[serde(untagged)]
981pub enum LoginPingWithRequestWithIdError {
982    DefaultResponse(models::Errors),
983    UnknownValue(serde_json::Value),
984}
985
986/// struct for typed errors of method [`login_with_id`]
987#[derive(Debug, Clone, Serialize, Deserialize)]
988#[serde(untagged)]
989pub enum LoginWithIdError {
990    DefaultResponse(models::Errors),
991    UnknownValue(serde_json::Value),
992}
993
994/// struct for typed errors of method [`lookup_identity_provider_with_id`]
995#[derive(Debug, Clone, Serialize, Deserialize)]
996#[serde(untagged)]
997pub enum LookupIdentityProviderWithIdError {
998    DefaultResponse(),
999    UnknownValue(serde_json::Value),
1000}
1001
1002/// struct for typed errors of method [`modify_action_with_id`]
1003#[derive(Debug, Clone, Serialize, Deserialize)]
1004#[serde(untagged)]
1005pub enum ModifyActionWithIdError {
1006    DefaultResponse(models::Errors),
1007    UnknownValue(serde_json::Value),
1008}
1009
1010/// struct for typed errors of method [`passwordless_login_with_id`]
1011#[derive(Debug, Clone, Serialize, Deserialize)]
1012#[serde(untagged)]
1013pub enum PasswordlessLoginWithIdError {
1014    DefaultResponse(models::Errors),
1015    UnknownValue(serde_json::Value),
1016}
1017
1018/// struct for typed errors of method [`patch_api_key_with_id`]
1019#[derive(Debug, Clone, Serialize, Deserialize)]
1020#[serde(untagged)]
1021pub enum PatchApiKeyWithIdError {
1022    DefaultResponse(models::Errors),
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`patch_application_role_with_id`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum PatchApplicationRoleWithIdError {
1030    DefaultResponse(models::Errors),
1031    UnknownValue(serde_json::Value),
1032}
1033
1034/// struct for typed errors of method [`patch_application_with_id`]
1035#[derive(Debug, Clone, Serialize, Deserialize)]
1036#[serde(untagged)]
1037pub enum PatchApplicationWithIdError {
1038    DefaultResponse(models::Errors),
1039    UnknownValue(serde_json::Value),
1040}
1041
1042/// struct for typed errors of method [`patch_connector_with_id`]
1043#[derive(Debug, Clone, Serialize, Deserialize)]
1044#[serde(untagged)]
1045pub enum PatchConnectorWithIdError {
1046    DefaultResponse(models::Errors),
1047    UnknownValue(serde_json::Value),
1048}
1049
1050/// struct for typed errors of method [`patch_consent_with_id`]
1051#[derive(Debug, Clone, Serialize, Deserialize)]
1052#[serde(untagged)]
1053pub enum PatchConsentWithIdError {
1054    DefaultResponse(models::Errors),
1055    UnknownValue(serde_json::Value),
1056}
1057
1058/// struct for typed errors of method [`patch_email_template_with_id`]
1059#[derive(Debug, Clone, Serialize, Deserialize)]
1060#[serde(untagged)]
1061pub enum PatchEmailTemplateWithIdError {
1062    DefaultResponse(models::Errors),
1063    UnknownValue(serde_json::Value),
1064}
1065
1066/// struct for typed errors of method [`patch_entity_type_permission_with_id`]
1067#[derive(Debug, Clone, Serialize, Deserialize)]
1068#[serde(untagged)]
1069pub enum PatchEntityTypePermissionWithIdError {
1070    DefaultResponse(models::Errors),
1071    UnknownValue(serde_json::Value),
1072}
1073
1074/// struct for typed errors of method [`patch_entity_type_with_id`]
1075#[derive(Debug, Clone, Serialize, Deserialize)]
1076#[serde(untagged)]
1077pub enum PatchEntityTypeWithIdError {
1078    DefaultResponse(models::Errors),
1079    UnknownValue(serde_json::Value),
1080}
1081
1082/// struct for typed errors of method [`patch_entity_with_id`]
1083#[derive(Debug, Clone, Serialize, Deserialize)]
1084#[serde(untagged)]
1085pub enum PatchEntityWithIdError {
1086    DefaultResponse(models::Errors),
1087    UnknownValue(serde_json::Value),
1088}
1089
1090/// struct for typed errors of method [`patch_form_field_with_id`]
1091#[derive(Debug, Clone, Serialize, Deserialize)]
1092#[serde(untagged)]
1093pub enum PatchFormFieldWithIdError {
1094    DefaultResponse(models::Errors),
1095    UnknownValue(serde_json::Value),
1096}
1097
1098/// struct for typed errors of method [`patch_form_with_id`]
1099#[derive(Debug, Clone, Serialize, Deserialize)]
1100#[serde(untagged)]
1101pub enum PatchFormWithIdError {
1102    DefaultResponse(models::Errors),
1103    UnknownValue(serde_json::Value),
1104}
1105
1106/// struct for typed errors of method [`patch_group_with_id`]
1107#[derive(Debug, Clone, Serialize, Deserialize)]
1108#[serde(untagged)]
1109pub enum PatchGroupWithIdError {
1110    DefaultResponse(models::Errors),
1111    UnknownValue(serde_json::Value),
1112}
1113
1114/// struct for typed errors of method [`patch_identity_provider_with_id`]
1115#[derive(Debug, Clone, Serialize, Deserialize)]
1116#[serde(untagged)]
1117pub enum PatchIdentityProviderWithIdError {
1118    DefaultResponse(models::Errors),
1119    UnknownValue(serde_json::Value),
1120}
1121
1122/// struct for typed errors of method [`patch_integrations_with_id`]
1123#[derive(Debug, Clone, Serialize, Deserialize)]
1124#[serde(untagged)]
1125pub enum PatchIntegrationsWithIdError {
1126    DefaultResponse(models::Errors),
1127    UnknownValue(serde_json::Value),
1128}
1129
1130/// struct for typed errors of method [`patch_ip_access_control_list_with_id`]
1131#[derive(Debug, Clone, Serialize, Deserialize)]
1132#[serde(untagged)]
1133pub enum PatchIpAccessControlListWithIdError {
1134    DefaultResponse(models::Errors),
1135    UnknownValue(serde_json::Value),
1136}
1137
1138/// struct for typed errors of method [`patch_lambda_with_id`]
1139#[derive(Debug, Clone, Serialize, Deserialize)]
1140#[serde(untagged)]
1141pub enum PatchLambdaWithIdError {
1142    DefaultResponse(models::Errors),
1143    UnknownValue(serde_json::Value),
1144}
1145
1146/// struct for typed errors of method [`patch_message_template_with_id`]
1147#[derive(Debug, Clone, Serialize, Deserialize)]
1148#[serde(untagged)]
1149pub enum PatchMessageTemplateWithIdError {
1150    DefaultResponse(models::Errors),
1151    UnknownValue(serde_json::Value),
1152}
1153
1154/// struct for typed errors of method [`patch_messenger_with_id`]
1155#[derive(Debug, Clone, Serialize, Deserialize)]
1156#[serde(untagged)]
1157pub enum PatchMessengerWithIdError {
1158    DefaultResponse(models::Errors),
1159    UnknownValue(serde_json::Value),
1160}
1161
1162/// struct for typed errors of method [`patch_o_auth_scope_with_id`]
1163#[derive(Debug, Clone, Serialize, Deserialize)]
1164#[serde(untagged)]
1165pub enum PatchOAuthScopeWithIdError {
1166    DefaultResponse(models::Errors),
1167    UnknownValue(serde_json::Value),
1168}
1169
1170/// struct for typed errors of method [`patch_registration_with_id`]
1171#[derive(Debug, Clone, Serialize, Deserialize)]
1172#[serde(untagged)]
1173pub enum PatchRegistrationWithIdError {
1174    DefaultResponse(models::Errors),
1175    UnknownValue(serde_json::Value),
1176}
1177
1178/// struct for typed errors of method [`patch_system_configuration_with_id`]
1179#[derive(Debug, Clone, Serialize, Deserialize)]
1180#[serde(untagged)]
1181pub enum PatchSystemConfigurationWithIdError {
1182    DefaultResponse(models::Errors),
1183    UnknownValue(serde_json::Value),
1184}
1185
1186/// struct for typed errors of method [`patch_tenant_with_id`]
1187#[derive(Debug, Clone, Serialize, Deserialize)]
1188#[serde(untagged)]
1189pub enum PatchTenantWithIdError {
1190    DefaultResponse(models::Errors),
1191    UnknownValue(serde_json::Value),
1192}
1193
1194/// struct for typed errors of method [`patch_theme_with_id`]
1195#[derive(Debug, Clone, Serialize, Deserialize)]
1196#[serde(untagged)]
1197pub enum PatchThemeWithIdError {
1198    DefaultResponse(models::Errors),
1199    UnknownValue(serde_json::Value),
1200}
1201
1202/// struct for typed errors of method [`patch_user_action_reason_with_id`]
1203#[derive(Debug, Clone, Serialize, Deserialize)]
1204#[serde(untagged)]
1205pub enum PatchUserActionReasonWithIdError {
1206    DefaultResponse(models::Errors),
1207    UnknownValue(serde_json::Value),
1208}
1209
1210/// struct for typed errors of method [`patch_user_action_with_id`]
1211#[derive(Debug, Clone, Serialize, Deserialize)]
1212#[serde(untagged)]
1213pub enum PatchUserActionWithIdError {
1214    DefaultResponse(models::Errors),
1215    UnknownValue(serde_json::Value),
1216}
1217
1218/// struct for typed errors of method [`patch_user_consent_with_id`]
1219#[derive(Debug, Clone, Serialize, Deserialize)]
1220#[serde(untagged)]
1221pub enum PatchUserConsentWithIdError {
1222    DefaultResponse(models::Errors),
1223    UnknownValue(serde_json::Value),
1224}
1225
1226/// struct for typed errors of method [`patch_user_with_id`]
1227#[derive(Debug, Clone, Serialize, Deserialize)]
1228#[serde(untagged)]
1229pub enum PatchUserWithIdError {
1230    DefaultResponse(models::Errors),
1231    UnknownValue(serde_json::Value),
1232}
1233
1234/// struct for typed errors of method [`patch_webhook_with_id`]
1235#[derive(Debug, Clone, Serialize, Deserialize)]
1236#[serde(untagged)]
1237pub enum PatchWebhookWithIdError {
1238    DefaultResponse(models::Errors),
1239    UnknownValue(serde_json::Value),
1240}
1241
1242/// struct for typed errors of method [`reconcile_jwt_with_id`]
1243#[derive(Debug, Clone, Serialize, Deserialize)]
1244#[serde(untagged)]
1245pub enum ReconcileJwtWithIdError {
1246    DefaultResponse(models::Errors),
1247    UnknownValue(serde_json::Value),
1248}
1249
1250/// struct for typed errors of method [`register`]
1251#[derive(Debug, Clone, Serialize, Deserialize)]
1252#[serde(untagged)]
1253pub enum RegisterError {
1254    DefaultResponse(models::Errors),
1255    UnknownValue(serde_json::Value),
1256}
1257
1258/// struct for typed errors of method [`register_with_id`]
1259#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum RegisterWithIdError {
1262    DefaultResponse(models::Errors),
1263    UnknownValue(serde_json::Value),
1264}
1265
1266/// struct for typed errors of method [`reindex_with_id`]
1267#[derive(Debug, Clone, Serialize, Deserialize)]
1268#[serde(untagged)]
1269pub enum ReindexWithIdError {
1270    DefaultResponse(models::Errors),
1271    UnknownValue(serde_json::Value),
1272}
1273
1274/// struct for typed errors of method [`remove_user_from_family_with_id`]
1275#[derive(Debug, Clone, Serialize, Deserialize)]
1276#[serde(untagged)]
1277pub enum RemoveUserFromFamilyWithIdError {
1278    DefaultResponse(models::Errors),
1279    UnknownValue(serde_json::Value),
1280}
1281
1282/// struct for typed errors of method [`retrieve_action_with_id`]
1283#[derive(Debug, Clone, Serialize, Deserialize)]
1284#[serde(untagged)]
1285pub enum RetrieveActionWithIdError {
1286    DefaultResponse(models::Errors),
1287    UnknownValue(serde_json::Value),
1288}
1289
1290/// struct for typed errors of method [`retrieve_api_key_with_id`]
1291#[derive(Debug, Clone, Serialize, Deserialize)]
1292#[serde(untagged)]
1293pub enum RetrieveApiKeyWithIdError {
1294    DefaultResponse(models::Errors),
1295    UnknownValue(serde_json::Value),
1296}
1297
1298/// struct for typed errors of method [`retrieve_application`]
1299#[derive(Debug, Clone, Serialize, Deserialize)]
1300#[serde(untagged)]
1301pub enum RetrieveApplicationError {
1302    DefaultResponse(),
1303    UnknownValue(serde_json::Value),
1304}
1305
1306/// struct for typed errors of method [`retrieve_application_with_id`]
1307#[derive(Debug, Clone, Serialize, Deserialize)]
1308#[serde(untagged)]
1309pub enum RetrieveApplicationWithIdError {
1310    DefaultResponse(),
1311    UnknownValue(serde_json::Value),
1312}
1313
1314/// struct for typed errors of method [`retrieve_audit_log_with_id`]
1315#[derive(Debug, Clone, Serialize, Deserialize)]
1316#[serde(untagged)]
1317pub enum RetrieveAuditLogWithIdError {
1318    DefaultResponse(models::Errors),
1319    UnknownValue(serde_json::Value),
1320}
1321
1322/// struct for typed errors of method [`retrieve_connector_with_id`]
1323#[derive(Debug, Clone, Serialize, Deserialize)]
1324#[serde(untagged)]
1325pub enum RetrieveConnectorWithIdError {
1326    DefaultResponse(),
1327    UnknownValue(serde_json::Value),
1328}
1329
1330/// struct for typed errors of method [`retrieve_consent_with_id`]
1331#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum RetrieveConsentWithIdError {
1334    DefaultResponse(),
1335    UnknownValue(serde_json::Value),
1336}
1337
1338/// struct for typed errors of method [`retrieve_daily_active_report_with_id`]
1339#[derive(Debug, Clone, Serialize, Deserialize)]
1340#[serde(untagged)]
1341pub enum RetrieveDailyActiveReportWithIdError {
1342    DefaultResponse(models::Errors),
1343    UnknownValue(serde_json::Value),
1344}
1345
1346/// struct for typed errors of method [`retrieve_device_user_code`]
1347#[derive(Debug, Clone, Serialize, Deserialize)]
1348#[serde(untagged)]
1349pub enum RetrieveDeviceUserCodeError {
1350    DefaultResponse(),
1351    UnknownValue(serde_json::Value),
1352}
1353
1354/// struct for typed errors of method [`retrieve_device_validate`]
1355#[derive(Debug, Clone, Serialize, Deserialize)]
1356#[serde(untagged)]
1357pub enum RetrieveDeviceValidateError {
1358    DefaultResponse(),
1359    UnknownValue(serde_json::Value),
1360}
1361
1362/// struct for typed errors of method [`retrieve_email_template`]
1363#[derive(Debug, Clone, Serialize, Deserialize)]
1364#[serde(untagged)]
1365pub enum RetrieveEmailTemplateError {
1366    DefaultResponse(),
1367    UnknownValue(serde_json::Value),
1368}
1369
1370/// struct for typed errors of method [`retrieve_email_template_preview_with_id`]
1371#[derive(Debug, Clone, Serialize, Deserialize)]
1372#[serde(untagged)]
1373pub enum RetrieveEmailTemplatePreviewWithIdError {
1374    DefaultResponse(models::Errors),
1375    UnknownValue(serde_json::Value),
1376}
1377
1378/// struct for typed errors of method [`retrieve_email_template_with_id`]
1379#[derive(Debug, Clone, Serialize, Deserialize)]
1380#[serde(untagged)]
1381pub enum RetrieveEmailTemplateWithIdError {
1382    DefaultResponse(),
1383    UnknownValue(serde_json::Value),
1384}
1385
1386/// struct for typed errors of method [`retrieve_entity_grant_with_id`]
1387#[derive(Debug, Clone, Serialize, Deserialize)]
1388#[serde(untagged)]
1389pub enum RetrieveEntityGrantWithIdError {
1390    DefaultResponse(models::Errors),
1391    UnknownValue(serde_json::Value),
1392}
1393
1394/// struct for typed errors of method [`retrieve_entity_type_with_id`]
1395#[derive(Debug, Clone, Serialize, Deserialize)]
1396#[serde(untagged)]
1397pub enum RetrieveEntityTypeWithIdError {
1398    DefaultResponse(models::Errors),
1399    UnknownValue(serde_json::Value),
1400}
1401
1402/// struct for typed errors of method [`retrieve_entity_with_id`]
1403#[derive(Debug, Clone, Serialize, Deserialize)]
1404#[serde(untagged)]
1405pub enum RetrieveEntityWithIdError {
1406    DefaultResponse(models::Errors),
1407    UnknownValue(serde_json::Value),
1408}
1409
1410/// struct for typed errors of method [`retrieve_event_log_with_id`]
1411#[derive(Debug, Clone, Serialize, Deserialize)]
1412#[serde(untagged)]
1413pub enum RetrieveEventLogWithIdError {
1414    DefaultResponse(models::Errors),
1415    UnknownValue(serde_json::Value),
1416}
1417
1418/// struct for typed errors of method [`retrieve_families_with_id`]
1419#[derive(Debug, Clone, Serialize, Deserialize)]
1420#[serde(untagged)]
1421pub enum RetrieveFamiliesWithIdError {
1422    DefaultResponse(),
1423    UnknownValue(serde_json::Value),
1424}
1425
1426/// struct for typed errors of method [`retrieve_family_members_by_family_id_with_id`]
1427#[derive(Debug, Clone, Serialize, Deserialize)]
1428#[serde(untagged)]
1429pub enum RetrieveFamilyMembersByFamilyIdWithIdError {
1430    DefaultResponse(),
1431    UnknownValue(serde_json::Value),
1432}
1433
1434/// struct for typed errors of method [`retrieve_form_field_with_id`]
1435#[derive(Debug, Clone, Serialize, Deserialize)]
1436#[serde(untagged)]
1437pub enum RetrieveFormFieldWithIdError {
1438    DefaultResponse(),
1439    UnknownValue(serde_json::Value),
1440}
1441
1442/// struct for typed errors of method [`retrieve_form_with_id`]
1443#[derive(Debug, Clone, Serialize, Deserialize)]
1444#[serde(untagged)]
1445pub enum RetrieveFormWithIdError {
1446    DefaultResponse(),
1447    UnknownValue(serde_json::Value),
1448}
1449
1450/// struct for typed errors of method [`retrieve_group_with_id`]
1451#[derive(Debug, Clone, Serialize, Deserialize)]
1452#[serde(untagged)]
1453pub enum RetrieveGroupWithIdError {
1454    DefaultResponse(models::Errors),
1455    UnknownValue(serde_json::Value),
1456}
1457
1458/// struct for typed errors of method [`retrieve_identity_provider_by_type_with_id`]
1459#[derive(Debug, Clone, Serialize, Deserialize)]
1460#[serde(untagged)]
1461pub enum RetrieveIdentityProviderByTypeWithIdError {
1462    DefaultResponse(models::Errors),
1463    UnknownValue(serde_json::Value),
1464}
1465
1466/// struct for typed errors of method [`retrieve_identity_provider_link`]
1467#[derive(Debug, Clone, Serialize, Deserialize)]
1468#[serde(untagged)]
1469pub enum RetrieveIdentityProviderLinkError {
1470    DefaultResponse(models::Errors),
1471    UnknownValue(serde_json::Value),
1472}
1473
1474/// struct for typed errors of method [`retrieve_identity_provider_with_id`]
1475#[derive(Debug, Clone, Serialize, Deserialize)]
1476#[serde(untagged)]
1477pub enum RetrieveIdentityProviderWithIdError {
1478    DefaultResponse(models::Errors),
1479    UnknownValue(serde_json::Value),
1480}
1481
1482/// struct for typed errors of method [`retrieve_ip_access_control_list_with_id`]
1483#[derive(Debug, Clone, Serialize, Deserialize)]
1484#[serde(untagged)]
1485pub enum RetrieveIpAccessControlListWithIdError {
1486    DefaultResponse(),
1487    UnknownValue(serde_json::Value),
1488}
1489
1490/// struct for typed errors of method [`retrieve_json_web_key_set_with_id`]
1491#[derive(Debug, Clone, Serialize, Deserialize)]
1492#[serde(untagged)]
1493pub enum RetrieveJsonWebKeySetWithIdError {
1494    DefaultResponse(),
1495    UnknownValue(serde_json::Value),
1496}
1497
1498/// struct for typed errors of method [`retrieve_jwt_public_key`]
1499#[derive(Debug, Clone, Serialize, Deserialize)]
1500#[serde(untagged)]
1501pub enum RetrieveJwtPublicKeyError {
1502    DefaultResponse(),
1503    UnknownValue(serde_json::Value),
1504}
1505
1506/// struct for typed errors of method [`retrieve_key_with_id`]
1507#[derive(Debug, Clone, Serialize, Deserialize)]
1508#[serde(untagged)]
1509pub enum RetrieveKeyWithIdError {
1510    DefaultResponse(models::Errors),
1511    UnknownValue(serde_json::Value),
1512}
1513
1514/// struct for typed errors of method [`retrieve_keys_with_id`]
1515#[derive(Debug, Clone, Serialize, Deserialize)]
1516#[serde(untagged)]
1517pub enum RetrieveKeysWithIdError {
1518    DefaultResponse(),
1519    UnknownValue(serde_json::Value),
1520}
1521
1522/// struct for typed errors of method [`retrieve_lambda_with_id`]
1523#[derive(Debug, Clone, Serialize, Deserialize)]
1524#[serde(untagged)]
1525pub enum RetrieveLambdaWithIdError {
1526    DefaultResponse(models::Errors),
1527    UnknownValue(serde_json::Value),
1528}
1529
1530/// struct for typed errors of method [`retrieve_lambdas_by_type_with_id`]
1531#[derive(Debug, Clone, Serialize, Deserialize)]
1532#[serde(untagged)]
1533pub enum RetrieveLambdasByTypeWithIdError {
1534    DefaultResponse(),
1535    UnknownValue(serde_json::Value),
1536}
1537
1538/// struct for typed errors of method [`retrieve_message_template`]
1539#[derive(Debug, Clone, Serialize, Deserialize)]
1540#[serde(untagged)]
1541pub enum RetrieveMessageTemplateError {
1542    DefaultResponse(),
1543    UnknownValue(serde_json::Value),
1544}
1545
1546/// struct for typed errors of method [`retrieve_message_template_preview_with_id`]
1547#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(untagged)]
1549pub enum RetrieveMessageTemplatePreviewWithIdError {
1550    DefaultResponse(models::Errors),
1551    UnknownValue(serde_json::Value),
1552}
1553
1554/// struct for typed errors of method [`retrieve_message_template_with_id`]
1555#[derive(Debug, Clone, Serialize, Deserialize)]
1556#[serde(untagged)]
1557pub enum RetrieveMessageTemplateWithIdError {
1558    DefaultResponse(),
1559    UnknownValue(serde_json::Value),
1560}
1561
1562/// struct for typed errors of method [`retrieve_messenger_with_id`]
1563#[derive(Debug, Clone, Serialize, Deserialize)]
1564#[serde(untagged)]
1565pub enum RetrieveMessengerWithIdError {
1566    DefaultResponse(),
1567    UnknownValue(serde_json::Value),
1568}
1569
1570/// struct for typed errors of method [`retrieve_monthly_active_report_with_id`]
1571#[derive(Debug, Clone, Serialize, Deserialize)]
1572#[serde(untagged)]
1573pub enum RetrieveMonthlyActiveReportWithIdError {
1574    DefaultResponse(models::Errors),
1575    UnknownValue(serde_json::Value),
1576}
1577
1578/// struct for typed errors of method [`retrieve_o_auth_scope_with_id`]
1579#[derive(Debug, Clone, Serialize, Deserialize)]
1580#[serde(untagged)]
1581pub enum RetrieveOAuthScopeWithIdError {
1582    DefaultResponse(models::Errors),
1583    UnknownValue(serde_json::Value),
1584}
1585
1586/// struct for typed errors of method [`retrieve_oauth_configuration_with_id`]
1587#[derive(Debug, Clone, Serialize, Deserialize)]
1588#[serde(untagged)]
1589pub enum RetrieveOauthConfigurationWithIdError {
1590    DefaultResponse(models::Errors),
1591    UnknownValue(serde_json::Value),
1592}
1593
1594/// struct for typed errors of method [`retrieve_open_id_configuration_with_id`]
1595#[derive(Debug, Clone, Serialize, Deserialize)]
1596#[serde(untagged)]
1597pub enum RetrieveOpenIdConfigurationWithIdError {
1598    DefaultResponse(),
1599    UnknownValue(serde_json::Value),
1600}
1601
1602/// struct for typed errors of method [`retrieve_password_validation_rules_with_id`]
1603#[derive(Debug, Clone, Serialize, Deserialize)]
1604#[serde(untagged)]
1605pub enum RetrievePasswordValidationRulesWithIdError {
1606    DefaultResponse(),
1607    UnknownValue(serde_json::Value),
1608}
1609
1610/// struct for typed errors of method [`retrieve_password_validation_rules_with_tenant_id_with_id`]
1611#[derive(Debug, Clone, Serialize, Deserialize)]
1612#[serde(untagged)]
1613pub enum RetrievePasswordValidationRulesWithTenantIdWithIdError {
1614    DefaultResponse(),
1615    UnknownValue(serde_json::Value),
1616}
1617
1618/// struct for typed errors of method [`retrieve_pending_children_with_id`]
1619#[derive(Debug, Clone, Serialize, Deserialize)]
1620#[serde(untagged)]
1621pub enum RetrievePendingChildrenWithIdError {
1622    DefaultResponse(models::Errors),
1623    UnknownValue(serde_json::Value),
1624}
1625
1626/// struct for typed errors of method [`retrieve_pending_link_with_id`]
1627#[derive(Debug, Clone, Serialize, Deserialize)]
1628#[serde(untagged)]
1629pub enum RetrievePendingLinkWithIdError {
1630    DefaultResponse(models::Errors),
1631    UnknownValue(serde_json::Value),
1632}
1633
1634/// struct for typed errors of method [`retrieve_reactor_metrics_with_id`]
1635#[derive(Debug, Clone, Serialize, Deserialize)]
1636#[serde(untagged)]
1637pub enum RetrieveReactorMetricsWithIdError {
1638    DefaultResponse(),
1639    UnknownValue(serde_json::Value),
1640}
1641
1642/// struct for typed errors of method [`retrieve_refresh_token_by_id_with_id`]
1643#[derive(Debug, Clone, Serialize, Deserialize)]
1644#[serde(untagged)]
1645pub enum RetrieveRefreshTokenByIdWithIdError {
1646    DefaultResponse(models::Errors),
1647    UnknownValue(serde_json::Value),
1648}
1649
1650/// struct for typed errors of method [`retrieve_refresh_tokens_with_id`]
1651#[derive(Debug, Clone, Serialize, Deserialize)]
1652#[serde(untagged)]
1653pub enum RetrieveRefreshTokensWithIdError {
1654    DefaultResponse(models::Errors),
1655    UnknownValue(serde_json::Value),
1656}
1657
1658/// struct for typed errors of method [`retrieve_registration_report_with_id`]
1659#[derive(Debug, Clone, Serialize, Deserialize)]
1660#[serde(untagged)]
1661pub enum RetrieveRegistrationReportWithIdError {
1662    DefaultResponse(models::Errors),
1663    UnknownValue(serde_json::Value),
1664}
1665
1666/// struct for typed errors of method [`retrieve_registration_with_id`]
1667#[derive(Debug, Clone, Serialize, Deserialize)]
1668#[serde(untagged)]
1669pub enum RetrieveRegistrationWithIdError {
1670    DefaultResponse(models::Errors),
1671    UnknownValue(serde_json::Value),
1672}
1673
1674/// struct for typed errors of method [`retrieve_report_login`]
1675#[derive(Debug, Clone, Serialize, Deserialize)]
1676#[serde(untagged)]
1677pub enum RetrieveReportLoginError {
1678    DefaultResponse(models::Errors),
1679    UnknownValue(serde_json::Value),
1680}
1681
1682/// struct for typed errors of method [`retrieve_status`]
1683#[derive(Debug, Clone, Serialize, Deserialize)]
1684#[serde(untagged)]
1685pub enum RetrieveStatusError {
1686    DefaultResponse(),
1687    UnknownValue(serde_json::Value),
1688}
1689
1690/// struct for typed errors of method [`retrieve_system_health_with_id`]
1691#[derive(Debug, Clone, Serialize, Deserialize)]
1692#[serde(untagged)]
1693pub enum RetrieveSystemHealthWithIdError {
1694    DefaultResponse(),
1695    UnknownValue(serde_json::Value),
1696}
1697
1698/// struct for typed errors of method [`retrieve_tenant_with_id`]
1699#[derive(Debug, Clone, Serialize, Deserialize)]
1700#[serde(untagged)]
1701pub enum RetrieveTenantWithIdError {
1702    DefaultResponse(models::Errors),
1703    UnknownValue(serde_json::Value),
1704}
1705
1706/// struct for typed errors of method [`retrieve_theme_with_id`]
1707#[derive(Debug, Clone, Serialize, Deserialize)]
1708#[serde(untagged)]
1709pub enum RetrieveThemeWithIdError {
1710    DefaultResponse(models::Errors),
1711    UnknownValue(serde_json::Value),
1712}
1713
1714/// struct for typed errors of method [`retrieve_total_report_with_excludes_with_id`]
1715#[derive(Debug, Clone, Serialize, Deserialize)]
1716#[serde(untagged)]
1717pub enum RetrieveTotalReportWithExcludesWithIdError {
1718    DefaultResponse(),
1719    UnknownValue(serde_json::Value),
1720}
1721
1722/// struct for typed errors of method [`retrieve_two_factor_recovery_codes_with_id`]
1723#[derive(Debug, Clone, Serialize, Deserialize)]
1724#[serde(untagged)]
1725pub enum RetrieveTwoFactorRecoveryCodesWithIdError {
1726    DefaultResponse(models::Errors),
1727    UnknownValue(serde_json::Value),
1728}
1729
1730/// struct for typed errors of method [`retrieve_two_factor_status_with_id`]
1731#[derive(Debug, Clone, Serialize, Deserialize)]
1732#[serde(untagged)]
1733pub enum RetrieveTwoFactorStatusWithIdError {
1734    DefaultResponse(models::Errors),
1735    UnknownValue(serde_json::Value),
1736}
1737
1738/// struct for typed errors of method [`retrieve_two_factor_status_with_request_with_id`]
1739#[derive(Debug, Clone, Serialize, Deserialize)]
1740#[serde(untagged)]
1741pub enum RetrieveTwoFactorStatusWithRequestWithIdError {
1742    DefaultResponse(models::Errors),
1743    UnknownValue(serde_json::Value),
1744}
1745
1746/// struct for typed errors of method [`retrieve_user`]
1747#[derive(Debug, Clone, Serialize, Deserialize)]
1748#[serde(untagged)]
1749pub enum RetrieveUserError {
1750    DefaultResponse(models::Errors),
1751    UnknownValue(serde_json::Value),
1752}
1753
1754/// struct for typed errors of method [`retrieve_user_action`]
1755#[derive(Debug, Clone, Serialize, Deserialize)]
1756#[serde(untagged)]
1757pub enum RetrieveUserActionError {
1758    DefaultResponse(),
1759    UnknownValue(serde_json::Value),
1760}
1761
1762/// struct for typed errors of method [`retrieve_user_action_reason`]
1763#[derive(Debug, Clone, Serialize, Deserialize)]
1764#[serde(untagged)]
1765pub enum RetrieveUserActionReasonError {
1766    DefaultResponse(),
1767    UnknownValue(serde_json::Value),
1768}
1769
1770/// struct for typed errors of method [`retrieve_user_action_reason_with_id`]
1771#[derive(Debug, Clone, Serialize, Deserialize)]
1772#[serde(untagged)]
1773pub enum RetrieveUserActionReasonWithIdError {
1774    DefaultResponse(),
1775    UnknownValue(serde_json::Value),
1776}
1777
1778/// struct for typed errors of method [`retrieve_user_action_with_id`]
1779#[derive(Debug, Clone, Serialize, Deserialize)]
1780#[serde(untagged)]
1781pub enum RetrieveUserActionWithIdError {
1782    DefaultResponse(),
1783    UnknownValue(serde_json::Value),
1784}
1785
1786/// struct for typed errors of method [`retrieve_user_actioning`]
1787#[derive(Debug, Clone, Serialize, Deserialize)]
1788#[serde(untagged)]
1789pub enum RetrieveUserActioningError {
1790    DefaultResponse(models::Errors),
1791    UnknownValue(serde_json::Value),
1792}
1793
1794/// struct for typed errors of method [`retrieve_user_change_password`]
1795#[derive(Debug, Clone, Serialize, Deserialize)]
1796#[serde(untagged)]
1797pub enum RetrieveUserChangePasswordError {
1798    DefaultResponse(models::Errors),
1799    UnknownValue(serde_json::Value),
1800}
1801
1802/// struct for typed errors of method [`retrieve_user_change_password_with_id`]
1803#[derive(Debug, Clone, Serialize, Deserialize)]
1804#[serde(untagged)]
1805pub enum RetrieveUserChangePasswordWithIdError {
1806    DefaultResponse(models::Errors),
1807    UnknownValue(serde_json::Value),
1808}
1809
1810/// struct for typed errors of method [`retrieve_user_comments_with_id`]
1811#[derive(Debug, Clone, Serialize, Deserialize)]
1812#[serde(untagged)]
1813pub enum RetrieveUserCommentsWithIdError {
1814    DefaultResponse(models::Errors),
1815    UnknownValue(serde_json::Value),
1816}
1817
1818/// struct for typed errors of method [`retrieve_user_consent_with_id`]
1819#[derive(Debug, Clone, Serialize, Deserialize)]
1820#[serde(untagged)]
1821pub enum RetrieveUserConsentWithIdError {
1822    DefaultResponse(),
1823    UnknownValue(serde_json::Value),
1824}
1825
1826/// struct for typed errors of method [`retrieve_user_consents_with_id`]
1827#[derive(Debug, Clone, Serialize, Deserialize)]
1828#[serde(untagged)]
1829pub enum RetrieveUserConsentsWithIdError {
1830    DefaultResponse(),
1831    UnknownValue(serde_json::Value),
1832}
1833
1834/// struct for typed errors of method [`retrieve_user_info_from_access_token_with_id`]
1835#[derive(Debug, Clone, Serialize, Deserialize)]
1836#[serde(untagged)]
1837pub enum RetrieveUserInfoFromAccessTokenWithIdError {
1838    DefaultResponse(models::OAuthError),
1839    UnknownValue(serde_json::Value),
1840}
1841
1842/// struct for typed errors of method [`retrieve_user_recent_login`]
1843#[derive(Debug, Clone, Serialize, Deserialize)]
1844#[serde(untagged)]
1845pub enum RetrieveUserRecentLoginError {
1846    DefaultResponse(models::Errors),
1847    UnknownValue(serde_json::Value),
1848}
1849
1850/// struct for typed errors of method [`retrieve_user_with_id`]
1851#[derive(Debug, Clone, Serialize, Deserialize)]
1852#[serde(untagged)]
1853pub enum RetrieveUserWithIdError {
1854    DefaultResponse(models::Errors),
1855    UnknownValue(serde_json::Value),
1856}
1857
1858/// struct for typed errors of method [`retrieve_version_with_id`]
1859#[derive(Debug, Clone, Serialize, Deserialize)]
1860#[serde(untagged)]
1861pub enum RetrieveVersionWithIdError {
1862    DefaultResponse(models::Errors),
1863    UnknownValue(serde_json::Value),
1864}
1865
1866/// struct for typed errors of method [`retrieve_web_authn_credential_with_id`]
1867#[derive(Debug, Clone, Serialize, Deserialize)]
1868#[serde(untagged)]
1869pub enum RetrieveWebAuthnCredentialWithIdError {
1870    DefaultResponse(models::Errors),
1871    UnknownValue(serde_json::Value),
1872}
1873
1874/// struct for typed errors of method [`retrieve_web_authn_credentials_for_user_with_id`]
1875#[derive(Debug, Clone, Serialize, Deserialize)]
1876#[serde(untagged)]
1877pub enum RetrieveWebAuthnCredentialsForUserWithIdError {
1878    DefaultResponse(models::Errors),
1879    UnknownValue(serde_json::Value),
1880}
1881
1882/// struct for typed errors of method [`retrieve_webhook`]
1883#[derive(Debug, Clone, Serialize, Deserialize)]
1884#[serde(untagged)]
1885pub enum RetrieveWebhookError {
1886    DefaultResponse(),
1887    UnknownValue(serde_json::Value),
1888}
1889
1890/// struct for typed errors of method [`retrieve_webhook_attempt_log_with_id`]
1891#[derive(Debug, Clone, Serialize, Deserialize)]
1892#[serde(untagged)]
1893pub enum RetrieveWebhookAttemptLogWithIdError {
1894    DefaultResponse(models::Errors),
1895    UnknownValue(serde_json::Value),
1896}
1897
1898/// struct for typed errors of method [`retrieve_webhook_event_log_with_id`]
1899#[derive(Debug, Clone, Serialize, Deserialize)]
1900#[serde(untagged)]
1901pub enum RetrieveWebhookEventLogWithIdError {
1902    DefaultResponse(models::Errors),
1903    UnknownValue(serde_json::Value),
1904}
1905
1906/// struct for typed errors of method [`retrieve_webhook_with_id`]
1907#[derive(Debug, Clone, Serialize, Deserialize)]
1908#[serde(untagged)]
1909pub enum RetrieveWebhookWithIdError {
1910    DefaultResponse(),
1911    UnknownValue(serde_json::Value),
1912}
1913
1914/// struct for typed errors of method [`revoke_refresh_token_by_id_with_id`]
1915#[derive(Debug, Clone, Serialize, Deserialize)]
1916#[serde(untagged)]
1917pub enum RevokeRefreshTokenByIdWithIdError {
1918    DefaultResponse(models::Errors),
1919    UnknownValue(serde_json::Value),
1920}
1921
1922/// struct for typed errors of method [`revoke_user_consent_with_id`]
1923#[derive(Debug, Clone, Serialize, Deserialize)]
1924#[serde(untagged)]
1925pub enum RevokeUserConsentWithIdError {
1926    DefaultResponse(),
1927    UnknownValue(serde_json::Value),
1928}
1929
1930/// struct for typed errors of method [`search_applications_with_id`]
1931#[derive(Debug, Clone, Serialize, Deserialize)]
1932#[serde(untagged)]
1933pub enum SearchApplicationsWithIdError {
1934    DefaultResponse(models::Errors),
1935    UnknownValue(serde_json::Value),
1936}
1937
1938/// struct for typed errors of method [`search_audit_logs_with_id`]
1939#[derive(Debug, Clone, Serialize, Deserialize)]
1940#[serde(untagged)]
1941pub enum SearchAuditLogsWithIdError {
1942    DefaultResponse(models::Errors),
1943    UnknownValue(serde_json::Value),
1944}
1945
1946/// struct for typed errors of method [`search_consents_with_id`]
1947#[derive(Debug, Clone, Serialize, Deserialize)]
1948#[serde(untagged)]
1949pub enum SearchConsentsWithIdError {
1950    DefaultResponse(models::Errors),
1951    UnknownValue(serde_json::Value),
1952}
1953
1954/// struct for typed errors of method [`search_email_templates_with_id`]
1955#[derive(Debug, Clone, Serialize, Deserialize)]
1956#[serde(untagged)]
1957pub enum SearchEmailTemplatesWithIdError {
1958    DefaultResponse(models::Errors),
1959    UnknownValue(serde_json::Value),
1960}
1961
1962/// struct for typed errors of method [`search_entities_by_ids_with_id`]
1963#[derive(Debug, Clone, Serialize, Deserialize)]
1964#[serde(untagged)]
1965pub enum SearchEntitiesByIdsWithIdError {
1966    DefaultResponse(models::Errors),
1967    UnknownValue(serde_json::Value),
1968}
1969
1970/// struct for typed errors of method [`search_entities_with_id`]
1971#[derive(Debug, Clone, Serialize, Deserialize)]
1972#[serde(untagged)]
1973pub enum SearchEntitiesWithIdError {
1974    DefaultResponse(models::Errors),
1975    UnknownValue(serde_json::Value),
1976}
1977
1978/// struct for typed errors of method [`search_entity_grants_with_id`]
1979#[derive(Debug, Clone, Serialize, Deserialize)]
1980#[serde(untagged)]
1981pub enum SearchEntityGrantsWithIdError {
1982    DefaultResponse(models::Errors),
1983    UnknownValue(serde_json::Value),
1984}
1985
1986/// struct for typed errors of method [`search_entity_types_with_id`]
1987#[derive(Debug, Clone, Serialize, Deserialize)]
1988#[serde(untagged)]
1989pub enum SearchEntityTypesWithIdError {
1990    DefaultResponse(models::Errors),
1991    UnknownValue(serde_json::Value),
1992}
1993
1994/// struct for typed errors of method [`search_event_logs_with_id`]
1995#[derive(Debug, Clone, Serialize, Deserialize)]
1996#[serde(untagged)]
1997pub enum SearchEventLogsWithIdError {
1998    DefaultResponse(models::Errors),
1999    UnknownValue(serde_json::Value),
2000}
2001
2002/// struct for typed errors of method [`search_group_members_with_id`]
2003#[derive(Debug, Clone, Serialize, Deserialize)]
2004#[serde(untagged)]
2005pub enum SearchGroupMembersWithIdError {
2006    DefaultResponse(models::Errors),
2007    UnknownValue(serde_json::Value),
2008}
2009
2010/// struct for typed errors of method [`search_groups_with_id`]
2011#[derive(Debug, Clone, Serialize, Deserialize)]
2012#[serde(untagged)]
2013pub enum SearchGroupsWithIdError {
2014    DefaultResponse(models::Errors),
2015    UnknownValue(serde_json::Value),
2016}
2017
2018/// struct for typed errors of method [`search_identity_providers_with_id`]
2019#[derive(Debug, Clone, Serialize, Deserialize)]
2020#[serde(untagged)]
2021pub enum SearchIdentityProvidersWithIdError {
2022    DefaultResponse(models::Errors),
2023    UnknownValue(serde_json::Value),
2024}
2025
2026/// struct for typed errors of method [`search_ip_access_control_lists_with_id`]
2027#[derive(Debug, Clone, Serialize, Deserialize)]
2028#[serde(untagged)]
2029pub enum SearchIpAccessControlListsWithIdError {
2030    DefaultResponse(models::Errors),
2031    UnknownValue(serde_json::Value),
2032}
2033
2034/// struct for typed errors of method [`search_keys_with_id`]
2035#[derive(Debug, Clone, Serialize, Deserialize)]
2036#[serde(untagged)]
2037pub enum SearchKeysWithIdError {
2038    DefaultResponse(models::Errors),
2039    UnknownValue(serde_json::Value),
2040}
2041
2042/// struct for typed errors of method [`search_lambdas_with_id`]
2043#[derive(Debug, Clone, Serialize, Deserialize)]
2044#[serde(untagged)]
2045pub enum SearchLambdasWithIdError {
2046    DefaultResponse(models::Errors),
2047    UnknownValue(serde_json::Value),
2048}
2049
2050/// struct for typed errors of method [`search_login_records_with_id`]
2051#[derive(Debug, Clone, Serialize, Deserialize)]
2052#[serde(untagged)]
2053pub enum SearchLoginRecordsWithIdError {
2054    DefaultResponse(models::Errors),
2055    UnknownValue(serde_json::Value),
2056}
2057
2058/// struct for typed errors of method [`search_tenants_with_id`]
2059#[derive(Debug, Clone, Serialize, Deserialize)]
2060#[serde(untagged)]
2061pub enum SearchTenantsWithIdError {
2062    DefaultResponse(models::Errors),
2063    UnknownValue(serde_json::Value),
2064}
2065
2066/// struct for typed errors of method [`search_themes_with_id`]
2067#[derive(Debug, Clone, Serialize, Deserialize)]
2068#[serde(untagged)]
2069pub enum SearchThemesWithIdError {
2070    DefaultResponse(models::Errors),
2071    UnknownValue(serde_json::Value),
2072}
2073
2074/// struct for typed errors of method [`search_user_comments_with_id`]
2075#[derive(Debug, Clone, Serialize, Deserialize)]
2076#[serde(untagged)]
2077pub enum SearchUserCommentsWithIdError {
2078    DefaultResponse(models::Errors),
2079    UnknownValue(serde_json::Value),
2080}
2081
2082/// struct for typed errors of method [`search_users_by_ids_with_id`]
2083#[derive(Debug, Clone, Serialize, Deserialize)]
2084#[serde(untagged)]
2085pub enum SearchUsersByIdsWithIdError {
2086    DefaultResponse(models::Errors),
2087    UnknownValue(serde_json::Value),
2088}
2089
2090/// struct for typed errors of method [`search_users_by_query_with_id`]
2091#[derive(Debug, Clone, Serialize, Deserialize)]
2092#[serde(untagged)]
2093pub enum SearchUsersByQueryWithIdError {
2094    DefaultResponse(models::Errors),
2095    UnknownValue(serde_json::Value),
2096}
2097
2098/// struct for typed errors of method [`search_webhook_event_logs_with_id`]
2099#[derive(Debug, Clone, Serialize, Deserialize)]
2100#[serde(untagged)]
2101pub enum SearchWebhookEventLogsWithIdError {
2102    DefaultResponse(models::Errors),
2103    UnknownValue(serde_json::Value),
2104}
2105
2106/// struct for typed errors of method [`search_webhooks_with_id`]
2107#[derive(Debug, Clone, Serialize, Deserialize)]
2108#[serde(untagged)]
2109pub enum SearchWebhooksWithIdError {
2110    DefaultResponse(models::Errors),
2111    UnknownValue(serde_json::Value),
2112}
2113
2114/// struct for typed errors of method [`send_email_with_id`]
2115#[derive(Debug, Clone, Serialize, Deserialize)]
2116#[serde(untagged)]
2117pub enum SendEmailWithIdError {
2118    DefaultResponse(models::Errors),
2119    UnknownValue(serde_json::Value),
2120}
2121
2122/// struct for typed errors of method [`send_family_request_email_with_id`]
2123#[derive(Debug, Clone, Serialize, Deserialize)]
2124#[serde(untagged)]
2125pub enum SendFamilyRequestEmailWithIdError {
2126    DefaultResponse(models::Errors),
2127    UnknownValue(serde_json::Value),
2128}
2129
2130/// struct for typed errors of method [`send_passwordless_code_with_id`]
2131#[derive(Debug, Clone, Serialize, Deserialize)]
2132#[serde(untagged)]
2133pub enum SendPasswordlessCodeWithIdError {
2134    DefaultResponse(models::Errors),
2135    UnknownValue(serde_json::Value),
2136}
2137
2138/// struct for typed errors of method [`send_two_factor_code_for_enable_disable_with_id`]
2139#[derive(Debug, Clone, Serialize, Deserialize)]
2140#[serde(untagged)]
2141pub enum SendTwoFactorCodeForEnableDisableWithIdError {
2142    DefaultResponse(models::Errors),
2143    UnknownValue(serde_json::Value),
2144}
2145
2146/// struct for typed errors of method [`send_two_factor_code_for_login_using_method_with_id`]
2147#[derive(Debug, Clone, Serialize, Deserialize)]
2148#[serde(untagged)]
2149pub enum SendTwoFactorCodeForLoginUsingMethodWithIdError {
2150    DefaultResponse(models::Errors),
2151    UnknownValue(serde_json::Value),
2152}
2153
2154/// struct for typed errors of method [`send_verify_identity_with_id`]
2155#[derive(Debug, Clone, Serialize, Deserialize)]
2156#[serde(untagged)]
2157pub enum SendVerifyIdentityWithIdError {
2158    DefaultResponse(models::Errors),
2159    UnknownValue(serde_json::Value),
2160}
2161
2162/// struct for typed errors of method [`start_identity_provider_login_with_id`]
2163#[derive(Debug, Clone, Serialize, Deserialize)]
2164#[serde(untagged)]
2165pub enum StartIdentityProviderLoginWithIdError {
2166    DefaultResponse(models::Errors),
2167    UnknownValue(serde_json::Value),
2168}
2169
2170/// struct for typed errors of method [`start_passwordless_login_with_id`]
2171#[derive(Debug, Clone, Serialize, Deserialize)]
2172#[serde(untagged)]
2173pub enum StartPasswordlessLoginWithIdError {
2174    DefaultResponse(models::Errors),
2175    UnknownValue(serde_json::Value),
2176}
2177
2178/// struct for typed errors of method [`start_two_factor_login_with_id`]
2179#[derive(Debug, Clone, Serialize, Deserialize)]
2180#[serde(untagged)]
2181pub enum StartTwoFactorLoginWithIdError {
2182    DefaultResponse(models::Errors),
2183    UnknownValue(serde_json::Value),
2184}
2185
2186/// struct for typed errors of method [`start_verify_identity_with_id`]
2187#[derive(Debug, Clone, Serialize, Deserialize)]
2188#[serde(untagged)]
2189pub enum StartVerifyIdentityWithIdError {
2190    DefaultResponse(models::Errors),
2191    UnknownValue(serde_json::Value),
2192}
2193
2194/// struct for typed errors of method [`start_web_authn_login_with_id`]
2195#[derive(Debug, Clone, Serialize, Deserialize)]
2196#[serde(untagged)]
2197pub enum StartWebAuthnLoginWithIdError {
2198    DefaultResponse(models::Errors),
2199    UnknownValue(serde_json::Value),
2200}
2201
2202/// struct for typed errors of method [`start_web_authn_registration_with_id`]
2203#[derive(Debug, Clone, Serialize, Deserialize)]
2204#[serde(untagged)]
2205pub enum StartWebAuthnRegistrationWithIdError {
2206    DefaultResponse(models::Errors),
2207    UnknownValue(serde_json::Value),
2208}
2209
2210/// struct for typed errors of method [`two_factor_login_with_id`]
2211#[derive(Debug, Clone, Serialize, Deserialize)]
2212#[serde(untagged)]
2213pub enum TwoFactorLoginWithIdError {
2214    DefaultResponse(models::Errors),
2215    UnknownValue(serde_json::Value),
2216}
2217
2218/// struct for typed errors of method [`update_api_key_with_id`]
2219#[derive(Debug, Clone, Serialize, Deserialize)]
2220#[serde(untagged)]
2221pub enum UpdateApiKeyWithIdError {
2222    DefaultResponse(models::Errors),
2223    UnknownValue(serde_json::Value),
2224}
2225
2226/// struct for typed errors of method [`update_application_role_with_id`]
2227#[derive(Debug, Clone, Serialize, Deserialize)]
2228#[serde(untagged)]
2229pub enum UpdateApplicationRoleWithIdError {
2230    DefaultResponse(models::Errors),
2231    UnknownValue(serde_json::Value),
2232}
2233
2234/// struct for typed errors of method [`update_application_with_id`]
2235#[derive(Debug, Clone, Serialize, Deserialize)]
2236#[serde(untagged)]
2237pub enum UpdateApplicationWithIdError {
2238    DefaultResponse(models::Errors),
2239    UnknownValue(serde_json::Value),
2240}
2241
2242/// struct for typed errors of method [`update_connector_with_id`]
2243#[derive(Debug, Clone, Serialize, Deserialize)]
2244#[serde(untagged)]
2245pub enum UpdateConnectorWithIdError {
2246    DefaultResponse(models::Errors),
2247    UnknownValue(serde_json::Value),
2248}
2249
2250/// struct for typed errors of method [`update_consent_with_id`]
2251#[derive(Debug, Clone, Serialize, Deserialize)]
2252#[serde(untagged)]
2253pub enum UpdateConsentWithIdError {
2254    DefaultResponse(models::Errors),
2255    UnknownValue(serde_json::Value),
2256}
2257
2258/// struct for typed errors of method [`update_email_template_with_id`]
2259#[derive(Debug, Clone, Serialize, Deserialize)]
2260#[serde(untagged)]
2261pub enum UpdateEmailTemplateWithIdError {
2262    DefaultResponse(models::Errors),
2263    UnknownValue(serde_json::Value),
2264}
2265
2266/// struct for typed errors of method [`update_entity_type_permission_with_id`]
2267#[derive(Debug, Clone, Serialize, Deserialize)]
2268#[serde(untagged)]
2269pub enum UpdateEntityTypePermissionWithIdError {
2270    DefaultResponse(models::Errors),
2271    UnknownValue(serde_json::Value),
2272}
2273
2274/// struct for typed errors of method [`update_entity_type_with_id`]
2275#[derive(Debug, Clone, Serialize, Deserialize)]
2276#[serde(untagged)]
2277pub enum UpdateEntityTypeWithIdError {
2278    DefaultResponse(models::Errors),
2279    UnknownValue(serde_json::Value),
2280}
2281
2282/// struct for typed errors of method [`update_entity_with_id`]
2283#[derive(Debug, Clone, Serialize, Deserialize)]
2284#[serde(untagged)]
2285pub enum UpdateEntityWithIdError {
2286    DefaultResponse(models::Errors),
2287    UnknownValue(serde_json::Value),
2288}
2289
2290/// struct for typed errors of method [`update_form_field_with_id`]
2291#[derive(Debug, Clone, Serialize, Deserialize)]
2292#[serde(untagged)]
2293pub enum UpdateFormFieldWithIdError {
2294    DefaultResponse(models::Errors),
2295    UnknownValue(serde_json::Value),
2296}
2297
2298/// struct for typed errors of method [`update_form_with_id`]
2299#[derive(Debug, Clone, Serialize, Deserialize)]
2300#[serde(untagged)]
2301pub enum UpdateFormWithIdError {
2302    DefaultResponse(models::Errors),
2303    UnknownValue(serde_json::Value),
2304}
2305
2306/// struct for typed errors of method [`update_group_members_with_id`]
2307#[derive(Debug, Clone, Serialize, Deserialize)]
2308#[serde(untagged)]
2309pub enum UpdateGroupMembersWithIdError {
2310    DefaultResponse(models::Errors),
2311    UnknownValue(serde_json::Value),
2312}
2313
2314/// struct for typed errors of method [`update_group_with_id`]
2315#[derive(Debug, Clone, Serialize, Deserialize)]
2316#[serde(untagged)]
2317pub enum UpdateGroupWithIdError {
2318    DefaultResponse(models::Errors),
2319    UnknownValue(serde_json::Value),
2320}
2321
2322/// struct for typed errors of method [`update_identity_provider_with_id`]
2323#[derive(Debug, Clone, Serialize, Deserialize)]
2324#[serde(untagged)]
2325pub enum UpdateIdentityProviderWithIdError {
2326    DefaultResponse(models::Errors),
2327    UnknownValue(serde_json::Value),
2328}
2329
2330/// struct for typed errors of method [`update_integrations_with_id`]
2331#[derive(Debug, Clone, Serialize, Deserialize)]
2332#[serde(untagged)]
2333pub enum UpdateIntegrationsWithIdError {
2334    DefaultResponse(models::Errors),
2335    UnknownValue(serde_json::Value),
2336}
2337
2338/// struct for typed errors of method [`update_ip_access_control_list_with_id`]
2339#[derive(Debug, Clone, Serialize, Deserialize)]
2340#[serde(untagged)]
2341pub enum UpdateIpAccessControlListWithIdError {
2342    DefaultResponse(models::Errors),
2343    UnknownValue(serde_json::Value),
2344}
2345
2346/// struct for typed errors of method [`update_key_with_id`]
2347#[derive(Debug, Clone, Serialize, Deserialize)]
2348#[serde(untagged)]
2349pub enum UpdateKeyWithIdError {
2350    DefaultResponse(models::Errors),
2351    UnknownValue(serde_json::Value),
2352}
2353
2354/// struct for typed errors of method [`update_lambda_with_id`]
2355#[derive(Debug, Clone, Serialize, Deserialize)]
2356#[serde(untagged)]
2357pub enum UpdateLambdaWithIdError {
2358    DefaultResponse(models::Errors),
2359    UnknownValue(serde_json::Value),
2360}
2361
2362/// struct for typed errors of method [`update_message_template_with_id`]
2363#[derive(Debug, Clone, Serialize, Deserialize)]
2364#[serde(untagged)]
2365pub enum UpdateMessageTemplateWithIdError {
2366    DefaultResponse(models::Errors),
2367    UnknownValue(serde_json::Value),
2368}
2369
2370/// struct for typed errors of method [`update_messenger_with_id`]
2371#[derive(Debug, Clone, Serialize, Deserialize)]
2372#[serde(untagged)]
2373pub enum UpdateMessengerWithIdError {
2374    DefaultResponse(models::Errors),
2375    UnknownValue(serde_json::Value),
2376}
2377
2378/// struct for typed errors of method [`update_o_auth_scope_with_id`]
2379#[derive(Debug, Clone, Serialize, Deserialize)]
2380#[serde(untagged)]
2381pub enum UpdateOAuthScopeWithIdError {
2382    DefaultResponse(models::Errors),
2383    UnknownValue(serde_json::Value),
2384}
2385
2386/// struct for typed errors of method [`update_registration_with_id`]
2387#[derive(Debug, Clone, Serialize, Deserialize)]
2388#[serde(untagged)]
2389pub enum UpdateRegistrationWithIdError {
2390    DefaultResponse(models::Errors),
2391    UnknownValue(serde_json::Value),
2392}
2393
2394/// struct for typed errors of method [`update_system_configuration_with_id`]
2395#[derive(Debug, Clone, Serialize, Deserialize)]
2396#[serde(untagged)]
2397pub enum UpdateSystemConfigurationWithIdError {
2398    DefaultResponse(models::Errors),
2399    UnknownValue(serde_json::Value),
2400}
2401
2402/// struct for typed errors of method [`update_tenant_with_id`]
2403#[derive(Debug, Clone, Serialize, Deserialize)]
2404#[serde(untagged)]
2405pub enum UpdateTenantWithIdError {
2406    DefaultResponse(models::Errors),
2407    UnknownValue(serde_json::Value),
2408}
2409
2410/// struct for typed errors of method [`update_theme_with_id`]
2411#[derive(Debug, Clone, Serialize, Deserialize)]
2412#[serde(untagged)]
2413pub enum UpdateThemeWithIdError {
2414    DefaultResponse(models::Errors),
2415    UnknownValue(serde_json::Value),
2416}
2417
2418/// struct for typed errors of method [`update_user_action_reason_with_id`]
2419#[derive(Debug, Clone, Serialize, Deserialize)]
2420#[serde(untagged)]
2421pub enum UpdateUserActionReasonWithIdError {
2422    DefaultResponse(models::Errors),
2423    UnknownValue(serde_json::Value),
2424}
2425
2426/// struct for typed errors of method [`update_user_action_with_id`]
2427#[derive(Debug, Clone, Serialize, Deserialize)]
2428#[serde(untagged)]
2429pub enum UpdateUserActionWithIdError {
2430    DefaultResponse(models::Errors),
2431    UnknownValue(serde_json::Value),
2432}
2433
2434/// struct for typed errors of method [`update_user_consent_with_id`]
2435#[derive(Debug, Clone, Serialize, Deserialize)]
2436#[serde(untagged)]
2437pub enum UpdateUserConsentWithIdError {
2438    DefaultResponse(models::Errors),
2439    UnknownValue(serde_json::Value),
2440}
2441
2442/// struct for typed errors of method [`update_user_family_with_id`]
2443#[derive(Debug, Clone, Serialize, Deserialize)]
2444#[serde(untagged)]
2445pub enum UpdateUserFamilyWithIdError {
2446    DefaultResponse(models::Errors),
2447    UnknownValue(serde_json::Value),
2448}
2449
2450/// struct for typed errors of method [`update_user_verify_email`]
2451#[derive(Debug, Clone, Serialize, Deserialize)]
2452#[serde(untagged)]
2453pub enum UpdateUserVerifyEmailError {
2454    DefaultResponse(models::Errors),
2455    UnknownValue(serde_json::Value),
2456}
2457
2458/// struct for typed errors of method [`update_user_verify_registration`]
2459#[derive(Debug, Clone, Serialize, Deserialize)]
2460#[serde(untagged)]
2461pub enum UpdateUserVerifyRegistrationError {
2462    DefaultResponse(models::Errors),
2463    UnknownValue(serde_json::Value),
2464}
2465
2466/// struct for typed errors of method [`update_user_with_id`]
2467#[derive(Debug, Clone, Serialize, Deserialize)]
2468#[serde(untagged)]
2469pub enum UpdateUserWithIdError {
2470    DefaultResponse(models::Errors),
2471    UnknownValue(serde_json::Value),
2472}
2473
2474/// struct for typed errors of method [`update_webhook_with_id`]
2475#[derive(Debug, Clone, Serialize, Deserialize)]
2476#[serde(untagged)]
2477pub enum UpdateWebhookWithIdError {
2478    DefaultResponse(models::Errors),
2479    UnknownValue(serde_json::Value),
2480}
2481
2482/// struct for typed errors of method [`upsert_entity_grant_with_id`]
2483#[derive(Debug, Clone, Serialize, Deserialize)]
2484#[serde(untagged)]
2485pub enum UpsertEntityGrantWithIdError {
2486    DefaultResponse(models::Errors),
2487    UnknownValue(serde_json::Value),
2488}
2489
2490/// struct for typed errors of method [`validate_jwt_with_id`]
2491#[derive(Debug, Clone, Serialize, Deserialize)]
2492#[serde(untagged)]
2493pub enum ValidateJwtWithIdError {
2494    DefaultResponse(),
2495    UnknownValue(serde_json::Value),
2496}
2497
2498/// struct for typed errors of method [`vend_jwt_with_id`]
2499#[derive(Debug, Clone, Serialize, Deserialize)]
2500#[serde(untagged)]
2501pub enum VendJwtWithIdError {
2502    DefaultResponse(models::Errors),
2503    UnknownValue(serde_json::Value),
2504}
2505
2506/// struct for typed errors of method [`verify_identity_with_id`]
2507#[derive(Debug, Clone, Serialize, Deserialize)]
2508#[serde(untagged)]
2509pub enum VerifyIdentityWithIdError {
2510    DefaultResponse(models::Errors),
2511    UnknownValue(serde_json::Value),
2512}
2513
2514/// struct for typed errors of method [`verify_user_registration_with_id`]
2515#[derive(Debug, Clone, Serialize, Deserialize)]
2516#[serde(untagged)]
2517pub enum VerifyUserRegistrationWithIdError {
2518    DefaultResponse(models::Errors),
2519    UnknownValue(serde_json::Value),
2520}
2521
2522
2523/// 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.
2524pub async fn action_user_with_id(configuration: &configuration::Configuration, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<ActionUserWithIdError>> {
2525    // add a prefix to parameters to efficiently prevent name collisions
2526    let p_body_action_request = action_request;
2527
2528    let uri_str = format!("{}/api/user/action", configuration.base_path);
2529    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2530
2531    if let Some(ref user_agent) = configuration.user_agent {
2532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2533    }
2534    if let Some(ref apikey) = configuration.api_key {
2535        let key = apikey.key.clone();
2536        let value = match apikey.prefix {
2537            Some(ref prefix) => format!("{} {}", prefix, key),
2538            None => key,
2539        };
2540        req_builder = req_builder.header("Authorization", value);
2541    };
2542    req_builder = req_builder.json(&p_body_action_request);
2543
2544    let req = req_builder.build()?;
2545    let resp = configuration.client.execute(req).await?;
2546
2547    let status = resp.status();
2548    let content_type = resp
2549        .headers()
2550        .get("content-type")
2551        .and_then(|v| v.to_str().ok())
2552        .unwrap_or("application/octet-stream");
2553    let content_type = super::ContentType::from(content_type);
2554
2555    if !status.is_client_error() && !status.is_server_error() {
2556        let content = resp.text().await?;
2557        match content_type {
2558            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2559            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
2560            ContentType::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`")))),
2561        }
2562    } else {
2563        let content = resp.text().await?;
2564        let entity: Option<ActionUserWithIdError> = serde_json::from_str(&content).ok();
2565        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2566    }
2567}
2568
2569/// Activates the FusionAuth Reactor using a license Id and optionally a license text (for air-gapped deployments)
2570pub async fn activate_reactor_with_id(configuration: &configuration::Configuration, reactor_request: Option<models::ReactorRequest>) -> Result<(), Error<ActivateReactorWithIdError>> {
2571    // add a prefix to parameters to efficiently prevent name collisions
2572    let p_body_reactor_request = reactor_request;
2573
2574    let uri_str = format!("{}/api/reactor", configuration.base_path);
2575    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2576
2577    if let Some(ref user_agent) = configuration.user_agent {
2578        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2579    }
2580    if let Some(ref apikey) = configuration.api_key {
2581        let key = apikey.key.clone();
2582        let value = match apikey.prefix {
2583            Some(ref prefix) => format!("{} {}", prefix, key),
2584            None => key,
2585        };
2586        req_builder = req_builder.header("Authorization", value);
2587    };
2588    req_builder = req_builder.json(&p_body_reactor_request);
2589
2590    let req = req_builder.build()?;
2591    let resp = configuration.client.execute(req).await?;
2592
2593    let status = resp.status();
2594
2595    if !status.is_client_error() && !status.is_server_error() {
2596        Ok(())
2597    } else {
2598        let content = resp.text().await?;
2599        let entity: Option<ActivateReactorWithIdError> = serde_json::from_str(&content).ok();
2600        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2601    }
2602}
2603
2604/// Cancels the user action.
2605pub async fn cancel_action_with_id(configuration: &configuration::Configuration, action_id: &str, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<CancelActionWithIdError>> {
2606    // add a prefix to parameters to efficiently prevent name collisions
2607    let p_path_action_id = action_id;
2608    let p_body_action_request = action_request;
2609
2610    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_path_action_id));
2611    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2612
2613    if let Some(ref user_agent) = configuration.user_agent {
2614        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2615    }
2616    if let Some(ref apikey) = configuration.api_key {
2617        let key = apikey.key.clone();
2618        let value = match apikey.prefix {
2619            Some(ref prefix) => format!("{} {}", prefix, key),
2620            None => key,
2621        };
2622        req_builder = req_builder.header("Authorization", value);
2623    };
2624    req_builder = req_builder.json(&p_body_action_request);
2625
2626    let req = req_builder.build()?;
2627    let resp = configuration.client.execute(req).await?;
2628
2629    let status = resp.status();
2630    let content_type = resp
2631        .headers()
2632        .get("content-type")
2633        .and_then(|v| v.to_str().ok())
2634        .unwrap_or("application/octet-stream");
2635    let content_type = super::ContentType::from(content_type);
2636
2637    if !status.is_client_error() && !status.is_server_error() {
2638        let content = resp.text().await?;
2639        match content_type {
2640            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2641            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
2642            ContentType::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`")))),
2643        }
2644    } else {
2645        let content = resp.text().await?;
2646        let entity: Option<CancelActionWithIdError> = serde_json::from_str(&content).ok();
2647        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2648    }
2649}
2650
2651/// 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.
2652pub async fn change_password_with_id(configuration: &configuration::Configuration, change_password_id: &str, change_password_request: Option<models::ChangePasswordRequest>) -> Result<models::ChangePasswordResponse, Error<ChangePasswordWithIdError>> {
2653    // add a prefix to parameters to efficiently prevent name collisions
2654    let p_path_change_password_id = change_password_id;
2655    let p_body_change_password_request = change_password_request;
2656
2657    let uri_str = format!("{}/api/user/change-password/{changePasswordId}", configuration.base_path, changePasswordId=crate::apis::urlencode(p_path_change_password_id));
2658    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2659
2660    if let Some(ref user_agent) = configuration.user_agent {
2661        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2662    }
2663    if let Some(ref apikey) = configuration.api_key {
2664        let key = apikey.key.clone();
2665        let value = match apikey.prefix {
2666            Some(ref prefix) => format!("{} {}", prefix, key),
2667            None => key,
2668        };
2669        req_builder = req_builder.header("Authorization", value);
2670    };
2671    req_builder = req_builder.json(&p_body_change_password_request);
2672
2673    let req = req_builder.build()?;
2674    let resp = configuration.client.execute(req).await?;
2675
2676    let status = resp.status();
2677    let content_type = resp
2678        .headers()
2679        .get("content-type")
2680        .and_then(|v| v.to_str().ok())
2681        .unwrap_or("application/octet-stream");
2682    let content_type = super::ContentType::from(content_type);
2683
2684    if !status.is_client_error() && !status.is_server_error() {
2685        let content = resp.text().await?;
2686        match content_type {
2687            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2688            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangePasswordResponse`"))),
2689            ContentType::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`")))),
2690        }
2691    } else {
2692        let content = resp.text().await?;
2693        let entity: Option<ChangePasswordWithIdError> = serde_json::from_str(&content).ok();
2694        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2695    }
2696}
2697
2698/// Adds a comment to the user's account.
2699pub 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>> {
2700    // add a prefix to parameters to efficiently prevent name collisions
2701    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
2702    let p_body_user_comment_request = user_comment_request;
2703
2704    let uri_str = format!("{}/api/user/comment", configuration.base_path);
2705    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2706
2707    if let Some(ref user_agent) = configuration.user_agent {
2708        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2709    }
2710    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
2711        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
2712    }
2713    if let Some(ref apikey) = configuration.api_key {
2714        let key = apikey.key.clone();
2715        let value = match apikey.prefix {
2716            Some(ref prefix) => format!("{} {}", prefix, key),
2717            None => key,
2718        };
2719        req_builder = req_builder.header("Authorization", value);
2720    };
2721    req_builder = req_builder.json(&p_body_user_comment_request);
2722
2723    let req = req_builder.build()?;
2724    let resp = configuration.client.execute(req).await?;
2725
2726    let status = resp.status();
2727    let content_type = resp
2728        .headers()
2729        .get("content-type")
2730        .and_then(|v| v.to_str().ok())
2731        .unwrap_or("application/octet-stream");
2732    let content_type = super::ContentType::from(content_type);
2733
2734    if !status.is_client_error() && !status.is_server_error() {
2735        let content = resp.text().await?;
2736        match content_type {
2737            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2738            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentResponse`"))),
2739            ContentType::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`")))),
2740        }
2741    } else {
2742        let content = resp.text().await?;
2743        let entity: Option<CommentOnUserWithIdError> = serde_json::from_str(&content).ok();
2744        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2745    }
2746}
2747
2748/// Completes verification of an identity using verification codes from the Verify Start API.
2749pub async fn complete_verify_identity_with_id(configuration: &configuration::Configuration, verify_complete_request: Option<models::VerifyCompleteRequest>) -> Result<models::VerifyCompleteResponse, Error<CompleteVerifyIdentityWithIdError>> {
2750    // add a prefix to parameters to efficiently prevent name collisions
2751    let p_body_verify_complete_request = verify_complete_request;
2752
2753    let uri_str = format!("{}/api/identity/verify/complete", configuration.base_path);
2754    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2755
2756    if let Some(ref user_agent) = configuration.user_agent {
2757        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2758    }
2759    if let Some(ref apikey) = configuration.api_key {
2760        let key = apikey.key.clone();
2761        let value = match apikey.prefix {
2762            Some(ref prefix) => format!("{} {}", prefix, key),
2763            None => key,
2764        };
2765        req_builder = req_builder.header("Authorization", value);
2766    };
2767    req_builder = req_builder.json(&p_body_verify_complete_request);
2768
2769    let req = req_builder.build()?;
2770    let resp = configuration.client.execute(req).await?;
2771
2772    let status = resp.status();
2773    let content_type = resp
2774        .headers()
2775        .get("content-type")
2776        .and_then(|v| v.to_str().ok())
2777        .unwrap_or("application/octet-stream");
2778    let content_type = super::ContentType::from(content_type);
2779
2780    if !status.is_client_error() && !status.is_server_error() {
2781        let content = resp.text().await?;
2782        match content_type {
2783            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2784            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyCompleteResponse`"))),
2785            ContentType::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`")))),
2786        }
2787    } else {
2788        let content = resp.text().await?;
2789        let entity: Option<CompleteVerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
2790        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2791    }
2792}
2793
2794/// Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
2795pub async fn complete_web_authn_assertion_with_id(configuration: &configuration::Configuration, web_authn_login_request: Option<models::WebAuthnLoginRequest>) -> Result<models::WebAuthnAssertResponse, Error<CompleteWebAuthnAssertionWithIdError>> {
2796    // add a prefix to parameters to efficiently prevent name collisions
2797    let p_body_web_authn_login_request = web_authn_login_request;
2798
2799    let uri_str = format!("{}/api/webauthn/assert", configuration.base_path);
2800    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2801
2802    if let Some(ref user_agent) = configuration.user_agent {
2803        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2804    }
2805    if let Some(ref apikey) = configuration.api_key {
2806        let key = apikey.key.clone();
2807        let value = match apikey.prefix {
2808            Some(ref prefix) => format!("{} {}", prefix, key),
2809            None => key,
2810        };
2811        req_builder = req_builder.header("Authorization", value);
2812    };
2813    req_builder = req_builder.json(&p_body_web_authn_login_request);
2814
2815    let req = req_builder.build()?;
2816    let resp = configuration.client.execute(req).await?;
2817
2818    let status = resp.status();
2819    let content_type = resp
2820        .headers()
2821        .get("content-type")
2822        .and_then(|v| v.to_str().ok())
2823        .unwrap_or("application/octet-stream");
2824    let content_type = super::ContentType::from(content_type);
2825
2826    if !status.is_client_error() && !status.is_server_error() {
2827        let content = resp.text().await?;
2828        match content_type {
2829            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2830            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnAssertResponse`"))),
2831            ContentType::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`")))),
2832        }
2833    } else {
2834        let content = resp.text().await?;
2835        let entity: Option<CompleteWebAuthnAssertionWithIdError> = serde_json::from_str(&content).ok();
2836        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2837    }
2838}
2839
2840/// Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
2841pub async fn complete_web_authn_login_with_id(configuration: &configuration::Configuration, web_authn_login_request: Option<models::WebAuthnLoginRequest>) -> Result<models::LoginResponse, Error<CompleteWebAuthnLoginWithIdError>> {
2842    // add a prefix to parameters to efficiently prevent name collisions
2843    let p_body_web_authn_login_request = web_authn_login_request;
2844
2845    let uri_str = format!("{}/api/webauthn/login", configuration.base_path);
2846    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2847
2848    if let Some(ref user_agent) = configuration.user_agent {
2849        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2850    }
2851    if let Some(ref apikey) = configuration.api_key {
2852        let key = apikey.key.clone();
2853        let value = match apikey.prefix {
2854            Some(ref prefix) => format!("{} {}", prefix, key),
2855            None => key,
2856        };
2857        req_builder = req_builder.header("Authorization", value);
2858    };
2859    req_builder = req_builder.json(&p_body_web_authn_login_request);
2860
2861    let req = req_builder.build()?;
2862    let resp = configuration.client.execute(req).await?;
2863
2864    let status = resp.status();
2865    let content_type = resp
2866        .headers()
2867        .get("content-type")
2868        .and_then(|v| v.to_str().ok())
2869        .unwrap_or("application/octet-stream");
2870    let content_type = super::ContentType::from(content_type);
2871
2872    if !status.is_client_error() && !status.is_server_error() {
2873        let content = resp.text().await?;
2874        match content_type {
2875            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2876            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
2877            ContentType::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`")))),
2878        }
2879    } else {
2880        let content = resp.text().await?;
2881        let entity: Option<CompleteWebAuthnLoginWithIdError> = serde_json::from_str(&content).ok();
2882        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2883    }
2884}
2885
2886/// Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
2887pub async fn complete_web_authn_registration_with_id(configuration: &configuration::Configuration, web_authn_register_complete_request: Option<models::WebAuthnRegisterCompleteRequest>) -> Result<models::WebAuthnRegisterCompleteResponse, Error<CompleteWebAuthnRegistrationWithIdError>> {
2888    // add a prefix to parameters to efficiently prevent name collisions
2889    let p_body_web_authn_register_complete_request = web_authn_register_complete_request;
2890
2891    let uri_str = format!("{}/api/webauthn/register/complete", configuration.base_path);
2892    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2893
2894    if let Some(ref user_agent) = configuration.user_agent {
2895        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2896    }
2897    if let Some(ref apikey) = configuration.api_key {
2898        let key = apikey.key.clone();
2899        let value = match apikey.prefix {
2900            Some(ref prefix) => format!("{} {}", prefix, key),
2901            None => key,
2902        };
2903        req_builder = req_builder.header("Authorization", value);
2904    };
2905    req_builder = req_builder.json(&p_body_web_authn_register_complete_request);
2906
2907    let req = req_builder.build()?;
2908    let resp = configuration.client.execute(req).await?;
2909
2910    let status = resp.status();
2911    let content_type = resp
2912        .headers()
2913        .get("content-type")
2914        .and_then(|v| v.to_str().ok())
2915        .unwrap_or("application/octet-stream");
2916    let content_type = super::ContentType::from(content_type);
2917
2918    if !status.is_client_error() && !status.is_server_error() {
2919        let content = resp.text().await?;
2920        match content_type {
2921            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2922            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnRegisterCompleteResponse`"))),
2923            ContentType::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`")))),
2924        }
2925    } else {
2926        let content = resp.text().await?;
2927        let entity: Option<CompleteWebAuthnRegistrationWithIdError> = serde_json::from_str(&content).ok();
2928        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2929    }
2930}
2931
2932/// 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.
2933pub async fn create_api_key(configuration: &configuration::Configuration, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<CreateApiKeyError>> {
2934    // add a prefix to parameters to efficiently prevent name collisions
2935    let p_body_api_key_request = api_key_request;
2936
2937    let uri_str = format!("{}/api/api-key", configuration.base_path);
2938    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2939
2940    if let Some(ref user_agent) = configuration.user_agent {
2941        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2942    }
2943    if let Some(ref apikey) = configuration.api_key {
2944        let key = apikey.key.clone();
2945        let value = match apikey.prefix {
2946            Some(ref prefix) => format!("{} {}", prefix, key),
2947            None => key,
2948        };
2949        req_builder = req_builder.header("Authorization", value);
2950    };
2951    req_builder = req_builder.json(&p_body_api_key_request);
2952
2953    let req = req_builder.build()?;
2954    let resp = configuration.client.execute(req).await?;
2955
2956    let status = resp.status();
2957    let content_type = resp
2958        .headers()
2959        .get("content-type")
2960        .and_then(|v| v.to_str().ok())
2961        .unwrap_or("application/octet-stream");
2962    let content_type = super::ContentType::from(content_type);
2963
2964    if !status.is_client_error() && !status.is_server_error() {
2965        let content = resp.text().await?;
2966        match content_type {
2967            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2968            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
2969            ContentType::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`")))),
2970        }
2971    } else {
2972        let content = resp.text().await?;
2973        let entity: Option<CreateApiKeyError> = serde_json::from_str(&content).ok();
2974        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2975    }
2976}
2977
2978/// 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.
2979pub async fn create_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<CreateApiKeyWithIdError>> {
2980    // add a prefix to parameters to efficiently prevent name collisions
2981    let p_path_key_id = key_id;
2982    let p_body_api_key_request = api_key_request;
2983
2984    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
2985    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2986
2987    if let Some(ref user_agent) = configuration.user_agent {
2988        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2989    }
2990    if let Some(ref apikey) = configuration.api_key {
2991        let key = apikey.key.clone();
2992        let value = match apikey.prefix {
2993            Some(ref prefix) => format!("{} {}", prefix, key),
2994            None => key,
2995        };
2996        req_builder = req_builder.header("Authorization", value);
2997    };
2998    req_builder = req_builder.json(&p_body_api_key_request);
2999
3000    let req = req_builder.build()?;
3001    let resp = configuration.client.execute(req).await?;
3002
3003    let status = resp.status();
3004    let content_type = resp
3005        .headers()
3006        .get("content-type")
3007        .and_then(|v| v.to_str().ok())
3008        .unwrap_or("application/octet-stream");
3009    let content_type = super::ContentType::from(content_type);
3010
3011    if !status.is_client_error() && !status.is_server_error() {
3012        let content = resp.text().await?;
3013        match content_type {
3014            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3015            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
3016            ContentType::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`")))),
3017        }
3018    } else {
3019        let content = resp.text().await?;
3020        let entity: Option<CreateApiKeyWithIdError> = serde_json::from_str(&content).ok();
3021        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3022    }
3023}
3024
3025/// Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
3026pub async fn create_application(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, application_request: Option<models::ApplicationRequest>) -> Result<models::ApplicationResponse, Error<CreateApplicationError>> {
3027    // add a prefix to parameters to efficiently prevent name collisions
3028    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3029    let p_body_application_request = application_request;
3030
3031    let uri_str = format!("{}/api/application", configuration.base_path);
3032    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3033
3034    if let Some(ref user_agent) = configuration.user_agent {
3035        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3036    }
3037    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3038        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3039    }
3040    if let Some(ref apikey) = configuration.api_key {
3041        let key = apikey.key.clone();
3042        let value = match apikey.prefix {
3043            Some(ref prefix) => format!("{} {}", prefix, key),
3044            None => key,
3045        };
3046        req_builder = req_builder.header("Authorization", value);
3047    };
3048    req_builder = req_builder.json(&p_body_application_request);
3049
3050    let req = req_builder.build()?;
3051    let resp = configuration.client.execute(req).await?;
3052
3053    let status = resp.status();
3054    let content_type = resp
3055        .headers()
3056        .get("content-type")
3057        .and_then(|v| v.to_str().ok())
3058        .unwrap_or("application/octet-stream");
3059    let content_type = super::ContentType::from(content_type);
3060
3061    if !status.is_client_error() && !status.is_server_error() {
3062        let content = resp.text().await?;
3063        match content_type {
3064            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3065            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3066            ContentType::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`")))),
3067        }
3068    } else {
3069        let content = resp.text().await?;
3070        let entity: Option<CreateApplicationError> = serde_json::from_str(&content).ok();
3071        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3072    }
3073}
3074
3075/// 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.
3076pub 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>> {
3077    // add a prefix to parameters to efficiently prevent name collisions
3078    let p_path_application_id = application_id;
3079    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3080    let p_body_application_request = application_request;
3081
3082    let uri_str = format!("{}/api/application/{applicationId}/role", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
3083    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3084
3085    if let Some(ref user_agent) = configuration.user_agent {
3086        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3087    }
3088    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3089        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3090    }
3091    if let Some(ref apikey) = configuration.api_key {
3092        let key = apikey.key.clone();
3093        let value = match apikey.prefix {
3094            Some(ref prefix) => format!("{} {}", prefix, key),
3095            None => key,
3096        };
3097        req_builder = req_builder.header("Authorization", value);
3098    };
3099    req_builder = req_builder.json(&p_body_application_request);
3100
3101    let req = req_builder.build()?;
3102    let resp = configuration.client.execute(req).await?;
3103
3104    let status = resp.status();
3105    let content_type = resp
3106        .headers()
3107        .get("content-type")
3108        .and_then(|v| v.to_str().ok())
3109        .unwrap_or("application/octet-stream");
3110    let content_type = super::ContentType::from(content_type);
3111
3112    if !status.is_client_error() && !status.is_server_error() {
3113        let content = resp.text().await?;
3114        match content_type {
3115            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3116            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3117            ContentType::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`")))),
3118        }
3119    } else {
3120        let content = resp.text().await?;
3121        let entity: Option<CreateApplicationRoleError> = serde_json::from_str(&content).ok();
3122        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3123    }
3124}
3125
3126/// 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.
3127pub 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>> {
3128    // add a prefix to parameters to efficiently prevent name collisions
3129    let p_path_application_id = application_id;
3130    let p_path_role_id = role_id;
3131    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3132    let p_body_application_request = application_request;
3133
3134    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));
3135    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3136
3137    if let Some(ref user_agent) = configuration.user_agent {
3138        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3139    }
3140    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3141        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3142    }
3143    if let Some(ref apikey) = configuration.api_key {
3144        let key = apikey.key.clone();
3145        let value = match apikey.prefix {
3146            Some(ref prefix) => format!("{} {}", prefix, key),
3147            None => key,
3148        };
3149        req_builder = req_builder.header("Authorization", value);
3150    };
3151    req_builder = req_builder.json(&p_body_application_request);
3152
3153    let req = req_builder.build()?;
3154    let resp = configuration.client.execute(req).await?;
3155
3156    let status = resp.status();
3157    let content_type = resp
3158        .headers()
3159        .get("content-type")
3160        .and_then(|v| v.to_str().ok())
3161        .unwrap_or("application/octet-stream");
3162    let content_type = super::ContentType::from(content_type);
3163
3164    if !status.is_client_error() && !status.is_server_error() {
3165        let content = resp.text().await?;
3166        match content_type {
3167            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3168            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3169            ContentType::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`")))),
3170        }
3171    } else {
3172        let content = resp.text().await?;
3173        let entity: Option<CreateApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
3174        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3175    }
3176}
3177
3178/// Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
3179pub 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>> {
3180    // add a prefix to parameters to efficiently prevent name collisions
3181    let p_path_application_id = application_id;
3182    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3183    let p_body_application_request = application_request;
3184
3185    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
3186    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3187
3188    if let Some(ref user_agent) = configuration.user_agent {
3189        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3190    }
3191    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3192        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3193    }
3194    if let Some(ref apikey) = configuration.api_key {
3195        let key = apikey.key.clone();
3196        let value = match apikey.prefix {
3197            Some(ref prefix) => format!("{} {}", prefix, key),
3198            None => key,
3199        };
3200        req_builder = req_builder.header("Authorization", value);
3201    };
3202    req_builder = req_builder.json(&p_body_application_request);
3203
3204    let req = req_builder.build()?;
3205    let resp = configuration.client.execute(req).await?;
3206
3207    let status = resp.status();
3208    let content_type = resp
3209        .headers()
3210        .get("content-type")
3211        .and_then(|v| v.to_str().ok())
3212        .unwrap_or("application/octet-stream");
3213    let content_type = super::ContentType::from(content_type);
3214
3215    if !status.is_client_error() && !status.is_server_error() {
3216        let content = resp.text().await?;
3217        match content_type {
3218            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3219            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
3220            ContentType::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`")))),
3221        }
3222    } else {
3223        let content = resp.text().await?;
3224        let entity: Option<CreateApplicationWithIdError> = serde_json::from_str(&content).ok();
3225        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3226    }
3227}
3228
3229/// 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.
3230pub async fn create_audit_log_with_id(configuration: &configuration::Configuration, audit_log_request: Option<models::AuditLogRequest>) -> Result<models::AuditLogResponse, Error<CreateAuditLogWithIdError>> {
3231    // add a prefix to parameters to efficiently prevent name collisions
3232    let p_body_audit_log_request = audit_log_request;
3233
3234    let uri_str = format!("{}/api/system/audit-log", configuration.base_path);
3235    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3236
3237    if let Some(ref user_agent) = configuration.user_agent {
3238        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3239    }
3240    if let Some(ref apikey) = configuration.api_key {
3241        let key = apikey.key.clone();
3242        let value = match apikey.prefix {
3243            Some(ref prefix) => format!("{} {}", prefix, key),
3244            None => key,
3245        };
3246        req_builder = req_builder.header("Authorization", value);
3247    };
3248    req_builder = req_builder.json(&p_body_audit_log_request);
3249
3250    let req = req_builder.build()?;
3251    let resp = configuration.client.execute(req).await?;
3252
3253    let status = resp.status();
3254    let content_type = resp
3255        .headers()
3256        .get("content-type")
3257        .and_then(|v| v.to_str().ok())
3258        .unwrap_or("application/octet-stream");
3259    let content_type = super::ContentType::from(content_type);
3260
3261    if !status.is_client_error() && !status.is_server_error() {
3262        let content = resp.text().await?;
3263        match content_type {
3264            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3265            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogResponse`"))),
3266            ContentType::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`")))),
3267        }
3268    } else {
3269        let content = resp.text().await?;
3270        let entity: Option<CreateAuditLogWithIdError> = serde_json::from_str(&content).ok();
3271        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3272    }
3273}
3274
3275/// Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
3276pub async fn create_connector(configuration: &configuration::Configuration, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<CreateConnectorError>> {
3277    // add a prefix to parameters to efficiently prevent name collisions
3278    let p_body_connector_request = connector_request;
3279
3280    let uri_str = format!("{}/api/connector", configuration.base_path);
3281    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3282
3283    if let Some(ref user_agent) = configuration.user_agent {
3284        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3285    }
3286    if let Some(ref apikey) = configuration.api_key {
3287        let key = apikey.key.clone();
3288        let value = match apikey.prefix {
3289            Some(ref prefix) => format!("{} {}", prefix, key),
3290            None => key,
3291        };
3292        req_builder = req_builder.header("Authorization", value);
3293    };
3294    req_builder = req_builder.json(&p_body_connector_request);
3295
3296    let req = req_builder.build()?;
3297    let resp = configuration.client.execute(req).await?;
3298
3299    let status = resp.status();
3300    let content_type = resp
3301        .headers()
3302        .get("content-type")
3303        .and_then(|v| v.to_str().ok())
3304        .unwrap_or("application/octet-stream");
3305    let content_type = super::ContentType::from(content_type);
3306
3307    if !status.is_client_error() && !status.is_server_error() {
3308        let content = resp.text().await?;
3309        match content_type {
3310            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3311            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
3312            ContentType::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`")))),
3313        }
3314    } else {
3315        let content = resp.text().await?;
3316        let entity: Option<CreateConnectorError> = serde_json::from_str(&content).ok();
3317        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3318    }
3319}
3320
3321/// Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
3322pub async fn create_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<CreateConnectorWithIdError>> {
3323    // add a prefix to parameters to efficiently prevent name collisions
3324    let p_path_connector_id = connector_id;
3325    let p_body_connector_request = connector_request;
3326
3327    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
3328    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3329
3330    if let Some(ref user_agent) = configuration.user_agent {
3331        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3332    }
3333    if let Some(ref apikey) = configuration.api_key {
3334        let key = apikey.key.clone();
3335        let value = match apikey.prefix {
3336            Some(ref prefix) => format!("{} {}", prefix, key),
3337            None => key,
3338        };
3339        req_builder = req_builder.header("Authorization", value);
3340    };
3341    req_builder = req_builder.json(&p_body_connector_request);
3342
3343    let req = req_builder.build()?;
3344    let resp = configuration.client.execute(req).await?;
3345
3346    let status = resp.status();
3347    let content_type = resp
3348        .headers()
3349        .get("content-type")
3350        .and_then(|v| v.to_str().ok())
3351        .unwrap_or("application/octet-stream");
3352    let content_type = super::ContentType::from(content_type);
3353
3354    if !status.is_client_error() && !status.is_server_error() {
3355        let content = resp.text().await?;
3356        match content_type {
3357            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3358            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
3359            ContentType::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`")))),
3360        }
3361    } else {
3362        let content = resp.text().await?;
3363        let entity: Option<CreateConnectorWithIdError> = serde_json::from_str(&content).ok();
3364        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3365    }
3366}
3367
3368/// Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
3369pub async fn create_consent(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, consent_request: Option<models::ConsentRequest>) -> Result<models::ConsentResponse, Error<CreateConsentError>> {
3370    // add a prefix to parameters to efficiently prevent name collisions
3371    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3372    let p_body_consent_request = consent_request;
3373
3374    let uri_str = format!("{}/api/consent", configuration.base_path);
3375    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3376
3377    if let Some(ref user_agent) = configuration.user_agent {
3378        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3379    }
3380    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3381        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3382    }
3383    if let Some(ref apikey) = configuration.api_key {
3384        let key = apikey.key.clone();
3385        let value = match apikey.prefix {
3386            Some(ref prefix) => format!("{} {}", prefix, key),
3387            None => key,
3388        };
3389        req_builder = req_builder.header("Authorization", value);
3390    };
3391    req_builder = req_builder.json(&p_body_consent_request);
3392
3393    let req = req_builder.build()?;
3394    let resp = configuration.client.execute(req).await?;
3395
3396    let status = resp.status();
3397    let content_type = resp
3398        .headers()
3399        .get("content-type")
3400        .and_then(|v| v.to_str().ok())
3401        .unwrap_or("application/octet-stream");
3402    let content_type = super::ContentType::from(content_type);
3403
3404    if !status.is_client_error() && !status.is_server_error() {
3405        let content = resp.text().await?;
3406        match content_type {
3407            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3408            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
3409            ContentType::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`")))),
3410        }
3411    } else {
3412        let content = resp.text().await?;
3413        let entity: Option<CreateConsentError> = serde_json::from_str(&content).ok();
3414        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3415    }
3416}
3417
3418/// Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
3419pub 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>> {
3420    // add a prefix to parameters to efficiently prevent name collisions
3421    let p_path_consent_id = consent_id;
3422    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3423    let p_body_consent_request = consent_request;
3424
3425    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
3426    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3427
3428    if let Some(ref user_agent) = configuration.user_agent {
3429        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3430    }
3431    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3432        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3433    }
3434    if let Some(ref apikey) = configuration.api_key {
3435        let key = apikey.key.clone();
3436        let value = match apikey.prefix {
3437            Some(ref prefix) => format!("{} {}", prefix, key),
3438            None => key,
3439        };
3440        req_builder = req_builder.header("Authorization", value);
3441    };
3442    req_builder = req_builder.json(&p_body_consent_request);
3443
3444    let req = req_builder.build()?;
3445    let resp = configuration.client.execute(req).await?;
3446
3447    let status = resp.status();
3448    let content_type = resp
3449        .headers()
3450        .get("content-type")
3451        .and_then(|v| v.to_str().ok())
3452        .unwrap_or("application/octet-stream");
3453    let content_type = super::ContentType::from(content_type);
3454
3455    if !status.is_client_error() && !status.is_server_error() {
3456        let content = resp.text().await?;
3457        match content_type {
3458            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3459            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
3460            ContentType::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`")))),
3461        }
3462    } else {
3463        let content = resp.text().await?;
3464        let entity: Option<CreateConsentWithIdError> = serde_json::from_str(&content).ok();
3465        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3466    }
3467}
3468
3469/// Approve a device grant. OR Approve a device grant.
3470pub async fn create_device_approve(configuration: &configuration::Configuration, ) -> Result<models::DeviceApprovalResponse, Error<CreateDeviceApproveError>> {
3471
3472    let uri_str = format!("{}/oauth2/device/approve", configuration.base_path);
3473    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3474
3475    if let Some(ref user_agent) = configuration.user_agent {
3476        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3477    }
3478    if let Some(ref apikey) = configuration.api_key {
3479        let key = apikey.key.clone();
3480        let value = match apikey.prefix {
3481            Some(ref prefix) => format!("{} {}", prefix, key),
3482            None => key,
3483        };
3484        req_builder = req_builder.header("Authorization", value);
3485    };
3486
3487    let req = req_builder.build()?;
3488    let resp = configuration.client.execute(req).await?;
3489
3490    let status = resp.status();
3491    let content_type = resp
3492        .headers()
3493        .get("content-type")
3494        .and_then(|v| v.to_str().ok())
3495        .unwrap_or("application/octet-stream");
3496    let content_type = super::ContentType::from(content_type);
3497
3498    if !status.is_client_error() && !status.is_server_error() {
3499        let content = resp.text().await?;
3500        match content_type {
3501            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3502            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceApprovalResponse`"))),
3503            ContentType::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`")))),
3504        }
3505    } else {
3506        let content = resp.text().await?;
3507        let entity: Option<CreateDeviceApproveError> = serde_json::from_str(&content).ok();
3508        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3509    }
3510}
3511
3512/// Start the Device Authorization flow using a request body OR Start the Device Authorization flow using form-encoded parameters
3513pub async fn create_device_authorize(configuration: &configuration::Configuration, ) -> Result<models::DeviceResponse, Error<CreateDeviceAuthorizeError>> {
3514
3515    let uri_str = format!("{}/oauth2/device_authorize", configuration.base_path);
3516    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3517
3518    if let Some(ref user_agent) = configuration.user_agent {
3519        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3520    }
3521    if let Some(ref apikey) = configuration.api_key {
3522        let key = apikey.key.clone();
3523        let value = match apikey.prefix {
3524            Some(ref prefix) => format!("{} {}", prefix, key),
3525            None => key,
3526        };
3527        req_builder = req_builder.header("Authorization", value);
3528    };
3529
3530    let req = req_builder.build()?;
3531    let resp = configuration.client.execute(req).await?;
3532
3533    let status = resp.status();
3534    let content_type = resp
3535        .headers()
3536        .get("content-type")
3537        .and_then(|v| v.to_str().ok())
3538        .unwrap_or("application/octet-stream");
3539    let content_type = super::ContentType::from(content_type);
3540
3541    if !status.is_client_error() && !status.is_server_error() {
3542        let content = resp.text().await?;
3543        match content_type {
3544            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3545            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeviceResponse`"))),
3546            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeviceResponse`")))),
3547        }
3548    } else {
3549        let content = resp.text().await?;
3550        let entity: Option<CreateDeviceAuthorizeError> = serde_json::from_str(&content).ok();
3551        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3552    }
3553}
3554
3555/// 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. 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.  This request will require an API key.
3556pub async fn create_device_user_code(configuration: &configuration::Configuration, ) -> Result<(), Error<CreateDeviceUserCodeError>> {
3557
3558    let uri_str = format!("{}/oauth2/device/user-code", configuration.base_path);
3559    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3560
3561    if let Some(ref user_agent) = configuration.user_agent {
3562        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3563    }
3564    if let Some(ref apikey) = configuration.api_key {
3565        let key = apikey.key.clone();
3566        let value = match apikey.prefix {
3567            Some(ref prefix) => format!("{} {}", prefix, key),
3568            None => key,
3569        };
3570        req_builder = req_builder.header("Authorization", value);
3571    };
3572
3573    let req = req_builder.build()?;
3574    let resp = configuration.client.execute(req).await?;
3575
3576    let status = resp.status();
3577
3578    if !status.is_client_error() && !status.is_server_error() {
3579        Ok(())
3580    } else {
3581        let content = resp.text().await?;
3582        let entity: Option<CreateDeviceUserCodeError> = serde_json::from_str(&content).ok();
3583        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3584    }
3585}
3586
3587/// Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
3588pub 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>> {
3589    // add a prefix to parameters to efficiently prevent name collisions
3590    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3591    let p_body_email_template_request = email_template_request;
3592
3593    let uri_str = format!("{}/api/email/template", configuration.base_path);
3594    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3595
3596    if let Some(ref user_agent) = configuration.user_agent {
3597        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3598    }
3599    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3600        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3601    }
3602    if let Some(ref apikey) = configuration.api_key {
3603        let key = apikey.key.clone();
3604        let value = match apikey.prefix {
3605            Some(ref prefix) => format!("{} {}", prefix, key),
3606            None => key,
3607        };
3608        req_builder = req_builder.header("Authorization", value);
3609    };
3610    req_builder = req_builder.json(&p_body_email_template_request);
3611
3612    let req = req_builder.build()?;
3613    let resp = configuration.client.execute(req).await?;
3614
3615    let status = resp.status();
3616    let content_type = resp
3617        .headers()
3618        .get("content-type")
3619        .and_then(|v| v.to_str().ok())
3620        .unwrap_or("application/octet-stream");
3621    let content_type = super::ContentType::from(content_type);
3622
3623    if !status.is_client_error() && !status.is_server_error() {
3624        let content = resp.text().await?;
3625        match content_type {
3626            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3627            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
3628            ContentType::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`")))),
3629        }
3630    } else {
3631        let content = resp.text().await?;
3632        let entity: Option<CreateEmailTemplateError> = serde_json::from_str(&content).ok();
3633        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3634    }
3635}
3636
3637/// Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
3638pub 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>> {
3639    // add a prefix to parameters to efficiently prevent name collisions
3640    let p_path_email_template_id = email_template_id;
3641    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3642    let p_body_email_template_request = email_template_request;
3643
3644    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
3645    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3646
3647    if let Some(ref user_agent) = configuration.user_agent {
3648        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3649    }
3650    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3651        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3652    }
3653    if let Some(ref apikey) = configuration.api_key {
3654        let key = apikey.key.clone();
3655        let value = match apikey.prefix {
3656            Some(ref prefix) => format!("{} {}", prefix, key),
3657            None => key,
3658        };
3659        req_builder = req_builder.header("Authorization", value);
3660    };
3661    req_builder = req_builder.json(&p_body_email_template_request);
3662
3663    let req = req_builder.build()?;
3664    let resp = configuration.client.execute(req).await?;
3665
3666    let status = resp.status();
3667    let content_type = resp
3668        .headers()
3669        .get("content-type")
3670        .and_then(|v| v.to_str().ok())
3671        .unwrap_or("application/octet-stream");
3672    let content_type = super::ContentType::from(content_type);
3673
3674    if !status.is_client_error() && !status.is_server_error() {
3675        let content = resp.text().await?;
3676        match content_type {
3677            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3678            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
3679            ContentType::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`")))),
3680        }
3681    } else {
3682        let content = resp.text().await?;
3683        let entity: Option<CreateEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
3684        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3685    }
3686}
3687
3688/// Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
3689pub async fn create_entity(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, entity_request: Option<models::EntityRequest>) -> Result<models::EntityResponse, Error<CreateEntityError>> {
3690    // add a prefix to parameters to efficiently prevent name collisions
3691    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3692    let p_body_entity_request = entity_request;
3693
3694    let uri_str = format!("{}/api/entity", configuration.base_path);
3695    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3696
3697    if let Some(ref user_agent) = configuration.user_agent {
3698        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3699    }
3700    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3701        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3702    }
3703    if let Some(ref apikey) = configuration.api_key {
3704        let key = apikey.key.clone();
3705        let value = match apikey.prefix {
3706            Some(ref prefix) => format!("{} {}", prefix, key),
3707            None => key,
3708        };
3709        req_builder = req_builder.header("Authorization", value);
3710    };
3711    req_builder = req_builder.json(&p_body_entity_request);
3712
3713    let req = req_builder.build()?;
3714    let resp = configuration.client.execute(req).await?;
3715
3716    let status = resp.status();
3717    let content_type = resp
3718        .headers()
3719        .get("content-type")
3720        .and_then(|v| v.to_str().ok())
3721        .unwrap_or("application/octet-stream");
3722    let content_type = super::ContentType::from(content_type);
3723
3724    if !status.is_client_error() && !status.is_server_error() {
3725        let content = resp.text().await?;
3726        match content_type {
3727            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3728            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
3729            ContentType::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`")))),
3730        }
3731    } else {
3732        let content = resp.text().await?;
3733        let entity: Option<CreateEntityError> = serde_json::from_str(&content).ok();
3734        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3735    }
3736}
3737
3738/// Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
3739pub async fn create_entity_type(configuration: &configuration::Configuration, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypeError>> {
3740    // add a prefix to parameters to efficiently prevent name collisions
3741    let p_body_entity_type_request = entity_type_request;
3742
3743    let uri_str = format!("{}/api/entity/type", configuration.base_path);
3744    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3745
3746    if let Some(ref user_agent) = configuration.user_agent {
3747        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3748    }
3749    if let Some(ref apikey) = configuration.api_key {
3750        let key = apikey.key.clone();
3751        let value = match apikey.prefix {
3752            Some(ref prefix) => format!("{} {}", prefix, key),
3753            None => key,
3754        };
3755        req_builder = req_builder.header("Authorization", value);
3756    };
3757    req_builder = req_builder.json(&p_body_entity_type_request);
3758
3759    let req = req_builder.build()?;
3760    let resp = configuration.client.execute(req).await?;
3761
3762    let status = resp.status();
3763    let content_type = resp
3764        .headers()
3765        .get("content-type")
3766        .and_then(|v| v.to_str().ok())
3767        .unwrap_or("application/octet-stream");
3768    let content_type = super::ContentType::from(content_type);
3769
3770    if !status.is_client_error() && !status.is_server_error() {
3771        let content = resp.text().await?;
3772        match content_type {
3773            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3774            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3775            ContentType::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`")))),
3776        }
3777    } else {
3778        let content = resp.text().await?;
3779        let entity: Option<CreateEntityTypeError> = serde_json::from_str(&content).ok();
3780        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3781    }
3782}
3783
3784/// 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.
3785pub async fn create_entity_type_permission(configuration: &configuration::Configuration, entity_type_id: &str, entity_type_request: Option<models::EntityTypeRequest>) -> Result<models::EntityTypeResponse, Error<CreateEntityTypePermissionError>> {
3786    // add a prefix to parameters to efficiently prevent name collisions
3787    let p_path_entity_type_id = entity_type_id;
3788    let p_body_entity_type_request = entity_type_request;
3789
3790    let uri_str = format!("{}/api/entity/type/{entityTypeId}/permission", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
3791    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3792
3793    if let Some(ref user_agent) = configuration.user_agent {
3794        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3795    }
3796    if let Some(ref apikey) = configuration.api_key {
3797        let key = apikey.key.clone();
3798        let value = match apikey.prefix {
3799            Some(ref prefix) => format!("{} {}", prefix, key),
3800            None => key,
3801        };
3802        req_builder = req_builder.header("Authorization", value);
3803    };
3804    req_builder = req_builder.json(&p_body_entity_type_request);
3805
3806    let req = req_builder.build()?;
3807    let resp = configuration.client.execute(req).await?;
3808
3809    let status = resp.status();
3810    let content_type = resp
3811        .headers()
3812        .get("content-type")
3813        .and_then(|v| v.to_str().ok())
3814        .unwrap_or("application/octet-stream");
3815    let content_type = super::ContentType::from(content_type);
3816
3817    if !status.is_client_error() && !status.is_server_error() {
3818        let content = resp.text().await?;
3819        match content_type {
3820            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3821            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3822            ContentType::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`")))),
3823        }
3824    } else {
3825        let content = resp.text().await?;
3826        let entity: Option<CreateEntityTypePermissionError> = serde_json::from_str(&content).ok();
3827        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3828    }
3829}
3830
3831/// 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.
3832pub 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>> {
3833    // add a prefix to parameters to efficiently prevent name collisions
3834    let p_path_entity_type_id = entity_type_id;
3835    let p_path_permission_id = permission_id;
3836    let p_body_entity_type_request = entity_type_request;
3837
3838    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));
3839    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3840
3841    if let Some(ref user_agent) = configuration.user_agent {
3842        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3843    }
3844    if let Some(ref apikey) = configuration.api_key {
3845        let key = apikey.key.clone();
3846        let value = match apikey.prefix {
3847            Some(ref prefix) => format!("{} {}", prefix, key),
3848            None => key,
3849        };
3850        req_builder = req_builder.header("Authorization", value);
3851    };
3852    req_builder = req_builder.json(&p_body_entity_type_request);
3853
3854    let req = req_builder.build()?;
3855    let resp = configuration.client.execute(req).await?;
3856
3857    let status = resp.status();
3858    let content_type = resp
3859        .headers()
3860        .get("content-type")
3861        .and_then(|v| v.to_str().ok())
3862        .unwrap_or("application/octet-stream");
3863    let content_type = super::ContentType::from(content_type);
3864
3865    if !status.is_client_error() && !status.is_server_error() {
3866        let content = resp.text().await?;
3867        match content_type {
3868            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3869            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3870            ContentType::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`")))),
3871        }
3872    } else {
3873        let content = resp.text().await?;
3874        let entity: Option<CreateEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
3875        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3876    }
3877}
3878
3879/// Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
3880pub 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>> {
3881    // add a prefix to parameters to efficiently prevent name collisions
3882    let p_path_entity_type_id = entity_type_id;
3883    let p_body_entity_type_request = entity_type_request;
3884
3885    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
3886    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3887
3888    if let Some(ref user_agent) = configuration.user_agent {
3889        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3890    }
3891    if let Some(ref apikey) = configuration.api_key {
3892        let key = apikey.key.clone();
3893        let value = match apikey.prefix {
3894            Some(ref prefix) => format!("{} {}", prefix, key),
3895            None => key,
3896        };
3897        req_builder = req_builder.header("Authorization", value);
3898    };
3899    req_builder = req_builder.json(&p_body_entity_type_request);
3900
3901    let req = req_builder.build()?;
3902    let resp = configuration.client.execute(req).await?;
3903
3904    let status = resp.status();
3905    let content_type = resp
3906        .headers()
3907        .get("content-type")
3908        .and_then(|v| v.to_str().ok())
3909        .unwrap_or("application/octet-stream");
3910    let content_type = super::ContentType::from(content_type);
3911
3912    if !status.is_client_error() && !status.is_server_error() {
3913        let content = resp.text().await?;
3914        match content_type {
3915            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3916            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
3917            ContentType::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`")))),
3918        }
3919    } else {
3920        let content = resp.text().await?;
3921        let entity: Option<CreateEntityTypeWithIdError> = serde_json::from_str(&content).ok();
3922        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3923    }
3924}
3925
3926/// Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
3927pub 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>> {
3928    // add a prefix to parameters to efficiently prevent name collisions
3929    let p_path_entity_id = entity_id;
3930    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3931    let p_body_entity_request = entity_request;
3932
3933    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
3934    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3935
3936    if let Some(ref user_agent) = configuration.user_agent {
3937        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3938    }
3939    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3940        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3941    }
3942    if let Some(ref apikey) = configuration.api_key {
3943        let key = apikey.key.clone();
3944        let value = match apikey.prefix {
3945            Some(ref prefix) => format!("{} {}", prefix, key),
3946            None => key,
3947        };
3948        req_builder = req_builder.header("Authorization", value);
3949    };
3950    req_builder = req_builder.json(&p_body_entity_request);
3951
3952    let req = req_builder.build()?;
3953    let resp = configuration.client.execute(req).await?;
3954
3955    let status = resp.status();
3956    let content_type = resp
3957        .headers()
3958        .get("content-type")
3959        .and_then(|v| v.to_str().ok())
3960        .unwrap_or("application/octet-stream");
3961    let content_type = super::ContentType::from(content_type);
3962
3963    if !status.is_client_error() && !status.is_server_error() {
3964        let content = resp.text().await?;
3965        match content_type {
3966            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3967            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
3968            ContentType::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`")))),
3969        }
3970    } else {
3971        let content = resp.text().await?;
3972        let entity: Option<CreateEntityWithIdError> = serde_json::from_str(&content).ok();
3973        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3974    }
3975}
3976
3977/// 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.
3978pub async fn create_family(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, family_request: Option<models::FamilyRequest>) -> Result<models::FamilyResponse, Error<CreateFamilyError>> {
3979    // add a prefix to parameters to efficiently prevent name collisions
3980    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
3981    let p_body_family_request = family_request;
3982
3983    let uri_str = format!("{}/api/user/family", configuration.base_path);
3984    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3985
3986    if let Some(ref user_agent) = configuration.user_agent {
3987        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3988    }
3989    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
3990        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
3991    }
3992    if let Some(ref apikey) = configuration.api_key {
3993        let key = apikey.key.clone();
3994        let value = match apikey.prefix {
3995            Some(ref prefix) => format!("{} {}", prefix, key),
3996            None => key,
3997        };
3998        req_builder = req_builder.header("Authorization", value);
3999    };
4000    req_builder = req_builder.json(&p_body_family_request);
4001
4002    let req = req_builder.build()?;
4003    let resp = configuration.client.execute(req).await?;
4004
4005    let status = resp.status();
4006    let content_type = resp
4007        .headers()
4008        .get("content-type")
4009        .and_then(|v| v.to_str().ok())
4010        .unwrap_or("application/octet-stream");
4011    let content_type = super::ContentType::from(content_type);
4012
4013    if !status.is_client_error() && !status.is_server_error() {
4014        let content = resp.text().await?;
4015        match content_type {
4016            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4017            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
4018            ContentType::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`")))),
4019        }
4020    } else {
4021        let content = resp.text().await?;
4022        let entity: Option<CreateFamilyError> = serde_json::from_str(&content).ok();
4023        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4024    }
4025}
4026
4027/// 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.
4028pub 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>> {
4029    // add a prefix to parameters to efficiently prevent name collisions
4030    let p_path_family_id = family_id;
4031    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4032    let p_body_family_request = family_request;
4033
4034    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_id));
4035    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4036
4037    if let Some(ref user_agent) = configuration.user_agent {
4038        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4039    }
4040    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4041        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4042    }
4043    if let Some(ref apikey) = configuration.api_key {
4044        let key = apikey.key.clone();
4045        let value = match apikey.prefix {
4046            Some(ref prefix) => format!("{} {}", prefix, key),
4047            None => key,
4048        };
4049        req_builder = req_builder.header("Authorization", value);
4050    };
4051    req_builder = req_builder.json(&p_body_family_request);
4052
4053    let req = req_builder.build()?;
4054    let resp = configuration.client.execute(req).await?;
4055
4056    let status = resp.status();
4057    let content_type = resp
4058        .headers()
4059        .get("content-type")
4060        .and_then(|v| v.to_str().ok())
4061        .unwrap_or("application/octet-stream");
4062    let content_type = super::ContentType::from(content_type);
4063
4064    if !status.is_client_error() && !status.is_server_error() {
4065        let content = resp.text().await?;
4066        match content_type {
4067            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4068            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
4069            ContentType::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`")))),
4070        }
4071    } else {
4072        let content = resp.text().await?;
4073        let entity: Option<CreateFamilyWithIdError> = serde_json::from_str(&content).ok();
4074        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4075    }
4076}
4077
4078/// Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
4079pub async fn create_form(configuration: &configuration::Configuration, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<CreateFormError>> {
4080    // add a prefix to parameters to efficiently prevent name collisions
4081    let p_body_form_request = form_request;
4082
4083    let uri_str = format!("{}/api/form", configuration.base_path);
4084    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4085
4086    if let Some(ref user_agent) = configuration.user_agent {
4087        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4088    }
4089    if let Some(ref apikey) = configuration.api_key {
4090        let key = apikey.key.clone();
4091        let value = match apikey.prefix {
4092            Some(ref prefix) => format!("{} {}", prefix, key),
4093            None => key,
4094        };
4095        req_builder = req_builder.header("Authorization", value);
4096    };
4097    req_builder = req_builder.json(&p_body_form_request);
4098
4099    let req = req_builder.build()?;
4100    let resp = configuration.client.execute(req).await?;
4101
4102    let status = resp.status();
4103    let content_type = resp
4104        .headers()
4105        .get("content-type")
4106        .and_then(|v| v.to_str().ok())
4107        .unwrap_or("application/octet-stream");
4108    let content_type = super::ContentType::from(content_type);
4109
4110    if !status.is_client_error() && !status.is_server_error() {
4111        let content = resp.text().await?;
4112        match content_type {
4113            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4114            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
4115            ContentType::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`")))),
4116        }
4117    } else {
4118        let content = resp.text().await?;
4119        let entity: Option<CreateFormError> = serde_json::from_str(&content).ok();
4120        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4121    }
4122}
4123
4124/// Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
4125pub async fn create_form_field(configuration: &configuration::Configuration, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<CreateFormFieldError>> {
4126    // add a prefix to parameters to efficiently prevent name collisions
4127    let p_body_form_field_request = form_field_request;
4128
4129    let uri_str = format!("{}/api/form/field", configuration.base_path);
4130    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4131
4132    if let Some(ref user_agent) = configuration.user_agent {
4133        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4134    }
4135    if let Some(ref apikey) = configuration.api_key {
4136        let key = apikey.key.clone();
4137        let value = match apikey.prefix {
4138            Some(ref prefix) => format!("{} {}", prefix, key),
4139            None => key,
4140        };
4141        req_builder = req_builder.header("Authorization", value);
4142    };
4143    req_builder = req_builder.json(&p_body_form_field_request);
4144
4145    let req = req_builder.build()?;
4146    let resp = configuration.client.execute(req).await?;
4147
4148    let status = resp.status();
4149    let content_type = resp
4150        .headers()
4151        .get("content-type")
4152        .and_then(|v| v.to_str().ok())
4153        .unwrap_or("application/octet-stream");
4154    let content_type = super::ContentType::from(content_type);
4155
4156    if !status.is_client_error() && !status.is_server_error() {
4157        let content = resp.text().await?;
4158        match content_type {
4159            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4160            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
4161            ContentType::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`")))),
4162        }
4163    } else {
4164        let content = resp.text().await?;
4165        let entity: Option<CreateFormFieldError> = serde_json::from_str(&content).ok();
4166        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4167    }
4168}
4169
4170/// Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
4171pub async fn create_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<CreateFormFieldWithIdError>> {
4172    // add a prefix to parameters to efficiently prevent name collisions
4173    let p_path_field_id = field_id;
4174    let p_body_form_field_request = form_field_request;
4175
4176    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
4177    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4178
4179    if let Some(ref user_agent) = configuration.user_agent {
4180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4181    }
4182    if let Some(ref apikey) = configuration.api_key {
4183        let key = apikey.key.clone();
4184        let value = match apikey.prefix {
4185            Some(ref prefix) => format!("{} {}", prefix, key),
4186            None => key,
4187        };
4188        req_builder = req_builder.header("Authorization", value);
4189    };
4190    req_builder = req_builder.json(&p_body_form_field_request);
4191
4192    let req = req_builder.build()?;
4193    let resp = configuration.client.execute(req).await?;
4194
4195    let status = resp.status();
4196    let content_type = resp
4197        .headers()
4198        .get("content-type")
4199        .and_then(|v| v.to_str().ok())
4200        .unwrap_or("application/octet-stream");
4201    let content_type = super::ContentType::from(content_type);
4202
4203    if !status.is_client_error() && !status.is_server_error() {
4204        let content = resp.text().await?;
4205        match content_type {
4206            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4207            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
4208            ContentType::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`")))),
4209        }
4210    } else {
4211        let content = resp.text().await?;
4212        let entity: Option<CreateFormFieldWithIdError> = serde_json::from_str(&content).ok();
4213        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4214    }
4215}
4216
4217/// Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
4218pub async fn create_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<CreateFormWithIdError>> {
4219    // add a prefix to parameters to efficiently prevent name collisions
4220    let p_path_form_id = form_id;
4221    let p_body_form_request = form_request;
4222
4223    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
4224    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4225
4226    if let Some(ref user_agent) = configuration.user_agent {
4227        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4228    }
4229    if let Some(ref apikey) = configuration.api_key {
4230        let key = apikey.key.clone();
4231        let value = match apikey.prefix {
4232            Some(ref prefix) => format!("{} {}", prefix, key),
4233            None => key,
4234        };
4235        req_builder = req_builder.header("Authorization", value);
4236    };
4237    req_builder = req_builder.json(&p_body_form_request);
4238
4239    let req = req_builder.build()?;
4240    let resp = configuration.client.execute(req).await?;
4241
4242    let status = resp.status();
4243    let content_type = resp
4244        .headers()
4245        .get("content-type")
4246        .and_then(|v| v.to_str().ok())
4247        .unwrap_or("application/octet-stream");
4248    let content_type = super::ContentType::from(content_type);
4249
4250    if !status.is_client_error() && !status.is_server_error() {
4251        let content = resp.text().await?;
4252        match content_type {
4253            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4254            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
4255            ContentType::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`")))),
4256        }
4257    } else {
4258        let content = resp.text().await?;
4259        let entity: Option<CreateFormWithIdError> = serde_json::from_str(&content).ok();
4260        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4261    }
4262}
4263
4264/// Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
4265pub async fn create_group(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, group_request: Option<models::GroupRequest>) -> Result<models::GroupResponse, Error<CreateGroupError>> {
4266    // add a prefix to parameters to efficiently prevent name collisions
4267    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4268    let p_body_group_request = group_request;
4269
4270    let uri_str = format!("{}/api/group", configuration.base_path);
4271    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4272
4273    if let Some(ref user_agent) = configuration.user_agent {
4274        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4275    }
4276    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4277        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4278    }
4279    if let Some(ref apikey) = configuration.api_key {
4280        let key = apikey.key.clone();
4281        let value = match apikey.prefix {
4282            Some(ref prefix) => format!("{} {}", prefix, key),
4283            None => key,
4284        };
4285        req_builder = req_builder.header("Authorization", value);
4286    };
4287    req_builder = req_builder.json(&p_body_group_request);
4288
4289    let req = req_builder.build()?;
4290    let resp = configuration.client.execute(req).await?;
4291
4292    let status = resp.status();
4293    let content_type = resp
4294        .headers()
4295        .get("content-type")
4296        .and_then(|v| v.to_str().ok())
4297        .unwrap_or("application/octet-stream");
4298    let content_type = super::ContentType::from(content_type);
4299
4300    if !status.is_client_error() && !status.is_server_error() {
4301        let content = resp.text().await?;
4302        match content_type {
4303            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4304            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
4305            ContentType::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`")))),
4306        }
4307    } else {
4308        let content = resp.text().await?;
4309        let entity: Option<CreateGroupError> = serde_json::from_str(&content).ok();
4310        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4311    }
4312}
4313
4314/// Creates a member in a group.
4315pub async fn create_group_members_with_id(configuration: &configuration::Configuration, member_request: Option<models::MemberRequest>) -> Result<models::MemberResponse, Error<CreateGroupMembersWithIdError>> {
4316    // add a prefix to parameters to efficiently prevent name collisions
4317    let p_body_member_request = member_request;
4318
4319    let uri_str = format!("{}/api/group/member", configuration.base_path);
4320    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4321
4322    if let Some(ref user_agent) = configuration.user_agent {
4323        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4324    }
4325    if let Some(ref apikey) = configuration.api_key {
4326        let key = apikey.key.clone();
4327        let value = match apikey.prefix {
4328            Some(ref prefix) => format!("{} {}", prefix, key),
4329            None => key,
4330        };
4331        req_builder = req_builder.header("Authorization", value);
4332    };
4333    req_builder = req_builder.json(&p_body_member_request);
4334
4335    let req = req_builder.build()?;
4336    let resp = configuration.client.execute(req).await?;
4337
4338    let status = resp.status();
4339    let content_type = resp
4340        .headers()
4341        .get("content-type")
4342        .and_then(|v| v.to_str().ok())
4343        .unwrap_or("application/octet-stream");
4344    let content_type = super::ContentType::from(content_type);
4345
4346    if !status.is_client_error() && !status.is_server_error() {
4347        let content = resp.text().await?;
4348        match content_type {
4349            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4350            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MemberResponse`"))),
4351            ContentType::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`")))),
4352        }
4353    } else {
4354        let content = resp.text().await?;
4355        let entity: Option<CreateGroupMembersWithIdError> = serde_json::from_str(&content).ok();
4356        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4357    }
4358}
4359
4360/// Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
4361pub 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>> {
4362    // add a prefix to parameters to efficiently prevent name collisions
4363    let p_path_group_id = group_id;
4364    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4365    let p_body_group_request = group_request;
4366
4367    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
4368    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4369
4370    if let Some(ref user_agent) = configuration.user_agent {
4371        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4372    }
4373    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4374        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4375    }
4376    if let Some(ref apikey) = configuration.api_key {
4377        let key = apikey.key.clone();
4378        let value = match apikey.prefix {
4379            Some(ref prefix) => format!("{} {}", prefix, key),
4380            None => key,
4381        };
4382        req_builder = req_builder.header("Authorization", value);
4383    };
4384    req_builder = req_builder.json(&p_body_group_request);
4385
4386    let req = req_builder.build()?;
4387    let resp = configuration.client.execute(req).await?;
4388
4389    let status = resp.status();
4390    let content_type = resp
4391        .headers()
4392        .get("content-type")
4393        .and_then(|v| v.to_str().ok())
4394        .unwrap_or("application/octet-stream");
4395    let content_type = super::ContentType::from(content_type);
4396
4397    if !status.is_client_error() && !status.is_server_error() {
4398        let content = resp.text().await?;
4399        match content_type {
4400            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4401            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
4402            ContentType::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`")))),
4403        }
4404    } else {
4405        let content = resp.text().await?;
4406        let entity: Option<CreateGroupWithIdError> = serde_json::from_str(&content).ok();
4407        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4408    }
4409}
4410
4411/// Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
4412pub async fn create_identity_provider(configuration: &configuration::Configuration, identity_provider_request: Option<models::IdentityProviderRequest>) -> Result<models::IdentityProviderResponse, Error<CreateIdentityProviderError>> {
4413    // add a prefix to parameters to efficiently prevent name collisions
4414    let p_body_identity_provider_request = identity_provider_request;
4415
4416    let uri_str = format!("{}/api/identity-provider", configuration.base_path);
4417    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4418
4419    if let Some(ref user_agent) = configuration.user_agent {
4420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4421    }
4422    if let Some(ref apikey) = configuration.api_key {
4423        let key = apikey.key.clone();
4424        let value = match apikey.prefix {
4425            Some(ref prefix) => format!("{} {}", prefix, key),
4426            None => key,
4427        };
4428        req_builder = req_builder.header("Authorization", value);
4429    };
4430    req_builder = req_builder.json(&p_body_identity_provider_request);
4431
4432    let req = req_builder.build()?;
4433    let resp = configuration.client.execute(req).await?;
4434
4435    let status = resp.status();
4436    let content_type = resp
4437        .headers()
4438        .get("content-type")
4439        .and_then(|v| v.to_str().ok())
4440        .unwrap_or("application/octet-stream");
4441    let content_type = super::ContentType::from(content_type);
4442
4443    if !status.is_client_error() && !status.is_server_error() {
4444        let content = resp.text().await?;
4445        match content_type {
4446            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4447            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
4448            ContentType::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`")))),
4449        }
4450    } else {
4451        let content = resp.text().await?;
4452        let entity: Option<CreateIdentityProviderError> = serde_json::from_str(&content).ok();
4453        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4454    }
4455}
4456
4457/// Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
4458pub 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>> {
4459    // add a prefix to parameters to efficiently prevent name collisions
4460    let p_path_identity_provider_id = identity_provider_id;
4461    let p_body_identity_provider_request = identity_provider_request;
4462
4463    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
4464    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4465
4466    if let Some(ref user_agent) = configuration.user_agent {
4467        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4468    }
4469    if let Some(ref apikey) = configuration.api_key {
4470        let key = apikey.key.clone();
4471        let value = match apikey.prefix {
4472            Some(ref prefix) => format!("{} {}", prefix, key),
4473            None => key,
4474        };
4475        req_builder = req_builder.header("Authorization", value);
4476    };
4477    req_builder = req_builder.json(&p_body_identity_provider_request);
4478
4479    let req = req_builder.build()?;
4480    let resp = configuration.client.execute(req).await?;
4481
4482    let status = resp.status();
4483    let content_type = resp
4484        .headers()
4485        .get("content-type")
4486        .and_then(|v| v.to_str().ok())
4487        .unwrap_or("application/octet-stream");
4488    let content_type = super::ContentType::from(content_type);
4489
4490    if !status.is_client_error() && !status.is_server_error() {
4491        let content = resp.text().await?;
4492        match content_type {
4493            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4494            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
4495            ContentType::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`")))),
4496        }
4497    } else {
4498        let content = resp.text().await?;
4499        let entity: Option<CreateIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
4500        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4501    }
4502}
4503
4504/// Inspect an access token issued as the result of the Client Credentials Grant. OR 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. 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.
4505pub async fn create_introspect(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<CreateIntrospectError>> {
4506
4507    let uri_str = format!("{}/oauth2/introspect", configuration.base_path);
4508    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4509
4510    if let Some(ref user_agent) = configuration.user_agent {
4511        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4512    }
4513    if let Some(ref apikey) = configuration.api_key {
4514        let key = apikey.key.clone();
4515        let value = match apikey.prefix {
4516            Some(ref prefix) => format!("{} {}", prefix, key),
4517            None => key,
4518        };
4519        req_builder = req_builder.header("Authorization", value);
4520    };
4521
4522    let req = req_builder.build()?;
4523    let resp = configuration.client.execute(req).await?;
4524
4525    let status = resp.status();
4526    let content_type = resp
4527        .headers()
4528        .get("content-type")
4529        .and_then(|v| v.to_str().ok())
4530        .unwrap_or("application/octet-stream");
4531    let content_type = super::ContentType::from(content_type);
4532
4533    if !status.is_client_error() && !status.is_server_error() {
4534        let content = resp.text().await?;
4535        match content_type {
4536            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4537            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4538            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`")))),
4539        }
4540    } else {
4541        let content = resp.text().await?;
4542        let entity: Option<CreateIntrospectError> = serde_json::from_str(&content).ok();
4543        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4544    }
4545}
4546
4547/// 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.
4548pub async fn create_ip_access_control_list(configuration: &configuration::Configuration, ip_access_control_list_request: Option<models::IpAccessControlListRequest>) -> Result<models::IpAccessControlListResponse, Error<CreateIpAccessControlListError>> {
4549    // add a prefix to parameters to efficiently prevent name collisions
4550    let p_body_ip_access_control_list_request = ip_access_control_list_request;
4551
4552    let uri_str = format!("{}/api/ip-acl", configuration.base_path);
4553    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4554
4555    if let Some(ref user_agent) = configuration.user_agent {
4556        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4557    }
4558    if let Some(ref apikey) = configuration.api_key {
4559        let key = apikey.key.clone();
4560        let value = match apikey.prefix {
4561            Some(ref prefix) => format!("{} {}", prefix, key),
4562            None => key,
4563        };
4564        req_builder = req_builder.header("Authorization", value);
4565    };
4566    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
4567
4568    let req = req_builder.build()?;
4569    let resp = configuration.client.execute(req).await?;
4570
4571    let status = resp.status();
4572    let content_type = resp
4573        .headers()
4574        .get("content-type")
4575        .and_then(|v| v.to_str().ok())
4576        .unwrap_or("application/octet-stream");
4577    let content_type = super::ContentType::from(content_type);
4578
4579    if !status.is_client_error() && !status.is_server_error() {
4580        let content = resp.text().await?;
4581        match content_type {
4582            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4583            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
4584            ContentType::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`")))),
4585        }
4586    } else {
4587        let content = resp.text().await?;
4588        let entity: Option<CreateIpAccessControlListError> = serde_json::from_str(&content).ok();
4589        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4590    }
4591}
4592
4593/// 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.
4594pub 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>> {
4595    // add a prefix to parameters to efficiently prevent name collisions
4596    let p_path_access_control_list_id = access_control_list_id;
4597    let p_body_ip_access_control_list_request = ip_access_control_list_request;
4598
4599    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_path_access_control_list_id));
4600    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4601
4602    if let Some(ref user_agent) = configuration.user_agent {
4603        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4604    }
4605    if let Some(ref apikey) = configuration.api_key {
4606        let key = apikey.key.clone();
4607        let value = match apikey.prefix {
4608            Some(ref prefix) => format!("{} {}", prefix, key),
4609            None => key,
4610        };
4611        req_builder = req_builder.header("Authorization", value);
4612    };
4613    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
4614
4615    let req = req_builder.build()?;
4616    let resp = configuration.client.execute(req).await?;
4617
4618    let status = resp.status();
4619    let content_type = resp
4620        .headers()
4621        .get("content-type")
4622        .and_then(|v| v.to_str().ok())
4623        .unwrap_or("application/octet-stream");
4624    let content_type = super::ContentType::from(content_type);
4625
4626    if !status.is_client_error() && !status.is_server_error() {
4627        let content = resp.text().await?;
4628        match content_type {
4629            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4630            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
4631            ContentType::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`")))),
4632        }
4633    } else {
4634        let content = resp.text().await?;
4635        let entity: Option<CreateIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
4636        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4637    }
4638}
4639
4640/// Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
4641pub async fn create_lambda(configuration: &configuration::Configuration, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<CreateLambdaError>> {
4642    // add a prefix to parameters to efficiently prevent name collisions
4643    let p_body_lambda_request = lambda_request;
4644
4645    let uri_str = format!("{}/api/lambda", configuration.base_path);
4646    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4647
4648    if let Some(ref user_agent) = configuration.user_agent {
4649        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4650    }
4651    if let Some(ref apikey) = configuration.api_key {
4652        let key = apikey.key.clone();
4653        let value = match apikey.prefix {
4654            Some(ref prefix) => format!("{} {}", prefix, key),
4655            None => key,
4656        };
4657        req_builder = req_builder.header("Authorization", value);
4658    };
4659    req_builder = req_builder.json(&p_body_lambda_request);
4660
4661    let req = req_builder.build()?;
4662    let resp = configuration.client.execute(req).await?;
4663
4664    let status = resp.status();
4665    let content_type = resp
4666        .headers()
4667        .get("content-type")
4668        .and_then(|v| v.to_str().ok())
4669        .unwrap_or("application/octet-stream");
4670    let content_type = super::ContentType::from(content_type);
4671
4672    if !status.is_client_error() && !status.is_server_error() {
4673        let content = resp.text().await?;
4674        match content_type {
4675            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4676            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
4677            ContentType::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`")))),
4678        }
4679    } else {
4680        let content = resp.text().await?;
4681        let entity: Option<CreateLambdaError> = serde_json::from_str(&content).ok();
4682        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4683    }
4684}
4685
4686/// Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
4687pub async fn create_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<CreateLambdaWithIdError>> {
4688    // add a prefix to parameters to efficiently prevent name collisions
4689    let p_path_lambda_id = lambda_id;
4690    let p_body_lambda_request = lambda_request;
4691
4692    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
4693    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4694
4695    if let Some(ref user_agent) = configuration.user_agent {
4696        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4697    }
4698    if let Some(ref apikey) = configuration.api_key {
4699        let key = apikey.key.clone();
4700        let value = match apikey.prefix {
4701            Some(ref prefix) => format!("{} {}", prefix, key),
4702            None => key,
4703        };
4704        req_builder = req_builder.header("Authorization", value);
4705    };
4706    req_builder = req_builder.json(&p_body_lambda_request);
4707
4708    let req = req_builder.build()?;
4709    let resp = configuration.client.execute(req).await?;
4710
4711    let status = resp.status();
4712    let content_type = resp
4713        .headers()
4714        .get("content-type")
4715        .and_then(|v| v.to_str().ok())
4716        .unwrap_or("application/octet-stream");
4717    let content_type = super::ContentType::from(content_type);
4718
4719    if !status.is_client_error() && !status.is_server_error() {
4720        let content = resp.text().await?;
4721        match content_type {
4722            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4723            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
4724            ContentType::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`")))),
4725        }
4726    } else {
4727        let content = resp.text().await?;
4728        let entity: Option<CreateLambdaWithIdError> = serde_json::from_str(&content).ok();
4729        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4730    }
4731}
4732
4733/// 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.
4734pub async fn create_logout(configuration: &configuration::Configuration, global: Option<&str>, refresh_token: Option<&str>, logout_request: Option<models::LogoutRequest>) -> Result<(), Error<CreateLogoutError>> {
4735    // add a prefix to parameters to efficiently prevent name collisions
4736    let p_query_global = global;
4737    let p_query_refresh_token = refresh_token;
4738    let p_body_logout_request = logout_request;
4739
4740    let uri_str = format!("{}/api/logout", configuration.base_path);
4741    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4742
4743    if let Some(ref param_value) = p_query_global {
4744        req_builder = req_builder.query(&[("global", &param_value.to_string())]);
4745    }
4746    if let Some(ref param_value) = p_query_refresh_token {
4747        req_builder = req_builder.query(&[("refreshToken", &param_value.to_string())]);
4748    }
4749    if let Some(ref user_agent) = configuration.user_agent {
4750        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4751    }
4752    if let Some(ref apikey) = configuration.api_key {
4753        let key = apikey.key.clone();
4754        let value = match apikey.prefix {
4755            Some(ref prefix) => format!("{} {}", prefix, key),
4756            None => key,
4757        };
4758        req_builder = req_builder.header("Authorization", value);
4759    };
4760    req_builder = req_builder.json(&p_body_logout_request);
4761
4762    let req = req_builder.build()?;
4763    let resp = configuration.client.execute(req).await?;
4764
4765    let status = resp.status();
4766
4767    if !status.is_client_error() && !status.is_server_error() {
4768        Ok(())
4769    } else {
4770        let content = resp.text().await?;
4771        let entity: Option<CreateLogoutError> = serde_json::from_str(&content).ok();
4772        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4773    }
4774}
4775
4776/// Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
4777pub async fn create_message_template(configuration: &configuration::Configuration, message_template_request: Option<models::MessageTemplateRequest>) -> Result<models::MessageTemplateResponse, Error<CreateMessageTemplateError>> {
4778    // add a prefix to parameters to efficiently prevent name collisions
4779    let p_body_message_template_request = message_template_request;
4780
4781    let uri_str = format!("{}/api/message/template", configuration.base_path);
4782    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4783
4784    if let Some(ref user_agent) = configuration.user_agent {
4785        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4786    }
4787    if let Some(ref apikey) = configuration.api_key {
4788        let key = apikey.key.clone();
4789        let value = match apikey.prefix {
4790            Some(ref prefix) => format!("{} {}", prefix, key),
4791            None => key,
4792        };
4793        req_builder = req_builder.header("Authorization", value);
4794    };
4795    req_builder = req_builder.json(&p_body_message_template_request);
4796
4797    let req = req_builder.build()?;
4798    let resp = configuration.client.execute(req).await?;
4799
4800    let status = resp.status();
4801    let content_type = resp
4802        .headers()
4803        .get("content-type")
4804        .and_then(|v| v.to_str().ok())
4805        .unwrap_or("application/octet-stream");
4806    let content_type = super::ContentType::from(content_type);
4807
4808    if !status.is_client_error() && !status.is_server_error() {
4809        let content = resp.text().await?;
4810        match content_type {
4811            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4812            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
4813            ContentType::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`")))),
4814        }
4815    } else {
4816        let content = resp.text().await?;
4817        let entity: Option<CreateMessageTemplateError> = serde_json::from_str(&content).ok();
4818        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4819    }
4820}
4821
4822/// Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
4823pub 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>> {
4824    // add a prefix to parameters to efficiently prevent name collisions
4825    let p_path_message_template_id = message_template_id;
4826    let p_body_message_template_request = message_template_request;
4827
4828    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
4829    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4830
4831    if let Some(ref user_agent) = configuration.user_agent {
4832        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4833    }
4834    if let Some(ref apikey) = configuration.api_key {
4835        let key = apikey.key.clone();
4836        let value = match apikey.prefix {
4837            Some(ref prefix) => format!("{} {}", prefix, key),
4838            None => key,
4839        };
4840        req_builder = req_builder.header("Authorization", value);
4841    };
4842    req_builder = req_builder.json(&p_body_message_template_request);
4843
4844    let req = req_builder.build()?;
4845    let resp = configuration.client.execute(req).await?;
4846
4847    let status = resp.status();
4848    let content_type = resp
4849        .headers()
4850        .get("content-type")
4851        .and_then(|v| v.to_str().ok())
4852        .unwrap_or("application/octet-stream");
4853    let content_type = super::ContentType::from(content_type);
4854
4855    if !status.is_client_error() && !status.is_server_error() {
4856        let content = resp.text().await?;
4857        match content_type {
4858            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4859            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
4860            ContentType::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`")))),
4861        }
4862    } else {
4863        let content = resp.text().await?;
4864        let entity: Option<CreateMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
4865        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4866    }
4867}
4868
4869/// Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
4870pub async fn create_messenger(configuration: &configuration::Configuration, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<CreateMessengerError>> {
4871    // add a prefix to parameters to efficiently prevent name collisions
4872    let p_body_messenger_request = messenger_request;
4873
4874    let uri_str = format!("{}/api/messenger", configuration.base_path);
4875    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4876
4877    if let Some(ref user_agent) = configuration.user_agent {
4878        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4879    }
4880    if let Some(ref apikey) = configuration.api_key {
4881        let key = apikey.key.clone();
4882        let value = match apikey.prefix {
4883            Some(ref prefix) => format!("{} {}", prefix, key),
4884            None => key,
4885        };
4886        req_builder = req_builder.header("Authorization", value);
4887    };
4888    req_builder = req_builder.json(&p_body_messenger_request);
4889
4890    let req = req_builder.build()?;
4891    let resp = configuration.client.execute(req).await?;
4892
4893    let status = resp.status();
4894    let content_type = resp
4895        .headers()
4896        .get("content-type")
4897        .and_then(|v| v.to_str().ok())
4898        .unwrap_or("application/octet-stream");
4899    let content_type = super::ContentType::from(content_type);
4900
4901    if !status.is_client_error() && !status.is_server_error() {
4902        let content = resp.text().await?;
4903        match content_type {
4904            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4905            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
4906            ContentType::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`")))),
4907        }
4908    } else {
4909        let content = resp.text().await?;
4910        let entity: Option<CreateMessengerError> = serde_json::from_str(&content).ok();
4911        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4912    }
4913}
4914
4915/// Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
4916pub async fn create_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<CreateMessengerWithIdError>> {
4917    // add a prefix to parameters to efficiently prevent name collisions
4918    let p_path_messenger_id = messenger_id;
4919    let p_body_messenger_request = messenger_request;
4920
4921    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
4922    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4923
4924    if let Some(ref user_agent) = configuration.user_agent {
4925        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4926    }
4927    if let Some(ref apikey) = configuration.api_key {
4928        let key = apikey.key.clone();
4929        let value = match apikey.prefix {
4930            Some(ref prefix) => format!("{} {}", prefix, key),
4931            None => key,
4932        };
4933        req_builder = req_builder.header("Authorization", value);
4934    };
4935    req_builder = req_builder.json(&p_body_messenger_request);
4936
4937    let req = req_builder.build()?;
4938    let resp = configuration.client.execute(req).await?;
4939
4940    let status = resp.status();
4941    let content_type = resp
4942        .headers()
4943        .get("content-type")
4944        .and_then(|v| v.to_str().ok())
4945        .unwrap_or("application/octet-stream");
4946    let content_type = super::ContentType::from(content_type);
4947
4948    if !status.is_client_error() && !status.is_server_error() {
4949        let content = resp.text().await?;
4950        match content_type {
4951            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4952            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
4953            ContentType::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`")))),
4954        }
4955    } else {
4956        let content = resp.text().await?;
4957        let entity: Option<CreateMessengerWithIdError> = serde_json::from_str(&content).ok();
4958        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4959    }
4960}
4961
4962/// 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.
4963pub 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>> {
4964    // add a prefix to parameters to efficiently prevent name collisions
4965    let p_path_application_id = application_id;
4966    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
4967    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
4968
4969    let uri_str = format!("{}/api/application/{applicationId}/scope", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
4970    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4971
4972    if let Some(ref user_agent) = configuration.user_agent {
4973        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4974    }
4975    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
4976        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
4977    }
4978    if let Some(ref apikey) = configuration.api_key {
4979        let key = apikey.key.clone();
4980        let value = match apikey.prefix {
4981            Some(ref prefix) => format!("{} {}", prefix, key),
4982            None => key,
4983        };
4984        req_builder = req_builder.header("Authorization", value);
4985    };
4986    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
4987
4988    let req = req_builder.build()?;
4989    let resp = configuration.client.execute(req).await?;
4990
4991    let status = resp.status();
4992    let content_type = resp
4993        .headers()
4994        .get("content-type")
4995        .and_then(|v| v.to_str().ok())
4996        .unwrap_or("application/octet-stream");
4997    let content_type = super::ContentType::from(content_type);
4998
4999    if !status.is_client_error() && !status.is_server_error() {
5000        let content = resp.text().await?;
5001        match content_type {
5002            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5003            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
5004            ContentType::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`")))),
5005        }
5006    } else {
5007        let content = resp.text().await?;
5008        let entity: Option<CreateOAuthScopeError> = serde_json::from_str(&content).ok();
5009        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5010    }
5011}
5012
5013/// 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.
5014pub 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>> {
5015    // add a prefix to parameters to efficiently prevent name collisions
5016    let p_path_application_id = application_id;
5017    let p_path_scope_id = scope_id;
5018    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5019    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
5020
5021    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));
5022    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5023
5024    if let Some(ref user_agent) = configuration.user_agent {
5025        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5026    }
5027    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5028        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5029    }
5030    if let Some(ref apikey) = configuration.api_key {
5031        let key = apikey.key.clone();
5032        let value = match apikey.prefix {
5033            Some(ref prefix) => format!("{} {}", prefix, key),
5034            None => key,
5035        };
5036        req_builder = req_builder.header("Authorization", value);
5037    };
5038    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
5039
5040    let req = req_builder.build()?;
5041    let resp = configuration.client.execute(req).await?;
5042
5043    let status = resp.status();
5044    let content_type = resp
5045        .headers()
5046        .get("content-type")
5047        .and_then(|v| v.to_str().ok())
5048        .unwrap_or("application/octet-stream");
5049    let content_type = super::ContentType::from(content_type);
5050
5051    if !status.is_client_error() && !status.is_server_error() {
5052        let content = resp.text().await?;
5053        match content_type {
5054            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5055            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
5056            ContentType::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`")))),
5057        }
5058    } else {
5059        let content = resp.text().await?;
5060        let entity: Option<CreateOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
5061        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5062    }
5063}
5064
5065/// Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
5066pub async fn create_tenant(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, tenant_request: Option<models::TenantRequest>) -> Result<models::TenantResponse, Error<CreateTenantError>> {
5067    // add a prefix to parameters to efficiently prevent name collisions
5068    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5069    let p_body_tenant_request = tenant_request;
5070
5071    let uri_str = format!("{}/api/tenant", configuration.base_path);
5072    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5073
5074    if let Some(ref user_agent) = configuration.user_agent {
5075        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5076    }
5077    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5078        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5079    }
5080    if let Some(ref apikey) = configuration.api_key {
5081        let key = apikey.key.clone();
5082        let value = match apikey.prefix {
5083            Some(ref prefix) => format!("{} {}", prefix, key),
5084            None => key,
5085        };
5086        req_builder = req_builder.header("Authorization", value);
5087    };
5088    req_builder = req_builder.json(&p_body_tenant_request);
5089
5090    let req = req_builder.build()?;
5091    let resp = configuration.client.execute(req).await?;
5092
5093    let status = resp.status();
5094    let content_type = resp
5095        .headers()
5096        .get("content-type")
5097        .and_then(|v| v.to_str().ok())
5098        .unwrap_or("application/octet-stream");
5099    let content_type = super::ContentType::from(content_type);
5100
5101    if !status.is_client_error() && !status.is_server_error() {
5102        let content = resp.text().await?;
5103        match content_type {
5104            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5105            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
5106            ContentType::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`")))),
5107        }
5108    } else {
5109        let content = resp.text().await?;
5110        let entity: Option<CreateTenantError> = serde_json::from_str(&content).ok();
5111        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5112    }
5113}
5114
5115/// Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
5116pub 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>> {
5117    // add a prefix to parameters to efficiently prevent name collisions
5118    let p_path_tenant_id = tenant_id;
5119    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5120    let p_body_tenant_request = tenant_request;
5121
5122    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
5123    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5124
5125    if let Some(ref user_agent) = configuration.user_agent {
5126        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5127    }
5128    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5129        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5130    }
5131    if let Some(ref apikey) = configuration.api_key {
5132        let key = apikey.key.clone();
5133        let value = match apikey.prefix {
5134            Some(ref prefix) => format!("{} {}", prefix, key),
5135            None => key,
5136        };
5137        req_builder = req_builder.header("Authorization", value);
5138    };
5139    req_builder = req_builder.json(&p_body_tenant_request);
5140
5141    let req = req_builder.build()?;
5142    let resp = configuration.client.execute(req).await?;
5143
5144    let status = resp.status();
5145    let content_type = resp
5146        .headers()
5147        .get("content-type")
5148        .and_then(|v| v.to_str().ok())
5149        .unwrap_or("application/octet-stream");
5150    let content_type = super::ContentType::from(content_type);
5151
5152    if !status.is_client_error() && !status.is_server_error() {
5153        let content = resp.text().await?;
5154        match content_type {
5155            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5156            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
5157            ContentType::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`")))),
5158        }
5159    } else {
5160        let content = resp.text().await?;
5161        let entity: Option<CreateTenantWithIdError> = serde_json::from_str(&content).ok();
5162        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5163    }
5164}
5165
5166/// Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
5167pub async fn create_theme(configuration: &configuration::Configuration, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<CreateThemeError>> {
5168    // add a prefix to parameters to efficiently prevent name collisions
5169    let p_body_theme_request = theme_request;
5170
5171    let uri_str = format!("{}/api/theme", configuration.base_path);
5172    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5173
5174    if let Some(ref user_agent) = configuration.user_agent {
5175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5176    }
5177    if let Some(ref apikey) = configuration.api_key {
5178        let key = apikey.key.clone();
5179        let value = match apikey.prefix {
5180            Some(ref prefix) => format!("{} {}", prefix, key),
5181            None => key,
5182        };
5183        req_builder = req_builder.header("Authorization", value);
5184    };
5185    req_builder = req_builder.json(&p_body_theme_request);
5186
5187    let req = req_builder.build()?;
5188    let resp = configuration.client.execute(req).await?;
5189
5190    let status = resp.status();
5191    let content_type = resp
5192        .headers()
5193        .get("content-type")
5194        .and_then(|v| v.to_str().ok())
5195        .unwrap_or("application/octet-stream");
5196    let content_type = super::ContentType::from(content_type);
5197
5198    if !status.is_client_error() && !status.is_server_error() {
5199        let content = resp.text().await?;
5200        match content_type {
5201            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5202            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
5203            ContentType::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`")))),
5204        }
5205    } else {
5206        let content = resp.text().await?;
5207        let entity: Option<CreateThemeError> = serde_json::from_str(&content).ok();
5208        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5209    }
5210}
5211
5212/// Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
5213pub async fn create_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<CreateThemeWithIdError>> {
5214    // add a prefix to parameters to efficiently prevent name collisions
5215    let p_path_theme_id = theme_id;
5216    let p_body_theme_request = theme_request;
5217
5218    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
5219    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5220
5221    if let Some(ref user_agent) = configuration.user_agent {
5222        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5223    }
5224    if let Some(ref apikey) = configuration.api_key {
5225        let key = apikey.key.clone();
5226        let value = match apikey.prefix {
5227            Some(ref prefix) => format!("{} {}", prefix, key),
5228            None => key,
5229        };
5230        req_builder = req_builder.header("Authorization", value);
5231    };
5232    req_builder = req_builder.json(&p_body_theme_request);
5233
5234    let req = req_builder.build()?;
5235    let resp = configuration.client.execute(req).await?;
5236
5237    let status = resp.status();
5238    let content_type = resp
5239        .headers()
5240        .get("content-type")
5241        .and_then(|v| v.to_str().ok())
5242        .unwrap_or("application/octet-stream");
5243    let content_type = super::ContentType::from(content_type);
5244
5245    if !status.is_client_error() && !status.is_server_error() {
5246        let content = resp.text().await?;
5247        match content_type {
5248            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5249            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
5250            ContentType::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`")))),
5251        }
5252    } else {
5253        let content = resp.text().await?;
5254        let entity: Option<CreateThemeWithIdError> = serde_json::from_str(&content).ok();
5255        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5256    }
5257}
5258
5259/// 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 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 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 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 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 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. OR Make a Client Credentials grant request to obtain an access token.
5260pub async fn create_token(configuration: &configuration::Configuration, ) -> Result<models::AccessToken, Error<CreateTokenError>> {
5261
5262    let uri_str = format!("{}/oauth2/token", configuration.base_path);
5263    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5264
5265    if let Some(ref user_agent) = configuration.user_agent {
5266        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5267    }
5268    if let Some(ref apikey) = configuration.api_key {
5269        let key = apikey.key.clone();
5270        let value = match apikey.prefix {
5271            Some(ref prefix) => format!("{} {}", prefix, key),
5272            None => key,
5273        };
5274        req_builder = req_builder.header("Authorization", value);
5275    };
5276
5277    let req = req_builder.build()?;
5278    let resp = configuration.client.execute(req).await?;
5279
5280    let status = resp.status();
5281    let content_type = resp
5282        .headers()
5283        .get("content-type")
5284        .and_then(|v| v.to_str().ok())
5285        .unwrap_or("application/octet-stream");
5286    let content_type = super::ContentType::from(content_type);
5287
5288    if !status.is_client_error() && !status.is_server_error() {
5289        let content = resp.text().await?;
5290        match content_type {
5291            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5292            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AccessToken`"))),
5293            ContentType::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`")))),
5294        }
5295    } else {
5296        let content = resp.text().await?;
5297        let entity: Option<CreateTokenError> = serde_json::from_str(&content).ok();
5298        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5299    }
5300}
5301
5302/// Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
5303pub async fn create_user(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, user_request: Option<models::UserRequest>) -> Result<models::UserResponse, Error<CreateUserError>> {
5304    // add a prefix to parameters to efficiently prevent name collisions
5305    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5306    let p_body_user_request = user_request;
5307
5308    let uri_str = format!("{}/api/user", configuration.base_path);
5309    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5310
5311    if let Some(ref user_agent) = configuration.user_agent {
5312        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5313    }
5314    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5315        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5316    }
5317    if let Some(ref apikey) = configuration.api_key {
5318        let key = apikey.key.clone();
5319        let value = match apikey.prefix {
5320            Some(ref prefix) => format!("{} {}", prefix, key),
5321            None => key,
5322        };
5323        req_builder = req_builder.header("Authorization", value);
5324    };
5325    req_builder = req_builder.json(&p_body_user_request);
5326
5327    let req = req_builder.build()?;
5328    let resp = configuration.client.execute(req).await?;
5329
5330    let status = resp.status();
5331    let content_type = resp
5332        .headers()
5333        .get("content-type")
5334        .and_then(|v| v.to_str().ok())
5335        .unwrap_or("application/octet-stream");
5336    let content_type = super::ContentType::from(content_type);
5337
5338    if !status.is_client_error() && !status.is_server_error() {
5339        let content = resp.text().await?;
5340        match content_type {
5341            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5342            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
5343            ContentType::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`")))),
5344        }
5345    } else {
5346        let content = resp.text().await?;
5347        let entity: Option<CreateUserError> = serde_json::from_str(&content).ok();
5348        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5349    }
5350}
5351
5352/// 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.
5353pub 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>> {
5354    // add a prefix to parameters to efficiently prevent name collisions
5355    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5356    let p_body_user_action_request = user_action_request;
5357
5358    let uri_str = format!("{}/api/user-action", configuration.base_path);
5359    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5360
5361    if let Some(ref user_agent) = configuration.user_agent {
5362        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5363    }
5364    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5365        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5366    }
5367    if let Some(ref apikey) = configuration.api_key {
5368        let key = apikey.key.clone();
5369        let value = match apikey.prefix {
5370            Some(ref prefix) => format!("{} {}", prefix, key),
5371            None => key,
5372        };
5373        req_builder = req_builder.header("Authorization", value);
5374    };
5375    req_builder = req_builder.json(&p_body_user_action_request);
5376
5377    let req = req_builder.build()?;
5378    let resp = configuration.client.execute(req).await?;
5379
5380    let status = resp.status();
5381    let content_type = resp
5382        .headers()
5383        .get("content-type")
5384        .and_then(|v| v.to_str().ok())
5385        .unwrap_or("application/octet-stream");
5386    let content_type = super::ContentType::from(content_type);
5387
5388    if !status.is_client_error() && !status.is_server_error() {
5389        let content = resp.text().await?;
5390        match content_type {
5391            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5392            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
5393            ContentType::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`")))),
5394        }
5395    } else {
5396        let content = resp.text().await?;
5397        let entity: Option<CreateUserActionError> = serde_json::from_str(&content).ok();
5398        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5399    }
5400}
5401
5402/// 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.
5403pub async fn create_user_action_reason(configuration: &configuration::Configuration, user_action_reason_request: Option<models::UserActionReasonRequest>) -> Result<models::UserActionReasonResponse, Error<CreateUserActionReasonError>> {
5404    // add a prefix to parameters to efficiently prevent name collisions
5405    let p_body_user_action_reason_request = user_action_reason_request;
5406
5407    let uri_str = format!("{}/api/user-action-reason", configuration.base_path);
5408    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5409
5410    if let Some(ref user_agent) = configuration.user_agent {
5411        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5412    }
5413    if let Some(ref apikey) = configuration.api_key {
5414        let key = apikey.key.clone();
5415        let value = match apikey.prefix {
5416            Some(ref prefix) => format!("{} {}", prefix, key),
5417            None => key,
5418        };
5419        req_builder = req_builder.header("Authorization", value);
5420    };
5421    req_builder = req_builder.json(&p_body_user_action_reason_request);
5422
5423    let req = req_builder.build()?;
5424    let resp = configuration.client.execute(req).await?;
5425
5426    let status = resp.status();
5427    let content_type = resp
5428        .headers()
5429        .get("content-type")
5430        .and_then(|v| v.to_str().ok())
5431        .unwrap_or("application/octet-stream");
5432    let content_type = super::ContentType::from(content_type);
5433
5434    if !status.is_client_error() && !status.is_server_error() {
5435        let content = resp.text().await?;
5436        match content_type {
5437            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5438            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
5439            ContentType::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`")))),
5440        }
5441    } else {
5442        let content = resp.text().await?;
5443        let entity: Option<CreateUserActionReasonError> = serde_json::from_str(&content).ok();
5444        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5445    }
5446}
5447
5448/// 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.
5449pub 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>> {
5450    // add a prefix to parameters to efficiently prevent name collisions
5451    let p_path_user_action_reason_id = user_action_reason_id;
5452    let p_body_user_action_reason_request = user_action_reason_request;
5453
5454    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
5455    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5456
5457    if let Some(ref user_agent) = configuration.user_agent {
5458        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5459    }
5460    if let Some(ref apikey) = configuration.api_key {
5461        let key = apikey.key.clone();
5462        let value = match apikey.prefix {
5463            Some(ref prefix) => format!("{} {}", prefix, key),
5464            None => key,
5465        };
5466        req_builder = req_builder.header("Authorization", value);
5467    };
5468    req_builder = req_builder.json(&p_body_user_action_reason_request);
5469
5470    let req = req_builder.build()?;
5471    let resp = configuration.client.execute(req).await?;
5472
5473    let status = resp.status();
5474    let content_type = resp
5475        .headers()
5476        .get("content-type")
5477        .and_then(|v| v.to_str().ok())
5478        .unwrap_or("application/octet-stream");
5479    let content_type = super::ContentType::from(content_type);
5480
5481    if !status.is_client_error() && !status.is_server_error() {
5482        let content = resp.text().await?;
5483        match content_type {
5484            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5485            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
5486            ContentType::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`")))),
5487        }
5488    } else {
5489        let content = resp.text().await?;
5490        let entity: Option<CreateUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
5491        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5492    }
5493}
5494
5495/// 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.
5496pub 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>> {
5497    // add a prefix to parameters to efficiently prevent name collisions
5498    let p_path_user_action_id = user_action_id;
5499    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5500    let p_body_user_action_request = user_action_request;
5501
5502    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
5503    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5504
5505    if let Some(ref user_agent) = configuration.user_agent {
5506        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5507    }
5508    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5509        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5510    }
5511    if let Some(ref apikey) = configuration.api_key {
5512        let key = apikey.key.clone();
5513        let value = match apikey.prefix {
5514            Some(ref prefix) => format!("{} {}", prefix, key),
5515            None => key,
5516        };
5517        req_builder = req_builder.header("Authorization", value);
5518    };
5519    req_builder = req_builder.json(&p_body_user_action_request);
5520
5521    let req = req_builder.build()?;
5522    let resp = configuration.client.execute(req).await?;
5523
5524    let status = resp.status();
5525    let content_type = resp
5526        .headers()
5527        .get("content-type")
5528        .and_then(|v| v.to_str().ok())
5529        .unwrap_or("application/octet-stream");
5530    let content_type = super::ContentType::from(content_type);
5531
5532    if !status.is_client_error() && !status.is_server_error() {
5533        let content = resp.text().await?;
5534        match content_type {
5535            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5536            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
5537            ContentType::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`")))),
5538        }
5539    } else {
5540        let content = resp.text().await?;
5541        let entity: Option<CreateUserActionWithIdError> = serde_json::from_str(&content).ok();
5542        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5543    }
5544}
5545
5546/// 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.
5547pub async fn create_user_change_password(configuration: &configuration::Configuration, change_password_request: Option<models::ChangePasswordRequest>) -> Result<models::ChangePasswordResponse, Error<CreateUserChangePasswordError>> {
5548    // add a prefix to parameters to efficiently prevent name collisions
5549    let p_body_change_password_request = change_password_request;
5550
5551    let uri_str = format!("{}/api/user/change-password", configuration.base_path);
5552    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5553
5554    if let Some(ref user_agent) = configuration.user_agent {
5555        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5556    }
5557    if let Some(ref token) = configuration.bearer_access_token {
5558        req_builder = req_builder.bearer_auth(token.to_owned());
5559    };
5560    req_builder = req_builder.json(&p_body_change_password_request);
5561
5562    let req = req_builder.build()?;
5563    let resp = configuration.client.execute(req).await?;
5564
5565    let status = resp.status();
5566    let content_type = resp
5567        .headers()
5568        .get("content-type")
5569        .and_then(|v| v.to_str().ok())
5570        .unwrap_or("application/octet-stream");
5571    let content_type = super::ContentType::from(content_type);
5572
5573    if !status.is_client_error() && !status.is_server_error() {
5574        let content = resp.text().await?;
5575        match content_type {
5576            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5577            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangePasswordResponse`"))),
5578            ContentType::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`")))),
5579        }
5580    } else {
5581        let content = resp.text().await?;
5582        let entity: Option<CreateUserChangePasswordError> = serde_json::from_str(&content).ok();
5583        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5584    }
5585}
5586
5587/// Creates a single User consent.
5588pub async fn create_user_consent(configuration: &configuration::Configuration, user_consent_request: Option<models::UserConsentRequest>) -> Result<models::UserConsentResponse, Error<CreateUserConsentError>> {
5589    // add a prefix to parameters to efficiently prevent name collisions
5590    let p_body_user_consent_request = user_consent_request;
5591
5592    let uri_str = format!("{}/api/user/consent", configuration.base_path);
5593    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5594
5595    if let Some(ref user_agent) = configuration.user_agent {
5596        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5597    }
5598    if let Some(ref apikey) = configuration.api_key {
5599        let key = apikey.key.clone();
5600        let value = match apikey.prefix {
5601            Some(ref prefix) => format!("{} {}", prefix, key),
5602            None => key,
5603        };
5604        req_builder = req_builder.header("Authorization", value);
5605    };
5606    req_builder = req_builder.json(&p_body_user_consent_request);
5607
5608    let req = req_builder.build()?;
5609    let resp = configuration.client.execute(req).await?;
5610
5611    let status = resp.status();
5612    let content_type = resp
5613        .headers()
5614        .get("content-type")
5615        .and_then(|v| v.to_str().ok())
5616        .unwrap_or("application/octet-stream");
5617    let content_type = super::ContentType::from(content_type);
5618
5619    if !status.is_client_error() && !status.is_server_error() {
5620        let content = resp.text().await?;
5621        match content_type {
5622            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5623            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
5624            ContentType::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`")))),
5625        }
5626    } else {
5627        let content = resp.text().await?;
5628        let entity: Option<CreateUserConsentError> = serde_json::from_str(&content).ok();
5629        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5630    }
5631}
5632
5633/// Creates a single User consent.
5634pub 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>> {
5635    // add a prefix to parameters to efficiently prevent name collisions
5636    let p_path_user_consent_id = user_consent_id;
5637    let p_body_user_consent_request = user_consent_request;
5638
5639    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
5640    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5641
5642    if let Some(ref user_agent) = configuration.user_agent {
5643        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5644    }
5645    if let Some(ref apikey) = configuration.api_key {
5646        let key = apikey.key.clone();
5647        let value = match apikey.prefix {
5648            Some(ref prefix) => format!("{} {}", prefix, key),
5649            None => key,
5650        };
5651        req_builder = req_builder.header("Authorization", value);
5652    };
5653    req_builder = req_builder.json(&p_body_user_consent_request);
5654
5655    let req = req_builder.build()?;
5656    let resp = configuration.client.execute(req).await?;
5657
5658    let status = resp.status();
5659    let content_type = resp
5660        .headers()
5661        .get("content-type")
5662        .and_then(|v| v.to_str().ok())
5663        .unwrap_or("application/octet-stream");
5664    let content_type = super::ContentType::from(content_type);
5665
5666    if !status.is_client_error() && !status.is_server_error() {
5667        let content = resp.text().await?;
5668        match content_type {
5669            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5670            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
5671            ContentType::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`")))),
5672        }
5673    } else {
5674        let content = resp.text().await?;
5675        let entity: Option<CreateUserConsentWithIdError> = serde_json::from_str(&content).ok();
5676        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5677    }
5678}
5679
5680/// Link an external user from a 3rd party identity provider to a FusionAuth user.
5681pub async fn create_user_link_with_id(configuration: &configuration::Configuration, identity_provider_link_request: Option<models::IdentityProviderLinkRequest>) -> Result<models::IdentityProviderLinkResponse, Error<CreateUserLinkWithIdError>> {
5682    // add a prefix to parameters to efficiently prevent name collisions
5683    let p_body_identity_provider_link_request = identity_provider_link_request;
5684
5685    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
5686    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5687
5688    if let Some(ref user_agent) = configuration.user_agent {
5689        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5690    }
5691    if let Some(ref apikey) = configuration.api_key {
5692        let key = apikey.key.clone();
5693        let value = match apikey.prefix {
5694            Some(ref prefix) => format!("{} {}", prefix, key),
5695            None => key,
5696        };
5697        req_builder = req_builder.header("Authorization", value);
5698    };
5699    req_builder = req_builder.json(&p_body_identity_provider_link_request);
5700
5701    let req = req_builder.build()?;
5702    let resp = configuration.client.execute(req).await?;
5703
5704    let status = resp.status();
5705    let content_type = resp
5706        .headers()
5707        .get("content-type")
5708        .and_then(|v| v.to_str().ok())
5709        .unwrap_or("application/octet-stream");
5710    let content_type = super::ContentType::from(content_type);
5711
5712    if !status.is_client_error() && !status.is_server_error() {
5713        let content = resp.text().await?;
5714        match content_type {
5715            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5716            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
5717            ContentType::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`")))),
5718        }
5719    } else {
5720        let content = resp.text().await?;
5721        let entity: Option<CreateUserLinkWithIdError> = serde_json::from_str(&content).ok();
5722        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5723    }
5724}
5725
5726/// 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.
5727pub async fn create_user_verify_email(configuration: &configuration::Configuration, verify_email_request: Option<models::VerifyEmailRequest>) -> Result<(), Error<CreateUserVerifyEmailError>> {
5728    // add a prefix to parameters to efficiently prevent name collisions
5729    let p_body_verify_email_request = verify_email_request;
5730
5731    let uri_str = format!("{}/api/user/verify-email", configuration.base_path);
5732    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5733
5734    if let Some(ref user_agent) = configuration.user_agent {
5735        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5736    }
5737    if let Some(ref apikey) = configuration.api_key {
5738        let key = apikey.key.clone();
5739        let value = match apikey.prefix {
5740            Some(ref prefix) => format!("{} {}", prefix, key),
5741            None => key,
5742        };
5743        req_builder = req_builder.header("Authorization", value);
5744    };
5745    req_builder = req_builder.json(&p_body_verify_email_request);
5746
5747    let req = req_builder.build()?;
5748    let resp = configuration.client.execute(req).await?;
5749
5750    let status = resp.status();
5751
5752    if !status.is_client_error() && !status.is_server_error() {
5753        Ok(())
5754    } else {
5755        let content = resp.text().await?;
5756        let entity: Option<CreateUserVerifyEmailError> = serde_json::from_str(&content).ok();
5757        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5758    }
5759}
5760
5761/// Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
5762pub 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>> {
5763    // add a prefix to parameters to efficiently prevent name collisions
5764    let p_path_user_id = user_id;
5765    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5766    let p_body_user_request = user_request;
5767
5768    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
5769    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5770
5771    if let Some(ref user_agent) = configuration.user_agent {
5772        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5773    }
5774    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5775        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5776    }
5777    if let Some(ref apikey) = configuration.api_key {
5778        let key = apikey.key.clone();
5779        let value = match apikey.prefix {
5780            Some(ref prefix) => format!("{} {}", prefix, key),
5781            None => key,
5782        };
5783        req_builder = req_builder.header("Authorization", value);
5784    };
5785    req_builder = req_builder.json(&p_body_user_request);
5786
5787    let req = req_builder.build()?;
5788    let resp = configuration.client.execute(req).await?;
5789
5790    let status = resp.status();
5791    let content_type = resp
5792        .headers()
5793        .get("content-type")
5794        .and_then(|v| v.to_str().ok())
5795        .unwrap_or("application/octet-stream");
5796    let content_type = super::ContentType::from(content_type);
5797
5798    if !status.is_client_error() && !status.is_server_error() {
5799        let content = resp.text().await?;
5800        match content_type {
5801            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5802            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
5803            ContentType::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`")))),
5804        }
5805    } else {
5806        let content = resp.text().await?;
5807        let entity: Option<CreateUserWithIdError> = serde_json::from_str(&content).ok();
5808        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5809    }
5810}
5811
5812/// Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
5813pub async fn create_webhook(configuration: &configuration::Configuration, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<CreateWebhookError>> {
5814    // add a prefix to parameters to efficiently prevent name collisions
5815    let p_body_webhook_request = webhook_request;
5816
5817    let uri_str = format!("{}/api/webhook", configuration.base_path);
5818    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5819
5820    if let Some(ref user_agent) = configuration.user_agent {
5821        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5822    }
5823    if let Some(ref apikey) = configuration.api_key {
5824        let key = apikey.key.clone();
5825        let value = match apikey.prefix {
5826            Some(ref prefix) => format!("{} {}", prefix, key),
5827            None => key,
5828        };
5829        req_builder = req_builder.header("Authorization", value);
5830    };
5831    req_builder = req_builder.json(&p_body_webhook_request);
5832
5833    let req = req_builder.build()?;
5834    let resp = configuration.client.execute(req).await?;
5835
5836    let status = resp.status();
5837    let content_type = resp
5838        .headers()
5839        .get("content-type")
5840        .and_then(|v| v.to_str().ok())
5841        .unwrap_or("application/octet-stream");
5842    let content_type = super::ContentType::from(content_type);
5843
5844    if !status.is_client_error() && !status.is_server_error() {
5845        let content = resp.text().await?;
5846        match content_type {
5847            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5848            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
5849            ContentType::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`")))),
5850        }
5851    } else {
5852        let content = resp.text().await?;
5853        let entity: Option<CreateWebhookError> = serde_json::from_str(&content).ok();
5854        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5855    }
5856}
5857
5858/// Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
5859pub async fn create_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<CreateWebhookWithIdError>> {
5860    // add a prefix to parameters to efficiently prevent name collisions
5861    let p_path_webhook_id = webhook_id;
5862    let p_body_webhook_request = webhook_request;
5863
5864    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
5865    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5866
5867    if let Some(ref user_agent) = configuration.user_agent {
5868        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5869    }
5870    if let Some(ref apikey) = configuration.api_key {
5871        let key = apikey.key.clone();
5872        let value = match apikey.prefix {
5873            Some(ref prefix) => format!("{} {}", prefix, key),
5874            None => key,
5875        };
5876        req_builder = req_builder.header("Authorization", value);
5877    };
5878    req_builder = req_builder.json(&p_body_webhook_request);
5879
5880    let req = req_builder.build()?;
5881    let resp = configuration.client.execute(req).await?;
5882
5883    let status = resp.status();
5884    let content_type = resp
5885        .headers()
5886        .get("content-type")
5887        .and_then(|v| v.to_str().ok())
5888        .unwrap_or("application/octet-stream");
5889    let content_type = super::ContentType::from(content_type);
5890
5891    if !status.is_client_error() && !status.is_server_error() {
5892        let content = resp.text().await?;
5893        match content_type {
5894            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5895            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
5896            ContentType::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`")))),
5897        }
5898    } else {
5899        let content = resp.text().await?;
5900        let entity: Option<CreateWebhookWithIdError> = serde_json::from_str(&content).ok();
5901        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5902    }
5903}
5904
5905/// Deletes the API key for the given Id.
5906pub async fn delete_api_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error<DeleteApiKeyWithIdError>> {
5907    // add a prefix to parameters to efficiently prevent name collisions
5908    let p_path_key_id = key_id;
5909
5910    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
5911    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5912
5913    if let Some(ref user_agent) = configuration.user_agent {
5914        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5915    }
5916    if let Some(ref apikey) = configuration.api_key {
5917        let key = apikey.key.clone();
5918        let value = match apikey.prefix {
5919            Some(ref prefix) => format!("{} {}", prefix, key),
5920            None => key,
5921        };
5922        req_builder = req_builder.header("Authorization", value);
5923    };
5924
5925    let req = req_builder.build()?;
5926    let resp = configuration.client.execute(req).await?;
5927
5928    let status = resp.status();
5929
5930    if !status.is_client_error() && !status.is_server_error() {
5931        Ok(())
5932    } else {
5933        let content = resp.text().await?;
5934        let entity: Option<DeleteApiKeyWithIdError> = serde_json::from_str(&content).ok();
5935        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5936    }
5937}
5938
5939/// 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.
5940pub 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>> {
5941    // add a prefix to parameters to efficiently prevent name collisions
5942    let p_path_application_id = application_id;
5943    let p_path_role_id = role_id;
5944    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5945
5946    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));
5947    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5948
5949    if let Some(ref user_agent) = configuration.user_agent {
5950        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5951    }
5952    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5953        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5954    }
5955    if let Some(ref apikey) = configuration.api_key {
5956        let key = apikey.key.clone();
5957        let value = match apikey.prefix {
5958            Some(ref prefix) => format!("{} {}", prefix, key),
5959            None => key,
5960        };
5961        req_builder = req_builder.header("Authorization", value);
5962    };
5963
5964    let req = req_builder.build()?;
5965    let resp = configuration.client.execute(req).await?;
5966
5967    let status = resp.status();
5968
5969    if !status.is_client_error() && !status.is_server_error() {
5970        Ok(())
5971    } else {
5972        let content = resp.text().await?;
5973        let entity: Option<DeleteApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
5974        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5975    }
5976}
5977
5978/// 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.
5979pub 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>> {
5980    // add a prefix to parameters to efficiently prevent name collisions
5981    let p_path_application_id = application_id;
5982    let p_query_hard_delete = hard_delete;
5983    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
5984
5985    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
5986    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5987
5988    if let Some(ref param_value) = p_query_hard_delete {
5989        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
5990    }
5991    if let Some(ref user_agent) = configuration.user_agent {
5992        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5993    }
5994    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
5995        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
5996    }
5997    if let Some(ref apikey) = configuration.api_key {
5998        let key = apikey.key.clone();
5999        let value = match apikey.prefix {
6000            Some(ref prefix) => format!("{} {}", prefix, key),
6001            None => key,
6002        };
6003        req_builder = req_builder.header("Authorization", value);
6004    };
6005
6006    let req = req_builder.build()?;
6007    let resp = configuration.client.execute(req).await?;
6008
6009    let status = resp.status();
6010
6011    if !status.is_client_error() && !status.is_server_error() {
6012        Ok(())
6013    } else {
6014        let content = resp.text().await?;
6015        let entity: Option<DeleteApplicationWithIdError> = serde_json::from_str(&content).ok();
6016        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6017    }
6018}
6019
6020/// Deletes the connector for the given Id.
6021pub async fn delete_connector_with_id(configuration: &configuration::Configuration, connector_id: &str) -> Result<(), Error<DeleteConnectorWithIdError>> {
6022    // add a prefix to parameters to efficiently prevent name collisions
6023    let p_path_connector_id = connector_id;
6024
6025    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
6026    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6027
6028    if let Some(ref user_agent) = configuration.user_agent {
6029        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6030    }
6031    if let Some(ref apikey) = configuration.api_key {
6032        let key = apikey.key.clone();
6033        let value = match apikey.prefix {
6034            Some(ref prefix) => format!("{} {}", prefix, key),
6035            None => key,
6036        };
6037        req_builder = req_builder.header("Authorization", value);
6038    };
6039
6040    let req = req_builder.build()?;
6041    let resp = configuration.client.execute(req).await?;
6042
6043    let status = resp.status();
6044
6045    if !status.is_client_error() && !status.is_server_error() {
6046        Ok(())
6047    } else {
6048        let content = resp.text().await?;
6049        let entity: Option<DeleteConnectorWithIdError> = serde_json::from_str(&content).ok();
6050        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6051    }
6052}
6053
6054/// Deletes the consent for the given Id.
6055pub async fn delete_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteConsentWithIdError>> {
6056    // add a prefix to parameters to efficiently prevent name collisions
6057    let p_path_consent_id = consent_id;
6058    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6059
6060    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
6061    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6062
6063    if let Some(ref user_agent) = configuration.user_agent {
6064        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6065    }
6066    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6067        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6068    }
6069    if let Some(ref apikey) = configuration.api_key {
6070        let key = apikey.key.clone();
6071        let value = match apikey.prefix {
6072            Some(ref prefix) => format!("{} {}", prefix, key),
6073            None => key,
6074        };
6075        req_builder = req_builder.header("Authorization", value);
6076    };
6077
6078    let req = req_builder.build()?;
6079    let resp = configuration.client.execute(req).await?;
6080
6081    let status = resp.status();
6082
6083    if !status.is_client_error() && !status.is_server_error() {
6084        Ok(())
6085    } else {
6086        let content = resp.text().await?;
6087        let entity: Option<DeleteConsentWithIdError> = serde_json::from_str(&content).ok();
6088        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6089    }
6090}
6091
6092/// Deletes the email template for the given Id.
6093pub async fn delete_email_template_with_id(configuration: &configuration::Configuration, email_template_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEmailTemplateWithIdError>> {
6094    // add a prefix to parameters to efficiently prevent name collisions
6095    let p_path_email_template_id = email_template_id;
6096    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6097
6098    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
6099    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6100
6101    if let Some(ref user_agent) = configuration.user_agent {
6102        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6103    }
6104    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6105        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6106    }
6107    if let Some(ref apikey) = configuration.api_key {
6108        let key = apikey.key.clone();
6109        let value = match apikey.prefix {
6110            Some(ref prefix) => format!("{} {}", prefix, key),
6111            None => key,
6112        };
6113        req_builder = req_builder.header("Authorization", value);
6114    };
6115
6116    let req = req_builder.build()?;
6117    let resp = configuration.client.execute(req).await?;
6118
6119    let status = resp.status();
6120
6121    if !status.is_client_error() && !status.is_server_error() {
6122        Ok(())
6123    } else {
6124        let content = resp.text().await?;
6125        let entity: Option<DeleteEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
6126        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6127    }
6128}
6129
6130/// Deletes an Entity Grant for the given User or Entity.
6131pub 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>> {
6132    // add a prefix to parameters to efficiently prevent name collisions
6133    let p_path_entity_id = entity_id;
6134    let p_query_recipient_entity_id = recipient_entity_id;
6135    let p_query_user_id = user_id;
6136    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6137
6138    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
6139    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6140
6141    if let Some(ref param_value) = p_query_recipient_entity_id {
6142        req_builder = req_builder.query(&[("recipientEntityId", &param_value.to_string())]);
6143    }
6144    if let Some(ref param_value) = p_query_user_id {
6145        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6146    }
6147    if let Some(ref user_agent) = configuration.user_agent {
6148        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6149    }
6150    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6151        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6152    }
6153    if let Some(ref apikey) = configuration.api_key {
6154        let key = apikey.key.clone();
6155        let value = match apikey.prefix {
6156            Some(ref prefix) => format!("{} {}", prefix, key),
6157            None => key,
6158        };
6159        req_builder = req_builder.header("Authorization", value);
6160    };
6161
6162    let req = req_builder.build()?;
6163    let resp = configuration.client.execute(req).await?;
6164
6165    let status = resp.status();
6166
6167    if !status.is_client_error() && !status.is_server_error() {
6168        Ok(())
6169    } else {
6170        let content = resp.text().await?;
6171        let entity: Option<DeleteEntityGrantWithIdError> = serde_json::from_str(&content).ok();
6172        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6173    }
6174}
6175
6176/// 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.
6177pub async fn delete_entity_type_permission_with_id(configuration: &configuration::Configuration, entity_type_id: &str, permission_id: &str) -> Result<(), Error<DeleteEntityTypePermissionWithIdError>> {
6178    // add a prefix to parameters to efficiently prevent name collisions
6179    let p_path_entity_type_id = entity_type_id;
6180    let p_path_permission_id = permission_id;
6181
6182    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));
6183    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6184
6185    if let Some(ref user_agent) = configuration.user_agent {
6186        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6187    }
6188    if let Some(ref apikey) = configuration.api_key {
6189        let key = apikey.key.clone();
6190        let value = match apikey.prefix {
6191            Some(ref prefix) => format!("{} {}", prefix, key),
6192            None => key,
6193        };
6194        req_builder = req_builder.header("Authorization", value);
6195    };
6196
6197    let req = req_builder.build()?;
6198    let resp = configuration.client.execute(req).await?;
6199
6200    let status = resp.status();
6201
6202    if !status.is_client_error() && !status.is_server_error() {
6203        Ok(())
6204    } else {
6205        let content = resp.text().await?;
6206        let entity: Option<DeleteEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
6207        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6208    }
6209}
6210
6211/// Deletes the Entity Type for the given Id.
6212pub async fn delete_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str) -> Result<(), Error<DeleteEntityTypeWithIdError>> {
6213    // add a prefix to parameters to efficiently prevent name collisions
6214    let p_path_entity_type_id = entity_type_id;
6215
6216    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
6217    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6218
6219    if let Some(ref user_agent) = configuration.user_agent {
6220        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6221    }
6222    if let Some(ref apikey) = configuration.api_key {
6223        let key = apikey.key.clone();
6224        let value = match apikey.prefix {
6225            Some(ref prefix) => format!("{} {}", prefix, key),
6226            None => key,
6227        };
6228        req_builder = req_builder.header("Authorization", value);
6229    };
6230
6231    let req = req_builder.build()?;
6232    let resp = configuration.client.execute(req).await?;
6233
6234    let status = resp.status();
6235
6236    if !status.is_client_error() && !status.is_server_error() {
6237        Ok(())
6238    } else {
6239        let content = resp.text().await?;
6240        let entity: Option<DeleteEntityTypeWithIdError> = serde_json::from_str(&content).ok();
6241        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6242    }
6243}
6244
6245/// Deletes the Entity for the given Id.
6246pub async fn delete_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteEntityWithIdError>> {
6247    // add a prefix to parameters to efficiently prevent name collisions
6248    let p_path_entity_id = entity_id;
6249    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6250
6251    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
6252    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6253
6254    if let Some(ref user_agent) = configuration.user_agent {
6255        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6256    }
6257    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6258        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6259    }
6260    if let Some(ref apikey) = configuration.api_key {
6261        let key = apikey.key.clone();
6262        let value = match apikey.prefix {
6263            Some(ref prefix) => format!("{} {}", prefix, key),
6264            None => key,
6265        };
6266        req_builder = req_builder.header("Authorization", value);
6267    };
6268
6269    let req = req_builder.build()?;
6270    let resp = configuration.client.execute(req).await?;
6271
6272    let status = resp.status();
6273
6274    if !status.is_client_error() && !status.is_server_error() {
6275        Ok(())
6276    } else {
6277        let content = resp.text().await?;
6278        let entity: Option<DeleteEntityWithIdError> = serde_json::from_str(&content).ok();
6279        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6280    }
6281}
6282
6283/// Deletes the form field for the given Id.
6284pub async fn delete_form_field_with_id(configuration: &configuration::Configuration, field_id: &str) -> Result<(), Error<DeleteFormFieldWithIdError>> {
6285    // add a prefix to parameters to efficiently prevent name collisions
6286    let p_path_field_id = field_id;
6287
6288    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
6289    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6290
6291    if let Some(ref user_agent) = configuration.user_agent {
6292        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6293    }
6294    if let Some(ref apikey) = configuration.api_key {
6295        let key = apikey.key.clone();
6296        let value = match apikey.prefix {
6297            Some(ref prefix) => format!("{} {}", prefix, key),
6298            None => key,
6299        };
6300        req_builder = req_builder.header("Authorization", value);
6301    };
6302
6303    let req = req_builder.build()?;
6304    let resp = configuration.client.execute(req).await?;
6305
6306    let status = resp.status();
6307
6308    if !status.is_client_error() && !status.is_server_error() {
6309        Ok(())
6310    } else {
6311        let content = resp.text().await?;
6312        let entity: Option<DeleteFormFieldWithIdError> = serde_json::from_str(&content).ok();
6313        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6314    }
6315}
6316
6317/// Deletes the form for the given Id.
6318pub async fn delete_form_with_id(configuration: &configuration::Configuration, form_id: &str) -> Result<(), Error<DeleteFormWithIdError>> {
6319    // add a prefix to parameters to efficiently prevent name collisions
6320    let p_path_form_id = form_id;
6321
6322    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
6323    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6324
6325    if let Some(ref user_agent) = configuration.user_agent {
6326        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6327    }
6328    if let Some(ref apikey) = configuration.api_key {
6329        let key = apikey.key.clone();
6330        let value = match apikey.prefix {
6331            Some(ref prefix) => format!("{} {}", prefix, key),
6332            None => key,
6333        };
6334        req_builder = req_builder.header("Authorization", value);
6335    };
6336
6337    let req = req_builder.build()?;
6338    let resp = configuration.client.execute(req).await?;
6339
6340    let status = resp.status();
6341
6342    if !status.is_client_error() && !status.is_server_error() {
6343        Ok(())
6344    } else {
6345        let content = resp.text().await?;
6346        let entity: Option<DeleteFormWithIdError> = serde_json::from_str(&content).ok();
6347        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6348    }
6349}
6350
6351/// Removes users as members of a group.
6352pub async fn delete_group_members_with_id(configuration: &configuration::Configuration, member_delete_request: Option<models::MemberDeleteRequest>) -> Result<(), Error<DeleteGroupMembersWithIdError>> {
6353    // add a prefix to parameters to efficiently prevent name collisions
6354    let p_body_member_delete_request = member_delete_request;
6355
6356    let uri_str = format!("{}/api/group/member", configuration.base_path);
6357    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6358
6359    if let Some(ref user_agent) = configuration.user_agent {
6360        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6361    }
6362    if let Some(ref apikey) = configuration.api_key {
6363        let key = apikey.key.clone();
6364        let value = match apikey.prefix {
6365            Some(ref prefix) => format!("{} {}", prefix, key),
6366            None => key,
6367        };
6368        req_builder = req_builder.header("Authorization", value);
6369    };
6370    req_builder = req_builder.json(&p_body_member_delete_request);
6371
6372    let req = req_builder.build()?;
6373    let resp = configuration.client.execute(req).await?;
6374
6375    let status = resp.status();
6376
6377    if !status.is_client_error() && !status.is_server_error() {
6378        Ok(())
6379    } else {
6380        let content = resp.text().await?;
6381        let entity: Option<DeleteGroupMembersWithIdError> = serde_json::from_str(&content).ok();
6382        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6383    }
6384}
6385
6386/// Deletes the group for the given Id.
6387pub async fn delete_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<(), Error<DeleteGroupWithIdError>> {
6388    // add a prefix to parameters to efficiently prevent name collisions
6389    let p_path_group_id = group_id;
6390    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6391
6392    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
6393    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6394
6395    if let Some(ref user_agent) = configuration.user_agent {
6396        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6397    }
6398    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6399        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6400    }
6401    if let Some(ref apikey) = configuration.api_key {
6402        let key = apikey.key.clone();
6403        let value = match apikey.prefix {
6404            Some(ref prefix) => format!("{} {}", prefix, key),
6405            None => key,
6406        };
6407        req_builder = req_builder.header("Authorization", value);
6408    };
6409
6410    let req = req_builder.build()?;
6411    let resp = configuration.client.execute(req).await?;
6412
6413    let status = resp.status();
6414
6415    if !status.is_client_error() && !status.is_server_error() {
6416        Ok(())
6417    } else {
6418        let content = resp.text().await?;
6419        let entity: Option<DeleteGroupWithIdError> = serde_json::from_str(&content).ok();
6420        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6421    }
6422}
6423
6424/// Deletes the identity provider for the given Id.
6425pub async fn delete_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str) -> Result<(), Error<DeleteIdentityProviderWithIdError>> {
6426    // add a prefix to parameters to efficiently prevent name collisions
6427    let p_path_identity_provider_id = identity_provider_id;
6428
6429    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
6430    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6431
6432    if let Some(ref user_agent) = configuration.user_agent {
6433        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6434    }
6435    if let Some(ref apikey) = configuration.api_key {
6436        let key = apikey.key.clone();
6437        let value = match apikey.prefix {
6438            Some(ref prefix) => format!("{} {}", prefix, key),
6439            None => key,
6440        };
6441        req_builder = req_builder.header("Authorization", value);
6442    };
6443
6444    let req = req_builder.build()?;
6445    let resp = configuration.client.execute(req).await?;
6446
6447    let status = resp.status();
6448
6449    if !status.is_client_error() && !status.is_server_error() {
6450        Ok(())
6451    } else {
6452        let content = resp.text().await?;
6453        let entity: Option<DeleteIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
6454        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6455    }
6456}
6457
6458/// Deletes the IP Access Control List for the given Id.
6459pub async fn delete_ip_access_control_list_with_id(configuration: &configuration::Configuration, ip_access_control_list_id: &str) -> Result<(), Error<DeleteIpAccessControlListWithIdError>> {
6460    // add a prefix to parameters to efficiently prevent name collisions
6461    let p_path_ip_access_control_list_id = ip_access_control_list_id;
6462
6463    let uri_str = format!("{}/api/ip-acl/{ipAccessControlListId}", configuration.base_path, ipAccessControlListId=crate::apis::urlencode(p_path_ip_access_control_list_id));
6464    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6465
6466    if let Some(ref user_agent) = configuration.user_agent {
6467        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6468    }
6469    if let Some(ref apikey) = configuration.api_key {
6470        let key = apikey.key.clone();
6471        let value = match apikey.prefix {
6472            Some(ref prefix) => format!("{} {}", prefix, key),
6473            None => key,
6474        };
6475        req_builder = req_builder.header("Authorization", value);
6476    };
6477
6478    let req = req_builder.build()?;
6479    let resp = configuration.client.execute(req).await?;
6480
6481    let status = resp.status();
6482
6483    if !status.is_client_error() && !status.is_server_error() {
6484        Ok(())
6485    } else {
6486        let content = resp.text().await?;
6487        let entity: Option<DeleteIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
6488        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6489    }
6490}
6491
6492/// 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
6493pub 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>> {
6494    // add a prefix to parameters to efficiently prevent name collisions
6495    let p_query_user_id = user_id;
6496    let p_query_application_id = application_id;
6497    let p_query_token = token;
6498    let p_body_refresh_token_revoke_request = refresh_token_revoke_request;
6499
6500    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
6501    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6502
6503    if let Some(ref param_value) = p_query_user_id {
6504        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6505    }
6506    if let Some(ref param_value) = p_query_application_id {
6507        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
6508    }
6509    if let Some(ref param_value) = p_query_token {
6510        req_builder = req_builder.query(&[("token", &param_value.to_string())]);
6511    }
6512    if let Some(ref user_agent) = configuration.user_agent {
6513        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6514    }
6515    if let Some(ref apikey) = configuration.api_key {
6516        let key = apikey.key.clone();
6517        let value = match apikey.prefix {
6518            Some(ref prefix) => format!("{} {}", prefix, key),
6519            None => key,
6520        };
6521        req_builder = req_builder.header("Authorization", value);
6522    };
6523    req_builder = req_builder.json(&p_body_refresh_token_revoke_request);
6524
6525    let req = req_builder.build()?;
6526    let resp = configuration.client.execute(req).await?;
6527
6528    let status = resp.status();
6529
6530    if !status.is_client_error() && !status.is_server_error() {
6531        Ok(())
6532    } else {
6533        let content = resp.text().await?;
6534        let entity: Option<DeleteJwtRefreshError> = serde_json::from_str(&content).ok();
6535        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6536    }
6537}
6538
6539/// Deletes the key for the given Id.
6540pub async fn delete_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<(), Error<DeleteKeyWithIdError>> {
6541    // add a prefix to parameters to efficiently prevent name collisions
6542    let p_path_key_id = key_id;
6543
6544    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
6545    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6546
6547    if let Some(ref user_agent) = configuration.user_agent {
6548        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6549    }
6550    if let Some(ref apikey) = configuration.api_key {
6551        let key = apikey.key.clone();
6552        let value = match apikey.prefix {
6553            Some(ref prefix) => format!("{} {}", prefix, key),
6554            None => key,
6555        };
6556        req_builder = req_builder.header("Authorization", value);
6557    };
6558
6559    let req = req_builder.build()?;
6560    let resp = configuration.client.execute(req).await?;
6561
6562    let status = resp.status();
6563
6564    if !status.is_client_error() && !status.is_server_error() {
6565        Ok(())
6566    } else {
6567        let content = resp.text().await?;
6568        let entity: Option<DeleteKeyWithIdError> = serde_json::from_str(&content).ok();
6569        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6570    }
6571}
6572
6573/// Deletes the lambda for the given Id.
6574pub async fn delete_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str) -> Result<(), Error<DeleteLambdaWithIdError>> {
6575    // add a prefix to parameters to efficiently prevent name collisions
6576    let p_path_lambda_id = lambda_id;
6577
6578    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
6579    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6580
6581    if let Some(ref user_agent) = configuration.user_agent {
6582        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6583    }
6584    if let Some(ref apikey) = configuration.api_key {
6585        let key = apikey.key.clone();
6586        let value = match apikey.prefix {
6587            Some(ref prefix) => format!("{} {}", prefix, key),
6588            None => key,
6589        };
6590        req_builder = req_builder.header("Authorization", value);
6591    };
6592
6593    let req = req_builder.build()?;
6594    let resp = configuration.client.execute(req).await?;
6595
6596    let status = resp.status();
6597
6598    if !status.is_client_error() && !status.is_server_error() {
6599        Ok(())
6600    } else {
6601        let content = resp.text().await?;
6602        let entity: Option<DeleteLambdaWithIdError> = serde_json::from_str(&content).ok();
6603        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6604    }
6605}
6606
6607/// Deletes the message template for the given Id.
6608pub async fn delete_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str) -> Result<(), Error<DeleteMessageTemplateWithIdError>> {
6609    // add a prefix to parameters to efficiently prevent name collisions
6610    let p_path_message_template_id = message_template_id;
6611
6612    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
6613    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6614
6615    if let Some(ref user_agent) = configuration.user_agent {
6616        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6617    }
6618    if let Some(ref apikey) = configuration.api_key {
6619        let key = apikey.key.clone();
6620        let value = match apikey.prefix {
6621            Some(ref prefix) => format!("{} {}", prefix, key),
6622            None => key,
6623        };
6624        req_builder = req_builder.header("Authorization", value);
6625    };
6626
6627    let req = req_builder.build()?;
6628    let resp = configuration.client.execute(req).await?;
6629
6630    let status = resp.status();
6631
6632    if !status.is_client_error() && !status.is_server_error() {
6633        Ok(())
6634    } else {
6635        let content = resp.text().await?;
6636        let entity: Option<DeleteMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
6637        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6638    }
6639}
6640
6641/// Deletes the messenger for the given Id.
6642pub async fn delete_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str) -> Result<(), Error<DeleteMessengerWithIdError>> {
6643    // add a prefix to parameters to efficiently prevent name collisions
6644    let p_path_messenger_id = messenger_id;
6645
6646    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
6647    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6648
6649    if let Some(ref user_agent) = configuration.user_agent {
6650        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6651    }
6652    if let Some(ref apikey) = configuration.api_key {
6653        let key = apikey.key.clone();
6654        let value = match apikey.prefix {
6655            Some(ref prefix) => format!("{} {}", prefix, key),
6656            None => key,
6657        };
6658        req_builder = req_builder.header("Authorization", value);
6659    };
6660
6661    let req = req_builder.build()?;
6662    let resp = configuration.client.execute(req).await?;
6663
6664    let status = resp.status();
6665
6666    if !status.is_client_error() && !status.is_server_error() {
6667        Ok(())
6668    } else {
6669        let content = resp.text().await?;
6670        let entity: Option<DeleteMessengerWithIdError> = serde_json::from_str(&content).ok();
6671        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6672    }
6673}
6674
6675/// 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.
6676pub 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>> {
6677    // add a prefix to parameters to efficiently prevent name collisions
6678    let p_path_application_id = application_id;
6679    let p_path_scope_id = scope_id;
6680    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6681
6682    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));
6683    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6684
6685    if let Some(ref user_agent) = configuration.user_agent {
6686        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6687    }
6688    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6689        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6690    }
6691    if let Some(ref apikey) = configuration.api_key {
6692        let key = apikey.key.clone();
6693        let value = match apikey.prefix {
6694            Some(ref prefix) => format!("{} {}", prefix, key),
6695            None => key,
6696        };
6697        req_builder = req_builder.header("Authorization", value);
6698    };
6699
6700    let req = req_builder.build()?;
6701    let resp = configuration.client.execute(req).await?;
6702
6703    let status = resp.status();
6704
6705    if !status.is_client_error() && !status.is_server_error() {
6706        Ok(())
6707    } else {
6708        let content = resp.text().await?;
6709        let entity: Option<DeleteOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
6710        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6711    }
6712}
6713
6714/// 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).
6715pub 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>> {
6716    // add a prefix to parameters to efficiently prevent name collisions
6717    let p_path_tenant_id = tenant_id;
6718    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6719    let p_query_async = r#async;
6720    let p_body_tenant_delete_request = tenant_delete_request;
6721
6722    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
6723    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6724
6725    if let Some(ref param_value) = p_query_async {
6726        req_builder = req_builder.query(&[("async", &param_value.to_string())]);
6727    }
6728    if let Some(ref user_agent) = configuration.user_agent {
6729        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6730    }
6731    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6732        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6733    }
6734    if let Some(ref apikey) = configuration.api_key {
6735        let key = apikey.key.clone();
6736        let value = match apikey.prefix {
6737            Some(ref prefix) => format!("{} {}", prefix, key),
6738            None => key,
6739        };
6740        req_builder = req_builder.header("Authorization", value);
6741    };
6742    req_builder = req_builder.json(&p_body_tenant_delete_request);
6743
6744    let req = req_builder.build()?;
6745    let resp = configuration.client.execute(req).await?;
6746
6747    let status = resp.status();
6748
6749    if !status.is_client_error() && !status.is_server_error() {
6750        Ok(())
6751    } else {
6752        let content = resp.text().await?;
6753        let entity: Option<DeleteTenantWithIdError> = serde_json::from_str(&content).ok();
6754        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6755    }
6756}
6757
6758/// Deletes the theme for the given Id.
6759pub async fn delete_theme_with_id(configuration: &configuration::Configuration, theme_id: &str) -> Result<(), Error<DeleteThemeWithIdError>> {
6760    // add a prefix to parameters to efficiently prevent name collisions
6761    let p_path_theme_id = theme_id;
6762
6763    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
6764    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6765
6766    if let Some(ref user_agent) = configuration.user_agent {
6767        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6768    }
6769    if let Some(ref apikey) = configuration.api_key {
6770        let key = apikey.key.clone();
6771        let value = match apikey.prefix {
6772            Some(ref prefix) => format!("{} {}", prefix, key),
6773            None => key,
6774        };
6775        req_builder = req_builder.header("Authorization", value);
6776    };
6777
6778    let req = req_builder.build()?;
6779    let resp = configuration.client.execute(req).await?;
6780
6781    let status = resp.status();
6782
6783    if !status.is_client_error() && !status.is_server_error() {
6784        Ok(())
6785    } else {
6786        let content = resp.text().await?;
6787        let entity: Option<DeleteThemeWithIdError> = serde_json::from_str(&content).ok();
6788        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6789    }
6790}
6791
6792/// Deletes the user action reason for the given Id.
6793pub async fn delete_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str) -> Result<(), Error<DeleteUserActionReasonWithIdError>> {
6794    // add a prefix to parameters to efficiently prevent name collisions
6795    let p_path_user_action_reason_id = user_action_reason_id;
6796
6797    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
6798    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6799
6800    if let Some(ref user_agent) = configuration.user_agent {
6801        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6802    }
6803    if let Some(ref apikey) = configuration.api_key {
6804        let key = apikey.key.clone();
6805        let value = match apikey.prefix {
6806            Some(ref prefix) => format!("{} {}", prefix, key),
6807            None => key,
6808        };
6809        req_builder = req_builder.header("Authorization", value);
6810    };
6811
6812    let req = req_builder.build()?;
6813    let resp = configuration.client.execute(req).await?;
6814
6815    let status = resp.status();
6816
6817    if !status.is_client_error() && !status.is_server_error() {
6818        Ok(())
6819    } else {
6820        let content = resp.text().await?;
6821        let entity: Option<DeleteUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
6822        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6823    }
6824}
6825
6826/// 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.
6827pub 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>> {
6828    // add a prefix to parameters to efficiently prevent name collisions
6829    let p_path_user_action_id = user_action_id;
6830    let p_query_hard_delete = hard_delete;
6831    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6832
6833    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
6834    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6835
6836    if let Some(ref param_value) = p_query_hard_delete {
6837        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6838    }
6839    if let Some(ref user_agent) = configuration.user_agent {
6840        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6841    }
6842    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6843        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6844    }
6845    if let Some(ref apikey) = configuration.api_key {
6846        let key = apikey.key.clone();
6847        let value = match apikey.prefix {
6848            Some(ref prefix) => format!("{} {}", prefix, key),
6849            None => key,
6850        };
6851        req_builder = req_builder.header("Authorization", value);
6852    };
6853
6854    let req = req_builder.build()?;
6855    let resp = configuration.client.execute(req).await?;
6856
6857    let status = resp.status();
6858
6859    if !status.is_client_error() && !status.is_server_error() {
6860        Ok(())
6861    } else {
6862        let content = resp.text().await?;
6863        let entity: Option<DeleteUserActionWithIdError> = serde_json::from_str(&content).ok();
6864        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6865    }
6866}
6867
6868/// 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.
6869pub 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>> {
6870    // add a prefix to parameters to efficiently prevent name collisions
6871    let p_query_user_ids = user_ids;
6872    let p_query_dry_run = dry_run;
6873    let p_query_hard_delete = hard_delete;
6874    let p_body_user_delete_request = user_delete_request;
6875
6876    let uri_str = format!("{}/api/user/bulk", configuration.base_path);
6877    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6878
6879    if let Some(ref param_value) = p_query_user_ids {
6880        req_builder = req_builder.query(&[("userIds", &param_value.to_string())]);
6881    }
6882    if let Some(ref param_value) = p_query_dry_run {
6883        req_builder = req_builder.query(&[("dryRun", &param_value.to_string())]);
6884    }
6885    if let Some(ref param_value) = p_query_hard_delete {
6886        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
6887    }
6888    if let Some(ref user_agent) = configuration.user_agent {
6889        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6890    }
6891    if let Some(ref apikey) = configuration.api_key {
6892        let key = apikey.key.clone();
6893        let value = match apikey.prefix {
6894            Some(ref prefix) => format!("{} {}", prefix, key),
6895            None => key,
6896        };
6897        req_builder = req_builder.header("Authorization", value);
6898    };
6899    req_builder = req_builder.json(&p_body_user_delete_request);
6900
6901    let req = req_builder.build()?;
6902    let resp = configuration.client.execute(req).await?;
6903
6904    let status = resp.status();
6905    let content_type = resp
6906        .headers()
6907        .get("content-type")
6908        .and_then(|v| v.to_str().ok())
6909        .unwrap_or("application/octet-stream");
6910    let content_type = super::ContentType::from(content_type);
6911
6912    if !status.is_client_error() && !status.is_server_error() {
6913        let content = resp.text().await?;
6914        match content_type {
6915            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6916            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserDeleteResponse`"))),
6917            ContentType::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`")))),
6918        }
6919    } else {
6920        let content = resp.text().await?;
6921        let entity: Option<DeleteUserBulkError> = serde_json::from_str(&content).ok();
6922        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6923    }
6924}
6925
6926/// Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
6927pub 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>> {
6928    // add a prefix to parameters to efficiently prevent name collisions
6929    let p_query_identity_provider_id = identity_provider_id;
6930    let p_query_identity_provider_user_id = identity_provider_user_id;
6931    let p_query_user_id = user_id;
6932
6933    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
6934    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6935
6936    if let Some(ref param_value) = p_query_identity_provider_id {
6937        req_builder = req_builder.query(&[("identityProviderId", &param_value.to_string())]);
6938    }
6939    if let Some(ref param_value) = p_query_identity_provider_user_id {
6940        req_builder = req_builder.query(&[("identityProviderUserId", &param_value.to_string())]);
6941    }
6942    if let Some(ref param_value) = p_query_user_id {
6943        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6944    }
6945    if let Some(ref user_agent) = configuration.user_agent {
6946        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6947    }
6948    if let Some(ref apikey) = configuration.api_key {
6949        let key = apikey.key.clone();
6950        let value = match apikey.prefix {
6951            Some(ref prefix) => format!("{} {}", prefix, key),
6952            None => key,
6953        };
6954        req_builder = req_builder.header("Authorization", value);
6955    };
6956
6957    let req = req_builder.build()?;
6958    let resp = configuration.client.execute(req).await?;
6959
6960    let status = resp.status();
6961    let content_type = resp
6962        .headers()
6963        .get("content-type")
6964        .and_then(|v| v.to_str().ok())
6965        .unwrap_or("application/octet-stream");
6966    let content_type = super::ContentType::from(content_type);
6967
6968    if !status.is_client_error() && !status.is_server_error() {
6969        let content = resp.text().await?;
6970        match content_type {
6971            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6972            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
6973            ContentType::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`")))),
6974        }
6975    } else {
6976        let content = resp.text().await?;
6977        let entity: Option<DeleteUserLinkWithIdError> = serde_json::from_str(&content).ok();
6978        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6979    }
6980}
6981
6982/// 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.
6983pub 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>> {
6984    // add a prefix to parameters to efficiently prevent name collisions
6985    let p_path_user_id = user_id;
6986    let p_path_application_id = application_id;
6987    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
6988    let p_body_registration_delete_request = registration_delete_request;
6989
6990    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));
6991    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6992
6993    if let Some(ref user_agent) = configuration.user_agent {
6994        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6995    }
6996    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
6997        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
6998    }
6999    if let Some(ref apikey) = configuration.api_key {
7000        let key = apikey.key.clone();
7001        let value = match apikey.prefix {
7002            Some(ref prefix) => format!("{} {}", prefix, key),
7003            None => key,
7004        };
7005        req_builder = req_builder.header("Authorization", value);
7006    };
7007    req_builder = req_builder.json(&p_body_registration_delete_request);
7008
7009    let req = req_builder.build()?;
7010    let resp = configuration.client.execute(req).await?;
7011
7012    let status = resp.status();
7013
7014    if !status.is_client_error() && !status.is_server_error() {
7015        Ok(())
7016    } else {
7017        let content = resp.text().await?;
7018        let entity: Option<DeleteUserRegistrationWithIdError> = serde_json::from_str(&content).ok();
7019        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7020    }
7021}
7022
7023/// Disable two-factor authentication for a user using a JSON body rather than URL parameters. OR Disable two-factor authentication for a user.
7024pub 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>> {
7025    // add a prefix to parameters to efficiently prevent name collisions
7026    let p_path_user_id = user_id;
7027    let p_query_method_id = method_id;
7028    let p_query_code = code;
7029    let p_body_two_factor_disable_request = two_factor_disable_request;
7030
7031    let uri_str = format!("{}/api/user/two-factor/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
7032    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7033
7034    if let Some(ref param_value) = p_query_method_id {
7035        req_builder = req_builder.query(&[("methodId", &param_value.to_string())]);
7036    }
7037    if let Some(ref param_value) = p_query_code {
7038        req_builder = req_builder.query(&[("code", &param_value.to_string())]);
7039    }
7040    if let Some(ref user_agent) = configuration.user_agent {
7041        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7042    }
7043    if let Some(ref apikey) = configuration.api_key {
7044        let key = apikey.key.clone();
7045        let value = match apikey.prefix {
7046            Some(ref prefix) => format!("{} {}", prefix, key),
7047            None => key,
7048        };
7049        req_builder = req_builder.header("Authorization", value);
7050    };
7051    req_builder = req_builder.json(&p_body_two_factor_disable_request);
7052
7053    let req = req_builder.build()?;
7054    let resp = configuration.client.execute(req).await?;
7055
7056    let status = resp.status();
7057
7058    if !status.is_client_error() && !status.is_server_error() {
7059        Ok(())
7060    } else {
7061        let content = resp.text().await?;
7062        let entity: Option<DeleteUserTwoFactorWithIdError> = serde_json::from_str(&content).ok();
7063        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7064    }
7065}
7066
7067/// 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.
7068pub 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>> {
7069    // add a prefix to parameters to efficiently prevent name collisions
7070    let p_path_user_id = user_id;
7071    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7072    let p_query_hard_delete = hard_delete;
7073    let p_body_user_delete_single_request = user_delete_single_request;
7074
7075    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
7076    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7077
7078    if let Some(ref param_value) = p_query_hard_delete {
7079        req_builder = req_builder.query(&[("hardDelete", &param_value.to_string())]);
7080    }
7081    if let Some(ref user_agent) = configuration.user_agent {
7082        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7083    }
7084    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7085        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7086    }
7087    if let Some(ref apikey) = configuration.api_key {
7088        let key = apikey.key.clone();
7089        let value = match apikey.prefix {
7090            Some(ref prefix) => format!("{} {}", prefix, key),
7091            None => key,
7092        };
7093        req_builder = req_builder.header("Authorization", value);
7094    };
7095    req_builder = req_builder.json(&p_body_user_delete_single_request);
7096
7097    let req = req_builder.build()?;
7098    let resp = configuration.client.execute(req).await?;
7099
7100    let status = resp.status();
7101
7102    if !status.is_client_error() && !status.is_server_error() {
7103        Ok(())
7104    } else {
7105        let content = resp.text().await?;
7106        let entity: Option<DeleteUserWithIdError> = serde_json::from_str(&content).ok();
7107        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7108    }
7109}
7110
7111/// Deletes the WebAuthn credential for the given Id.
7112pub async fn delete_web_authn_credential_with_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteWebAuthnCredentialWithIdError>> {
7113    // add a prefix to parameters to efficiently prevent name collisions
7114    let p_path_id = id;
7115
7116    let uri_str = format!("{}/api/webauthn/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
7117    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7118
7119    if let Some(ref user_agent) = configuration.user_agent {
7120        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7121    }
7122    if let Some(ref apikey) = configuration.api_key {
7123        let key = apikey.key.clone();
7124        let value = match apikey.prefix {
7125            Some(ref prefix) => format!("{} {}", prefix, key),
7126            None => key,
7127        };
7128        req_builder = req_builder.header("Authorization", value);
7129    };
7130
7131    let req = req_builder.build()?;
7132    let resp = configuration.client.execute(req).await?;
7133
7134    let status = resp.status();
7135
7136    if !status.is_client_error() && !status.is_server_error() {
7137        Ok(())
7138    } else {
7139        let content = resp.text().await?;
7140        let entity: Option<DeleteWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
7141        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7142    }
7143}
7144
7145/// Deletes the webhook for the given Id.
7146pub async fn delete_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str) -> Result<(), Error<DeleteWebhookWithIdError>> {
7147    // add a prefix to parameters to efficiently prevent name collisions
7148    let p_path_webhook_id = webhook_id;
7149
7150    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
7151    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7152
7153    if let Some(ref user_agent) = configuration.user_agent {
7154        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7155    }
7156    if let Some(ref apikey) = configuration.api_key {
7157        let key = apikey.key.clone();
7158        let value = match apikey.prefix {
7159            Some(ref prefix) => format!("{} {}", prefix, key),
7160            None => key,
7161        };
7162        req_builder = req_builder.header("Authorization", value);
7163    };
7164
7165    let req = req_builder.build()?;
7166    let resp = configuration.client.execute(req).await?;
7167
7168    let status = resp.status();
7169
7170    if !status.is_client_error() && !status.is_server_error() {
7171        Ok(())
7172    } else {
7173        let content = resp.text().await?;
7174        let entity: Option<DeleteWebhookWithIdError> = serde_json::from_str(&content).ok();
7175        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7176    }
7177}
7178
7179/// Enable two-factor authentication for a user.
7180pub async fn enable_two_factor_with_id(configuration: &configuration::Configuration, user_id: &str, two_factor_request: Option<models::TwoFactorRequest>) -> Result<models::TwoFactorResponse, Error<EnableTwoFactorWithIdError>> {
7181    // add a prefix to parameters to efficiently prevent name collisions
7182    let p_path_user_id = user_id;
7183    let p_body_two_factor_request = two_factor_request;
7184
7185    let uri_str = format!("{}/api/user/two-factor/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
7186    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7187
7188    if let Some(ref user_agent) = configuration.user_agent {
7189        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7190    }
7191    if let Some(ref apikey) = configuration.api_key {
7192        let key = apikey.key.clone();
7193        let value = match apikey.prefix {
7194            Some(ref prefix) => format!("{} {}", prefix, key),
7195            None => key,
7196        };
7197        req_builder = req_builder.header("Authorization", value);
7198    };
7199    req_builder = req_builder.json(&p_body_two_factor_request);
7200
7201    let req = req_builder.build()?;
7202    let resp = configuration.client.execute(req).await?;
7203
7204    let status = resp.status();
7205    let content_type = resp
7206        .headers()
7207        .get("content-type")
7208        .and_then(|v| v.to_str().ok())
7209        .unwrap_or("application/octet-stream");
7210    let content_type = super::ContentType::from(content_type);
7211
7212    if !status.is_client_error() && !status.is_server_error() {
7213        let content = resp.text().await?;
7214        match content_type {
7215            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7216            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorResponse`"))),
7217            ContentType::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`")))),
7218        }
7219    } else {
7220        let content = resp.text().await?;
7221        let entity: Option<EnableTwoFactorWithIdError> = serde_json::from_str(&content).ok();
7222        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7223    }
7224}
7225
7226/// Exchange a refresh token for a new JWT.
7227pub async fn exchange_refresh_token_for_jwt_with_id(configuration: &configuration::Configuration, refresh_request: Option<models::RefreshRequest>) -> Result<models::JwtRefreshResponse, Error<ExchangeRefreshTokenForJwtWithIdError>> {
7228    // add a prefix to parameters to efficiently prevent name collisions
7229    let p_body_refresh_request = refresh_request;
7230
7231    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
7232    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7233
7234    if let Some(ref user_agent) = configuration.user_agent {
7235        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7236    }
7237    if let Some(ref apikey) = configuration.api_key {
7238        let key = apikey.key.clone();
7239        let value = match apikey.prefix {
7240            Some(ref prefix) => format!("{} {}", prefix, key),
7241            None => key,
7242        };
7243        req_builder = req_builder.header("Authorization", value);
7244    };
7245    req_builder = req_builder.json(&p_body_refresh_request);
7246
7247    let req = req_builder.build()?;
7248    let resp = configuration.client.execute(req).await?;
7249
7250    let status = resp.status();
7251    let content_type = resp
7252        .headers()
7253        .get("content-type")
7254        .and_then(|v| v.to_str().ok())
7255        .unwrap_or("application/octet-stream");
7256    let content_type = super::ContentType::from(content_type);
7257
7258    if !status.is_client_error() && !status.is_server_error() {
7259        let content = resp.text().await?;
7260        match content_type {
7261            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7262            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwtRefreshResponse`"))),
7263            ContentType::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`")))),
7264        }
7265    } else {
7266        let content = resp.text().await?;
7267        let entity: Option<ExchangeRefreshTokenForJwtWithIdError> = serde_json::from_str(&content).ok();
7268        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7269    }
7270}
7271
7272/// Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
7273pub async fn forgot_password_with_id(configuration: &configuration::Configuration, forgot_password_request: Option<models::ForgotPasswordRequest>) -> Result<models::ForgotPasswordResponse, Error<ForgotPasswordWithIdError>> {
7274    // add a prefix to parameters to efficiently prevent name collisions
7275    let p_body_forgot_password_request = forgot_password_request;
7276
7277    let uri_str = format!("{}/api/user/forgot-password", configuration.base_path);
7278    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7279
7280    if let Some(ref user_agent) = configuration.user_agent {
7281        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7282    }
7283    if let Some(ref apikey) = configuration.api_key {
7284        let key = apikey.key.clone();
7285        let value = match apikey.prefix {
7286            Some(ref prefix) => format!("{} {}", prefix, key),
7287            None => key,
7288        };
7289        req_builder = req_builder.header("Authorization", value);
7290    };
7291    req_builder = req_builder.json(&p_body_forgot_password_request);
7292
7293    let req = req_builder.build()?;
7294    let resp = configuration.client.execute(req).await?;
7295
7296    let status = resp.status();
7297    let content_type = resp
7298        .headers()
7299        .get("content-type")
7300        .and_then(|v| v.to_str().ok())
7301        .unwrap_or("application/octet-stream");
7302    let content_type = super::ContentType::from(content_type);
7303
7304    if !status.is_client_error() && !status.is_server_error() {
7305        let content = resp.text().await?;
7306        match content_type {
7307            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7308            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ForgotPasswordResponse`"))),
7309            ContentType::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`")))),
7310        }
7311    } else {
7312        let content = resp.text().await?;
7313        let entity: Option<ForgotPasswordWithIdError> = serde_json::from_str(&content).ok();
7314        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7315    }
7316}
7317
7318/// Generate a new RSA or EC key pair or an HMAC secret.
7319pub async fn generate_key(configuration: &configuration::Configuration, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<GenerateKeyError>> {
7320    // add a prefix to parameters to efficiently prevent name collisions
7321    let p_body_key_request = key_request;
7322
7323    let uri_str = format!("{}/api/key/generate", configuration.base_path);
7324    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7325
7326    if let Some(ref user_agent) = configuration.user_agent {
7327        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7328    }
7329    if let Some(ref apikey) = configuration.api_key {
7330        let key = apikey.key.clone();
7331        let value = match apikey.prefix {
7332            Some(ref prefix) => format!("{} {}", prefix, key),
7333            None => key,
7334        };
7335        req_builder = req_builder.header("Authorization", value);
7336    };
7337    req_builder = req_builder.json(&p_body_key_request);
7338
7339    let req = req_builder.build()?;
7340    let resp = configuration.client.execute(req).await?;
7341
7342    let status = resp.status();
7343    let content_type = resp
7344        .headers()
7345        .get("content-type")
7346        .and_then(|v| v.to_str().ok())
7347        .unwrap_or("application/octet-stream");
7348    let content_type = super::ContentType::from(content_type);
7349
7350    if !status.is_client_error() && !status.is_server_error() {
7351        let content = resp.text().await?;
7352        match content_type {
7353            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7354            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7355            ContentType::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`")))),
7356        }
7357    } else {
7358        let content = resp.text().await?;
7359        let entity: Option<GenerateKeyError> = serde_json::from_str(&content).ok();
7360        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7361    }
7362}
7363
7364/// Generate a new RSA or EC key pair or an HMAC secret.
7365pub async fn generate_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<GenerateKeyWithIdError>> {
7366    // add a prefix to parameters to efficiently prevent name collisions
7367    let p_path_key_id = key_id;
7368    let p_body_key_request = key_request;
7369
7370    let uri_str = format!("{}/api/key/generate/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
7371    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7372
7373    if let Some(ref user_agent) = configuration.user_agent {
7374        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7375    }
7376    if let Some(ref apikey) = configuration.api_key {
7377        let key = apikey.key.clone();
7378        let value = match apikey.prefix {
7379            Some(ref prefix) => format!("{} {}", prefix, key),
7380            None => key,
7381        };
7382        req_builder = req_builder.header("Authorization", value);
7383    };
7384    req_builder = req_builder.json(&p_body_key_request);
7385
7386    let req = req_builder.build()?;
7387    let resp = configuration.client.execute(req).await?;
7388
7389    let status = resp.status();
7390    let content_type = resp
7391        .headers()
7392        .get("content-type")
7393        .and_then(|v| v.to_str().ok())
7394        .unwrap_or("application/octet-stream");
7395    let content_type = super::ContentType::from(content_type);
7396
7397    if !status.is_client_error() && !status.is_server_error() {
7398        let content = resp.text().await?;
7399        match content_type {
7400            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7401            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7402            ContentType::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`")))),
7403        }
7404    } else {
7405        let content = resp.text().await?;
7406        let entity: Option<GenerateKeyWithIdError> = serde_json::from_str(&content).ok();
7407        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7408    }
7409}
7410
7411/// Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
7412pub async fn generate_two_factor_recovery_codes_with_id(configuration: &configuration::Configuration, user_id: &str) -> Result<models::TwoFactorRecoveryCodeResponse, Error<GenerateTwoFactorRecoveryCodesWithIdError>> {
7413    // add a prefix to parameters to efficiently prevent name collisions
7414    let p_path_user_id = user_id;
7415
7416    let uri_str = format!("{}/api/user/two-factor/recovery-code/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
7417    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7418
7419    if let Some(ref user_agent) = configuration.user_agent {
7420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7421    }
7422    if let Some(ref apikey) = configuration.api_key {
7423        let key = apikey.key.clone();
7424        let value = match apikey.prefix {
7425            Some(ref prefix) => format!("{} {}", prefix, key),
7426            None => key,
7427        };
7428        req_builder = req_builder.header("Authorization", value);
7429    };
7430
7431    let req = req_builder.build()?;
7432    let resp = configuration.client.execute(req).await?;
7433
7434    let status = resp.status();
7435    let content_type = resp
7436        .headers()
7437        .get("content-type")
7438        .and_then(|v| v.to_str().ok())
7439        .unwrap_or("application/octet-stream");
7440    let content_type = super::ContentType::from(content_type);
7441
7442    if !status.is_client_error() && !status.is_server_error() {
7443        let content = resp.text().await?;
7444        match content_type {
7445            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7446            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`"))),
7447            ContentType::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`")))),
7448        }
7449    } else {
7450        let content = resp.text().await?;
7451        let entity: Option<GenerateTwoFactorRecoveryCodesWithIdError> = serde_json::from_str(&content).ok();
7452        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7453    }
7454}
7455
7456/// 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.
7457pub async fn generate_two_factor_secret_using_jwt_with_id(configuration: &configuration::Configuration, ) -> Result<models::SecretResponse, Error<GenerateTwoFactorSecretUsingJwtWithIdError>> {
7458
7459    let uri_str = format!("{}/api/two-factor/secret", configuration.base_path);
7460    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7461
7462    if let Some(ref user_agent) = configuration.user_agent {
7463        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7464    }
7465    if let Some(ref token) = configuration.bearer_access_token {
7466        req_builder = req_builder.bearer_auth(token.to_owned());
7467    };
7468
7469    let req = req_builder.build()?;
7470    let resp = configuration.client.execute(req).await?;
7471
7472    let status = resp.status();
7473    let content_type = resp
7474        .headers()
7475        .get("content-type")
7476        .and_then(|v| v.to_str().ok())
7477        .unwrap_or("application/octet-stream");
7478    let content_type = super::ContentType::from(content_type);
7479
7480    if !status.is_client_error() && !status.is_server_error() {
7481        let content = resp.text().await?;
7482        match content_type {
7483            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7484            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretResponse`"))),
7485            ContentType::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`")))),
7486        }
7487    } else {
7488        let content = resp.text().await?;
7489        let entity: Option<GenerateTwoFactorSecretUsingJwtWithIdError> = serde_json::from_str(&content).ok();
7490        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7491    }
7492}
7493
7494/// Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.
7495pub 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>> {
7496    // add a prefix to parameters to efficiently prevent name collisions
7497    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7498    let p_body_identity_provider_login_request = identity_provider_login_request;
7499
7500    let uri_str = format!("{}/api/identity-provider/login", configuration.base_path);
7501    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7502
7503    if let Some(ref user_agent) = configuration.user_agent {
7504        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7505    }
7506    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7507        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7508    }
7509    if let Some(ref apikey) = configuration.api_key {
7510        let key = apikey.key.clone();
7511        let value = match apikey.prefix {
7512            Some(ref prefix) => format!("{} {}", prefix, key),
7513            None => key,
7514        };
7515        req_builder = req_builder.header("Authorization", value);
7516    };
7517    req_builder = req_builder.json(&p_body_identity_provider_login_request);
7518
7519    let req = req_builder.build()?;
7520    let resp = configuration.client.execute(req).await?;
7521
7522    let status = resp.status();
7523    let content_type = resp
7524        .headers()
7525        .get("content-type")
7526        .and_then(|v| v.to_str().ok())
7527        .unwrap_or("application/octet-stream");
7528    let content_type = super::ContentType::from(content_type);
7529
7530    if !status.is_client_error() && !status.is_server_error() {
7531        let content = resp.text().await?;
7532        match content_type {
7533            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7534            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7535            ContentType::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`")))),
7536        }
7537    } else {
7538        let content = resp.text().await?;
7539        let entity: Option<IdentityProviderLoginWithIdError> = serde_json::from_str(&content).ok();
7540        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7541    }
7542}
7543
7544/// Import an existing RSA or EC key pair or an HMAC secret.
7545pub async fn import_key(configuration: &configuration::Configuration, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<ImportKeyError>> {
7546    // add a prefix to parameters to efficiently prevent name collisions
7547    let p_body_key_request = key_request;
7548
7549    let uri_str = format!("{}/api/key/import", configuration.base_path);
7550    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7551
7552    if let Some(ref user_agent) = configuration.user_agent {
7553        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7554    }
7555    if let Some(ref apikey) = configuration.api_key {
7556        let key = apikey.key.clone();
7557        let value = match apikey.prefix {
7558            Some(ref prefix) => format!("{} {}", prefix, key),
7559            None => key,
7560        };
7561        req_builder = req_builder.header("Authorization", value);
7562    };
7563    req_builder = req_builder.json(&p_body_key_request);
7564
7565    let req = req_builder.build()?;
7566    let resp = configuration.client.execute(req).await?;
7567
7568    let status = resp.status();
7569    let content_type = resp
7570        .headers()
7571        .get("content-type")
7572        .and_then(|v| v.to_str().ok())
7573        .unwrap_or("application/octet-stream");
7574    let content_type = super::ContentType::from(content_type);
7575
7576    if !status.is_client_error() && !status.is_server_error() {
7577        let content = resp.text().await?;
7578        match content_type {
7579            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7580            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7581            ContentType::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`")))),
7582        }
7583    } else {
7584        let content = resp.text().await?;
7585        let entity: Option<ImportKeyError> = serde_json::from_str(&content).ok();
7586        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7587    }
7588}
7589
7590/// Import an existing RSA or EC key pair or an HMAC secret.
7591pub async fn import_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<ImportKeyWithIdError>> {
7592    // add a prefix to parameters to efficiently prevent name collisions
7593    let p_path_key_id = key_id;
7594    let p_body_key_request = key_request;
7595
7596    let uri_str = format!("{}/api/key/import/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
7597    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7598
7599    if let Some(ref user_agent) = configuration.user_agent {
7600        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7601    }
7602    if let Some(ref apikey) = configuration.api_key {
7603        let key = apikey.key.clone();
7604        let value = match apikey.prefix {
7605            Some(ref prefix) => format!("{} {}", prefix, key),
7606            None => key,
7607        };
7608        req_builder = req_builder.header("Authorization", value);
7609    };
7610    req_builder = req_builder.json(&p_body_key_request);
7611
7612    let req = req_builder.build()?;
7613    let resp = configuration.client.execute(req).await?;
7614
7615    let status = resp.status();
7616    let content_type = resp
7617        .headers()
7618        .get("content-type")
7619        .and_then(|v| v.to_str().ok())
7620        .unwrap_or("application/octet-stream");
7621    let content_type = super::ContentType::from(content_type);
7622
7623    if !status.is_client_error() && !status.is_server_error() {
7624        let content = resp.text().await?;
7625        match content_type {
7626            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7627            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
7628            ContentType::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`")))),
7629        }
7630    } else {
7631        let content = resp.text().await?;
7632        let entity: Option<ImportKeyWithIdError> = serde_json::from_str(&content).ok();
7633        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7634    }
7635}
7636
7637/// 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.
7638pub async fn import_refresh_tokens_with_id(configuration: &configuration::Configuration, refresh_token_import_request: Option<models::RefreshTokenImportRequest>) -> Result<(), Error<ImportRefreshTokensWithIdError>> {
7639    // add a prefix to parameters to efficiently prevent name collisions
7640    let p_body_refresh_token_import_request = refresh_token_import_request;
7641
7642    let uri_str = format!("{}/api/user/refresh-token/import", configuration.base_path);
7643    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7644
7645    if let Some(ref user_agent) = configuration.user_agent {
7646        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7647    }
7648    if let Some(ref apikey) = configuration.api_key {
7649        let key = apikey.key.clone();
7650        let value = match apikey.prefix {
7651            Some(ref prefix) => format!("{} {}", prefix, key),
7652            None => key,
7653        };
7654        req_builder = req_builder.header("Authorization", value);
7655    };
7656    req_builder = req_builder.json(&p_body_refresh_token_import_request);
7657
7658    let req = req_builder.build()?;
7659    let resp = configuration.client.execute(req).await?;
7660
7661    let status = resp.status();
7662
7663    if !status.is_client_error() && !status.is_server_error() {
7664        Ok(())
7665    } else {
7666        let content = resp.text().await?;
7667        let entity: Option<ImportRefreshTokensWithIdError> = serde_json::from_str(&content).ok();
7668        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7669    }
7670}
7671
7672/// 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.
7673pub async fn import_users_with_id(configuration: &configuration::Configuration, import_request: Option<models::ImportRequest>) -> Result<(), Error<ImportUsersWithIdError>> {
7674    // add a prefix to parameters to efficiently prevent name collisions
7675    let p_body_import_request = import_request;
7676
7677    let uri_str = format!("{}/api/user/import", configuration.base_path);
7678    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7679
7680    if let Some(ref user_agent) = configuration.user_agent {
7681        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7682    }
7683    if let Some(ref apikey) = configuration.api_key {
7684        let key = apikey.key.clone();
7685        let value = match apikey.prefix {
7686            Some(ref prefix) => format!("{} {}", prefix, key),
7687            None => key,
7688        };
7689        req_builder = req_builder.header("Authorization", value);
7690    };
7691    req_builder = req_builder.json(&p_body_import_request);
7692
7693    let req = req_builder.build()?;
7694    let resp = configuration.client.execute(req).await?;
7695
7696    let status = resp.status();
7697
7698    if !status.is_client_error() && !status.is_server_error() {
7699        Ok(())
7700    } else {
7701        let content = resp.text().await?;
7702        let entity: Option<ImportUsersWithIdError> = serde_json::from_str(&content).ok();
7703        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7704    }
7705}
7706
7707/// Import a WebAuthn credential
7708pub async fn import_web_authn_credential_with_id(configuration: &configuration::Configuration, web_authn_credential_import_request: Option<models::WebAuthnCredentialImportRequest>) -> Result<(), Error<ImportWebAuthnCredentialWithIdError>> {
7709    // add a prefix to parameters to efficiently prevent name collisions
7710    let p_body_web_authn_credential_import_request = web_authn_credential_import_request;
7711
7712    let uri_str = format!("{}/api/webauthn/import", configuration.base_path);
7713    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7714
7715    if let Some(ref user_agent) = configuration.user_agent {
7716        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7717    }
7718    if let Some(ref apikey) = configuration.api_key {
7719        let key = apikey.key.clone();
7720        let value = match apikey.prefix {
7721            Some(ref prefix) => format!("{} {}", prefix, key),
7722            None => key,
7723        };
7724        req_builder = req_builder.header("Authorization", value);
7725    };
7726    req_builder = req_builder.json(&p_body_web_authn_credential_import_request);
7727
7728    let req = req_builder.build()?;
7729    let resp = configuration.client.execute(req).await?;
7730
7731    let status = resp.status();
7732
7733    if !status.is_client_error() && !status.is_server_error() {
7734        Ok(())
7735    } else {
7736        let content = resp.text().await?;
7737        let entity: Option<ImportWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
7738        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7739    }
7740}
7741
7742/// 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.
7743pub async fn issue_jwt_with_id(configuration: &configuration::Configuration, application_id: Option<&str>, refresh_token: Option<&str>) -> Result<models::IssueResponse, Error<IssueJwtWithIdError>> {
7744    // add a prefix to parameters to efficiently prevent name collisions
7745    let p_query_application_id = application_id;
7746    let p_query_refresh_token = refresh_token;
7747
7748    let uri_str = format!("{}/api/jwt/issue", configuration.base_path);
7749    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7750
7751    if let Some(ref param_value) = p_query_application_id {
7752        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
7753    }
7754    if let Some(ref param_value) = p_query_refresh_token {
7755        req_builder = req_builder.query(&[("refreshToken", &param_value.to_string())]);
7756    }
7757    if let Some(ref user_agent) = configuration.user_agent {
7758        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7759    }
7760    if let Some(ref token) = configuration.bearer_access_token {
7761        req_builder = req_builder.bearer_auth(token.to_owned());
7762    };
7763
7764    let req = req_builder.build()?;
7765    let resp = configuration.client.execute(req).await?;
7766
7767    let status = resp.status();
7768    let content_type = resp
7769        .headers()
7770        .get("content-type")
7771        .and_then(|v| v.to_str().ok())
7772        .unwrap_or("application/octet-stream");
7773    let content_type = super::ContentType::from(content_type);
7774
7775    if !status.is_client_error() && !status.is_server_error() {
7776        let content = resp.text().await?;
7777        match content_type {
7778            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7779            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IssueResponse`"))),
7780            ContentType::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`")))),
7781        }
7782    } else {
7783        let content = resp.text().await?;
7784        let entity: Option<IssueJwtWithIdError> = serde_json::from_str(&content).ok();
7785        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7786    }
7787}
7788
7789/// 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.
7790pub 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>> {
7791    // add a prefix to parameters to efficiently prevent name collisions
7792    let p_path_user_id = user_id;
7793    let p_path_application_id = application_id;
7794    let p_query_caller_ip_address = caller_ip_address;
7795    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7796
7797    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));
7798    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7799
7800    if let Some(ref param_value) = p_query_caller_ip_address {
7801        req_builder = req_builder.query(&[("callerIPAddress", &param_value.to_string())]);
7802    }
7803    if let Some(ref user_agent) = configuration.user_agent {
7804        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7805    }
7806    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7807        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7808    }
7809    if let Some(ref apikey) = configuration.api_key {
7810        let key = apikey.key.clone();
7811        let value = match apikey.prefix {
7812            Some(ref prefix) => format!("{} {}", prefix, key),
7813            None => key,
7814        };
7815        req_builder = req_builder.header("Authorization", value);
7816    };
7817
7818    let req = req_builder.build()?;
7819    let resp = configuration.client.execute(req).await?;
7820
7821    let status = resp.status();
7822    let content_type = resp
7823        .headers()
7824        .get("content-type")
7825        .and_then(|v| v.to_str().ok())
7826        .unwrap_or("application/octet-stream");
7827    let content_type = super::ContentType::from(content_type);
7828
7829    if !status.is_client_error() && !status.is_server_error() {
7830        let content = resp.text().await?;
7831        match content_type {
7832            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7833            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7834            ContentType::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`")))),
7835        }
7836    } else {
7837        let content = resp.text().await?;
7838        let entity: Option<LoginPingWithIdError> = serde_json::from_str(&content).ok();
7839        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7840    }
7841}
7842
7843/// 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.
7844pub 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>> {
7845    // add a prefix to parameters to efficiently prevent name collisions
7846    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7847    let p_body_login_ping_request = login_ping_request;
7848
7849    let uri_str = format!("{}/api/login", configuration.base_path);
7850    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7851
7852    if let Some(ref user_agent) = configuration.user_agent {
7853        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7854    }
7855    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7856        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7857    }
7858    if let Some(ref apikey) = configuration.api_key {
7859        let key = apikey.key.clone();
7860        let value = match apikey.prefix {
7861            Some(ref prefix) => format!("{} {}", prefix, key),
7862            None => key,
7863        };
7864        req_builder = req_builder.header("Authorization", value);
7865    };
7866    req_builder = req_builder.json(&p_body_login_ping_request);
7867
7868    let req = req_builder.build()?;
7869    let resp = configuration.client.execute(req).await?;
7870
7871    let status = resp.status();
7872    let content_type = resp
7873        .headers()
7874        .get("content-type")
7875        .and_then(|v| v.to_str().ok())
7876        .unwrap_or("application/octet-stream");
7877    let content_type = super::ContentType::from(content_type);
7878
7879    if !status.is_client_error() && !status.is_server_error() {
7880        let content = resp.text().await?;
7881        match content_type {
7882            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7883            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7884            ContentType::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`")))),
7885        }
7886    } else {
7887        let content = resp.text().await?;
7888        let entity: Option<LoginPingWithRequestWithIdError> = serde_json::from_str(&content).ok();
7889        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7890    }
7891}
7892
7893/// Authenticates a user to FusionAuth.   This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
7894pub 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>> {
7895    // add a prefix to parameters to efficiently prevent name collisions
7896    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
7897    let p_body_login_request = login_request;
7898
7899    let uri_str = format!("{}/api/login", configuration.base_path);
7900    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7901
7902    if let Some(ref user_agent) = configuration.user_agent {
7903        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7904    }
7905    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
7906        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
7907    }
7908    if let Some(ref apikey) = configuration.api_key {
7909        let key = apikey.key.clone();
7910        let value = match apikey.prefix {
7911            Some(ref prefix) => format!("{} {}", prefix, key),
7912            None => key,
7913        };
7914        req_builder = req_builder.header("Authorization", value);
7915    };
7916    req_builder = req_builder.json(&p_body_login_request);
7917
7918    let req = req_builder.build()?;
7919    let resp = configuration.client.execute(req).await?;
7920
7921    let status = resp.status();
7922    let content_type = resp
7923        .headers()
7924        .get("content-type")
7925        .and_then(|v| v.to_str().ok())
7926        .unwrap_or("application/octet-stream");
7927    let content_type = super::ContentType::from(content_type);
7928
7929    if !status.is_client_error() && !status.is_server_error() {
7930        let content = resp.text().await?;
7931        match content_type {
7932            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7933            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
7934            ContentType::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`")))),
7935        }
7936    } else {
7937        let content = resp.text().await?;
7938        let entity: Option<LoginWithIdError> = serde_json::from_str(&content).ok();
7939        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7940    }
7941}
7942
7943/// 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.
7944pub async fn lookup_identity_provider_with_id(configuration: &configuration::Configuration, domain: Option<&str>) -> Result<models::LookupResponse, Error<LookupIdentityProviderWithIdError>> {
7945    // add a prefix to parameters to efficiently prevent name collisions
7946    let p_query_domain = domain;
7947
7948    let uri_str = format!("{}/api/identity-provider/lookup", configuration.base_path);
7949    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7950
7951    if let Some(ref param_value) = p_query_domain {
7952        req_builder = req_builder.query(&[("domain", &param_value.to_string())]);
7953    }
7954    if let Some(ref user_agent) = configuration.user_agent {
7955        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7956    }
7957    if let Some(ref apikey) = configuration.api_key {
7958        let key = apikey.key.clone();
7959        let value = match apikey.prefix {
7960            Some(ref prefix) => format!("{} {}", prefix, key),
7961            None => key,
7962        };
7963        req_builder = req_builder.header("Authorization", value);
7964    };
7965
7966    let req = req_builder.build()?;
7967    let resp = configuration.client.execute(req).await?;
7968
7969    let status = resp.status();
7970    let content_type = resp
7971        .headers()
7972        .get("content-type")
7973        .and_then(|v| v.to_str().ok())
7974        .unwrap_or("application/octet-stream");
7975    let content_type = super::ContentType::from(content_type);
7976
7977    if !status.is_client_error() && !status.is_server_error() {
7978        let content = resp.text().await?;
7979        match content_type {
7980            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7981            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LookupResponse`"))),
7982            ContentType::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`")))),
7983        }
7984    } else {
7985        let content = resp.text().await?;
7986        let entity: Option<LookupIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
7987        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7988    }
7989}
7990
7991/// Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.
7992pub async fn modify_action_with_id(configuration: &configuration::Configuration, action_id: &str, action_request: Option<models::ActionRequest>) -> Result<models::ActionResponse, Error<ModifyActionWithIdError>> {
7993    // add a prefix to parameters to efficiently prevent name collisions
7994    let p_path_action_id = action_id;
7995    let p_body_action_request = action_request;
7996
7997    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_path_action_id));
7998    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7999
8000    if let Some(ref user_agent) = configuration.user_agent {
8001        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8002    }
8003    if let Some(ref apikey) = configuration.api_key {
8004        let key = apikey.key.clone();
8005        let value = match apikey.prefix {
8006            Some(ref prefix) => format!("{} {}", prefix, key),
8007            None => key,
8008        };
8009        req_builder = req_builder.header("Authorization", value);
8010    };
8011    req_builder = req_builder.json(&p_body_action_request);
8012
8013    let req = req_builder.build()?;
8014    let resp = configuration.client.execute(req).await?;
8015
8016    let status = resp.status();
8017    let content_type = resp
8018        .headers()
8019        .get("content-type")
8020        .and_then(|v| v.to_str().ok())
8021        .unwrap_or("application/octet-stream");
8022    let content_type = super::ContentType::from(content_type);
8023
8024    if !status.is_client_error() && !status.is_server_error() {
8025        let content = resp.text().await?;
8026        match content_type {
8027            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8028            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
8029            ContentType::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`")))),
8030        }
8031    } else {
8032        let content = resp.text().await?;
8033        let entity: Option<ModifyActionWithIdError> = serde_json::from_str(&content).ok();
8034        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8035    }
8036}
8037
8038/// Complete a login request using a passwordless code
8039pub async fn passwordless_login_with_id(configuration: &configuration::Configuration, passwordless_login_request: Option<models::PasswordlessLoginRequest>) -> Result<models::LoginResponse, Error<PasswordlessLoginWithIdError>> {
8040    // add a prefix to parameters to efficiently prevent name collisions
8041    let p_body_passwordless_login_request = passwordless_login_request;
8042
8043    let uri_str = format!("{}/api/passwordless/login", configuration.base_path);
8044    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8045
8046    if let Some(ref user_agent) = configuration.user_agent {
8047        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8048    }
8049    if let Some(ref apikey) = configuration.api_key {
8050        let key = apikey.key.clone();
8051        let value = match apikey.prefix {
8052            Some(ref prefix) => format!("{} {}", prefix, key),
8053            None => key,
8054        };
8055        req_builder = req_builder.header("Authorization", value);
8056    };
8057    req_builder = req_builder.json(&p_body_passwordless_login_request);
8058
8059    let req = req_builder.build()?;
8060    let resp = configuration.client.execute(req).await?;
8061
8062    let status = resp.status();
8063    let content_type = resp
8064        .headers()
8065        .get("content-type")
8066        .and_then(|v| v.to_str().ok())
8067        .unwrap_or("application/octet-stream");
8068    let content_type = super::ContentType::from(content_type);
8069
8070    if !status.is_client_error() && !status.is_server_error() {
8071        let content = resp.text().await?;
8072        match content_type {
8073            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8074            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
8075            ContentType::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`")))),
8076        }
8077    } else {
8078        let content = resp.text().await?;
8079        let entity: Option<PasswordlessLoginWithIdError> = serde_json::from_str(&content).ok();
8080        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8081    }
8082}
8083
8084/// Updates an API key with the given Id.
8085pub async fn patch_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<PatchApiKeyWithIdError>> {
8086    // add a prefix to parameters to efficiently prevent name collisions
8087    let p_path_key_id = key_id;
8088    let p_body_api_key_request = api_key_request;
8089
8090    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
8091    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8092
8093    if let Some(ref user_agent) = configuration.user_agent {
8094        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8095    }
8096    if let Some(ref apikey) = configuration.api_key {
8097        let key = apikey.key.clone();
8098        let value = match apikey.prefix {
8099            Some(ref prefix) => format!("{} {}", prefix, key),
8100            None => key,
8101        };
8102        req_builder = req_builder.header("Authorization", value);
8103    };
8104    req_builder = req_builder.json(&p_body_api_key_request);
8105
8106    let req = req_builder.build()?;
8107    let resp = configuration.client.execute(req).await?;
8108
8109    let status = resp.status();
8110    let content_type = resp
8111        .headers()
8112        .get("content-type")
8113        .and_then(|v| v.to_str().ok())
8114        .unwrap_or("application/octet-stream");
8115    let content_type = super::ContentType::from(content_type);
8116
8117    if !status.is_client_error() && !status.is_server_error() {
8118        let content = resp.text().await?;
8119        match content_type {
8120            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8121            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
8122            ContentType::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`")))),
8123        }
8124    } else {
8125        let content = resp.text().await?;
8126        let entity: Option<PatchApiKeyWithIdError> = serde_json::from_str(&content).ok();
8127        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8128    }
8129}
8130
8131/// Updates, via PATCH, the application role with the given Id for the application.
8132pub 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>> {
8133    // add a prefix to parameters to efficiently prevent name collisions
8134    let p_path_application_id = application_id;
8135    let p_path_role_id = role_id;
8136    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8137    let p_body_application_request = application_request;
8138
8139    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));
8140    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8141
8142    if let Some(ref user_agent) = configuration.user_agent {
8143        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8144    }
8145    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8146        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8147    }
8148    if let Some(ref apikey) = configuration.api_key {
8149        let key = apikey.key.clone();
8150        let value = match apikey.prefix {
8151            Some(ref prefix) => format!("{} {}", prefix, key),
8152            None => key,
8153        };
8154        req_builder = req_builder.header("Authorization", value);
8155    };
8156    req_builder = req_builder.json(&p_body_application_request);
8157
8158    let req = req_builder.build()?;
8159    let resp = configuration.client.execute(req).await?;
8160
8161    let status = resp.status();
8162    let content_type = resp
8163        .headers()
8164        .get("content-type")
8165        .and_then(|v| v.to_str().ok())
8166        .unwrap_or("application/octet-stream");
8167    let content_type = super::ContentType::from(content_type);
8168
8169    if !status.is_client_error() && !status.is_server_error() {
8170        let content = resp.text().await?;
8171        match content_type {
8172            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8173            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
8174            ContentType::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`")))),
8175        }
8176    } else {
8177        let content = resp.text().await?;
8178        let entity: Option<PatchApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
8179        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8180    }
8181}
8182
8183/// Updates, via PATCH, the application with the given Id.
8184pub 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>> {
8185    // add a prefix to parameters to efficiently prevent name collisions
8186    let p_path_application_id = application_id;
8187    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8188    let p_body_application_request = application_request;
8189
8190    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
8191    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8192
8193    if let Some(ref user_agent) = configuration.user_agent {
8194        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8195    }
8196    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8197        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8198    }
8199    if let Some(ref apikey) = configuration.api_key {
8200        let key = apikey.key.clone();
8201        let value = match apikey.prefix {
8202            Some(ref prefix) => format!("{} {}", prefix, key),
8203            None => key,
8204        };
8205        req_builder = req_builder.header("Authorization", value);
8206    };
8207    req_builder = req_builder.json(&p_body_application_request);
8208
8209    let req = req_builder.build()?;
8210    let resp = configuration.client.execute(req).await?;
8211
8212    let status = resp.status();
8213    let content_type = resp
8214        .headers()
8215        .get("content-type")
8216        .and_then(|v| v.to_str().ok())
8217        .unwrap_or("application/octet-stream");
8218    let content_type = super::ContentType::from(content_type);
8219
8220    if !status.is_client_error() && !status.is_server_error() {
8221        let content = resp.text().await?;
8222        match content_type {
8223            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8224            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
8225            ContentType::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`")))),
8226        }
8227    } else {
8228        let content = resp.text().await?;
8229        let entity: Option<PatchApplicationWithIdError> = serde_json::from_str(&content).ok();
8230        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8231    }
8232}
8233
8234/// Updates, via PATCH, the connector with the given Id.
8235pub async fn patch_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<PatchConnectorWithIdError>> {
8236    // add a prefix to parameters to efficiently prevent name collisions
8237    let p_path_connector_id = connector_id;
8238    let p_body_connector_request = connector_request;
8239
8240    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
8241    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8242
8243    if let Some(ref user_agent) = configuration.user_agent {
8244        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8245    }
8246    if let Some(ref apikey) = configuration.api_key {
8247        let key = apikey.key.clone();
8248        let value = match apikey.prefix {
8249            Some(ref prefix) => format!("{} {}", prefix, key),
8250            None => key,
8251        };
8252        req_builder = req_builder.header("Authorization", value);
8253    };
8254    req_builder = req_builder.json(&p_body_connector_request);
8255
8256    let req = req_builder.build()?;
8257    let resp = configuration.client.execute(req).await?;
8258
8259    let status = resp.status();
8260    let content_type = resp
8261        .headers()
8262        .get("content-type")
8263        .and_then(|v| v.to_str().ok())
8264        .unwrap_or("application/octet-stream");
8265    let content_type = super::ContentType::from(content_type);
8266
8267    if !status.is_client_error() && !status.is_server_error() {
8268        let content = resp.text().await?;
8269        match content_type {
8270            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8271            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
8272            ContentType::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`")))),
8273        }
8274    } else {
8275        let content = resp.text().await?;
8276        let entity: Option<PatchConnectorWithIdError> = serde_json::from_str(&content).ok();
8277        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8278    }
8279}
8280
8281/// Updates, via PATCH, the consent with the given Id.
8282pub 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>> {
8283    // add a prefix to parameters to efficiently prevent name collisions
8284    let p_path_consent_id = consent_id;
8285    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8286    let p_body_consent_request = consent_request;
8287
8288    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
8289    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8290
8291    if let Some(ref user_agent) = configuration.user_agent {
8292        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8293    }
8294    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8295        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8296    }
8297    if let Some(ref apikey) = configuration.api_key {
8298        let key = apikey.key.clone();
8299        let value = match apikey.prefix {
8300            Some(ref prefix) => format!("{} {}", prefix, key),
8301            None => key,
8302        };
8303        req_builder = req_builder.header("Authorization", value);
8304    };
8305    req_builder = req_builder.json(&p_body_consent_request);
8306
8307    let req = req_builder.build()?;
8308    let resp = configuration.client.execute(req).await?;
8309
8310    let status = resp.status();
8311    let content_type = resp
8312        .headers()
8313        .get("content-type")
8314        .and_then(|v| v.to_str().ok())
8315        .unwrap_or("application/octet-stream");
8316    let content_type = super::ContentType::from(content_type);
8317
8318    if !status.is_client_error() && !status.is_server_error() {
8319        let content = resp.text().await?;
8320        match content_type {
8321            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8322            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
8323            ContentType::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`")))),
8324        }
8325    } else {
8326        let content = resp.text().await?;
8327        let entity: Option<PatchConsentWithIdError> = serde_json::from_str(&content).ok();
8328        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8329    }
8330}
8331
8332/// Updates, via PATCH, the email template with the given Id.
8333pub 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>> {
8334    // add a prefix to parameters to efficiently prevent name collisions
8335    let p_path_email_template_id = email_template_id;
8336    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8337    let p_body_email_template_request = email_template_request;
8338
8339    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
8340    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8341
8342    if let Some(ref user_agent) = configuration.user_agent {
8343        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8344    }
8345    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8346        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8347    }
8348    if let Some(ref apikey) = configuration.api_key {
8349        let key = apikey.key.clone();
8350        let value = match apikey.prefix {
8351            Some(ref prefix) => format!("{} {}", prefix, key),
8352            None => key,
8353        };
8354        req_builder = req_builder.header("Authorization", value);
8355    };
8356    req_builder = req_builder.json(&p_body_email_template_request);
8357
8358    let req = req_builder.build()?;
8359    let resp = configuration.client.execute(req).await?;
8360
8361    let status = resp.status();
8362    let content_type = resp
8363        .headers()
8364        .get("content-type")
8365        .and_then(|v| v.to_str().ok())
8366        .unwrap_or("application/octet-stream");
8367    let content_type = super::ContentType::from(content_type);
8368
8369    if !status.is_client_error() && !status.is_server_error() {
8370        let content = resp.text().await?;
8371        match content_type {
8372            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8373            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
8374            ContentType::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`")))),
8375        }
8376    } else {
8377        let content = resp.text().await?;
8378        let entity: Option<PatchEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
8379        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8380    }
8381}
8382
8383/// Patches the permission with the given Id for the entity type.
8384pub 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>> {
8385    // add a prefix to parameters to efficiently prevent name collisions
8386    let p_path_entity_type_id = entity_type_id;
8387    let p_path_permission_id = permission_id;
8388    let p_body_entity_type_request = entity_type_request;
8389
8390    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));
8391    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8392
8393    if let Some(ref user_agent) = configuration.user_agent {
8394        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8395    }
8396    if let Some(ref apikey) = configuration.api_key {
8397        let key = apikey.key.clone();
8398        let value = match apikey.prefix {
8399            Some(ref prefix) => format!("{} {}", prefix, key),
8400            None => key,
8401        };
8402        req_builder = req_builder.header("Authorization", value);
8403    };
8404    req_builder = req_builder.json(&p_body_entity_type_request);
8405
8406    let req = req_builder.build()?;
8407    let resp = configuration.client.execute(req).await?;
8408
8409    let status = resp.status();
8410    let content_type = resp
8411        .headers()
8412        .get("content-type")
8413        .and_then(|v| v.to_str().ok())
8414        .unwrap_or("application/octet-stream");
8415    let content_type = super::ContentType::from(content_type);
8416
8417    if !status.is_client_error() && !status.is_server_error() {
8418        let content = resp.text().await?;
8419        match content_type {
8420            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8421            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
8422            ContentType::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`")))),
8423        }
8424    } else {
8425        let content = resp.text().await?;
8426        let entity: Option<PatchEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
8427        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8428    }
8429}
8430
8431/// Updates, via PATCH, the Entity Type with the given Id.
8432pub 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>> {
8433    // add a prefix to parameters to efficiently prevent name collisions
8434    let p_path_entity_type_id = entity_type_id;
8435    let p_body_entity_type_request = entity_type_request;
8436
8437    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
8438    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8439
8440    if let Some(ref user_agent) = configuration.user_agent {
8441        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8442    }
8443    if let Some(ref apikey) = configuration.api_key {
8444        let key = apikey.key.clone();
8445        let value = match apikey.prefix {
8446            Some(ref prefix) => format!("{} {}", prefix, key),
8447            None => key,
8448        };
8449        req_builder = req_builder.header("Authorization", value);
8450    };
8451    req_builder = req_builder.json(&p_body_entity_type_request);
8452
8453    let req = req_builder.build()?;
8454    let resp = configuration.client.execute(req).await?;
8455
8456    let status = resp.status();
8457    let content_type = resp
8458        .headers()
8459        .get("content-type")
8460        .and_then(|v| v.to_str().ok())
8461        .unwrap_or("application/octet-stream");
8462    let content_type = super::ContentType::from(content_type);
8463
8464    if !status.is_client_error() && !status.is_server_error() {
8465        let content = resp.text().await?;
8466        match content_type {
8467            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8468            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
8469            ContentType::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`")))),
8470        }
8471    } else {
8472        let content = resp.text().await?;
8473        let entity: Option<PatchEntityTypeWithIdError> = serde_json::from_str(&content).ok();
8474        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8475    }
8476}
8477
8478/// Updates, via PATCH, the Entity with the given Id.
8479pub 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>> {
8480    // add a prefix to parameters to efficiently prevent name collisions
8481    let p_path_entity_id = entity_id;
8482    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8483    let p_body_entity_request = entity_request;
8484
8485    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
8486    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8487
8488    if let Some(ref user_agent) = configuration.user_agent {
8489        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8490    }
8491    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8492        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8493    }
8494    if let Some(ref apikey) = configuration.api_key {
8495        let key = apikey.key.clone();
8496        let value = match apikey.prefix {
8497            Some(ref prefix) => format!("{} {}", prefix, key),
8498            None => key,
8499        };
8500        req_builder = req_builder.header("Authorization", value);
8501    };
8502    req_builder = req_builder.json(&p_body_entity_request);
8503
8504    let req = req_builder.build()?;
8505    let resp = configuration.client.execute(req).await?;
8506
8507    let status = resp.status();
8508    let content_type = resp
8509        .headers()
8510        .get("content-type")
8511        .and_then(|v| v.to_str().ok())
8512        .unwrap_or("application/octet-stream");
8513    let content_type = super::ContentType::from(content_type);
8514
8515    if !status.is_client_error() && !status.is_server_error() {
8516        let content = resp.text().await?;
8517        match content_type {
8518            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8519            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
8520            ContentType::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`")))),
8521        }
8522    } else {
8523        let content = resp.text().await?;
8524        let entity: Option<PatchEntityWithIdError> = serde_json::from_str(&content).ok();
8525        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8526    }
8527}
8528
8529/// Patches the form field with the given Id.
8530pub async fn patch_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<PatchFormFieldWithIdError>> {
8531    // add a prefix to parameters to efficiently prevent name collisions
8532    let p_path_field_id = field_id;
8533    let p_body_form_field_request = form_field_request;
8534
8535    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
8536    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8537
8538    if let Some(ref user_agent) = configuration.user_agent {
8539        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8540    }
8541    if let Some(ref apikey) = configuration.api_key {
8542        let key = apikey.key.clone();
8543        let value = match apikey.prefix {
8544            Some(ref prefix) => format!("{} {}", prefix, key),
8545            None => key,
8546        };
8547        req_builder = req_builder.header("Authorization", value);
8548    };
8549    req_builder = req_builder.json(&p_body_form_field_request);
8550
8551    let req = req_builder.build()?;
8552    let resp = configuration.client.execute(req).await?;
8553
8554    let status = resp.status();
8555    let content_type = resp
8556        .headers()
8557        .get("content-type")
8558        .and_then(|v| v.to_str().ok())
8559        .unwrap_or("application/octet-stream");
8560    let content_type = super::ContentType::from(content_type);
8561
8562    if !status.is_client_error() && !status.is_server_error() {
8563        let content = resp.text().await?;
8564        match content_type {
8565            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8566            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
8567            ContentType::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`")))),
8568        }
8569    } else {
8570        let content = resp.text().await?;
8571        let entity: Option<PatchFormFieldWithIdError> = serde_json::from_str(&content).ok();
8572        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8573    }
8574}
8575
8576/// Patches the form with the given Id.
8577pub async fn patch_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<PatchFormWithIdError>> {
8578    // add a prefix to parameters to efficiently prevent name collisions
8579    let p_path_form_id = form_id;
8580    let p_body_form_request = form_request;
8581
8582    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
8583    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8584
8585    if let Some(ref user_agent) = configuration.user_agent {
8586        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8587    }
8588    if let Some(ref apikey) = configuration.api_key {
8589        let key = apikey.key.clone();
8590        let value = match apikey.prefix {
8591            Some(ref prefix) => format!("{} {}", prefix, key),
8592            None => key,
8593        };
8594        req_builder = req_builder.header("Authorization", value);
8595    };
8596    req_builder = req_builder.json(&p_body_form_request);
8597
8598    let req = req_builder.build()?;
8599    let resp = configuration.client.execute(req).await?;
8600
8601    let status = resp.status();
8602    let content_type = resp
8603        .headers()
8604        .get("content-type")
8605        .and_then(|v| v.to_str().ok())
8606        .unwrap_or("application/octet-stream");
8607    let content_type = super::ContentType::from(content_type);
8608
8609    if !status.is_client_error() && !status.is_server_error() {
8610        let content = resp.text().await?;
8611        match content_type {
8612            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8613            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
8614            ContentType::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`")))),
8615        }
8616    } else {
8617        let content = resp.text().await?;
8618        let entity: Option<PatchFormWithIdError> = serde_json::from_str(&content).ok();
8619        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8620    }
8621}
8622
8623/// Updates, via PATCH, the group with the given Id.
8624pub 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>> {
8625    // add a prefix to parameters to efficiently prevent name collisions
8626    let p_path_group_id = group_id;
8627    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8628    let p_body_group_request = group_request;
8629
8630    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
8631    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8632
8633    if let Some(ref user_agent) = configuration.user_agent {
8634        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8635    }
8636    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8637        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8638    }
8639    if let Some(ref apikey) = configuration.api_key {
8640        let key = apikey.key.clone();
8641        let value = match apikey.prefix {
8642            Some(ref prefix) => format!("{} {}", prefix, key),
8643            None => key,
8644        };
8645        req_builder = req_builder.header("Authorization", value);
8646    };
8647    req_builder = req_builder.json(&p_body_group_request);
8648
8649    let req = req_builder.build()?;
8650    let resp = configuration.client.execute(req).await?;
8651
8652    let status = resp.status();
8653    let content_type = resp
8654        .headers()
8655        .get("content-type")
8656        .and_then(|v| v.to_str().ok())
8657        .unwrap_or("application/octet-stream");
8658    let content_type = super::ContentType::from(content_type);
8659
8660    if !status.is_client_error() && !status.is_server_error() {
8661        let content = resp.text().await?;
8662        match content_type {
8663            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8664            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
8665            ContentType::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`")))),
8666        }
8667    } else {
8668        let content = resp.text().await?;
8669        let entity: Option<PatchGroupWithIdError> = serde_json::from_str(&content).ok();
8670        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8671    }
8672}
8673
8674/// Updates, via PATCH, the identity provider with the given Id.
8675pub 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>> {
8676    // add a prefix to parameters to efficiently prevent name collisions
8677    let p_path_identity_provider_id = identity_provider_id;
8678    let p_body_identity_provider_request = identity_provider_request;
8679
8680    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
8681    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8682
8683    if let Some(ref user_agent) = configuration.user_agent {
8684        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8685    }
8686    if let Some(ref apikey) = configuration.api_key {
8687        let key = apikey.key.clone();
8688        let value = match apikey.prefix {
8689            Some(ref prefix) => format!("{} {}", prefix, key),
8690            None => key,
8691        };
8692        req_builder = req_builder.header("Authorization", value);
8693    };
8694    req_builder = req_builder.json(&p_body_identity_provider_request);
8695
8696    let req = req_builder.build()?;
8697    let resp = configuration.client.execute(req).await?;
8698
8699    let status = resp.status();
8700    let content_type = resp
8701        .headers()
8702        .get("content-type")
8703        .and_then(|v| v.to_str().ok())
8704        .unwrap_or("application/octet-stream");
8705    let content_type = super::ContentType::from(content_type);
8706
8707    if !status.is_client_error() && !status.is_server_error() {
8708        let content = resp.text().await?;
8709        match content_type {
8710            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8711            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
8712            ContentType::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`")))),
8713        }
8714    } else {
8715        let content = resp.text().await?;
8716        let entity: Option<PatchIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
8717        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8718    }
8719}
8720
8721/// Updates, via PATCH, the available integrations.
8722pub async fn patch_integrations_with_id(configuration: &configuration::Configuration, integration_request: Option<models::IntegrationRequest>) -> Result<models::IntegrationResponse, Error<PatchIntegrationsWithIdError>> {
8723    // add a prefix to parameters to efficiently prevent name collisions
8724    let p_body_integration_request = integration_request;
8725
8726    let uri_str = format!("{}/api/integration", configuration.base_path);
8727    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8728
8729    if let Some(ref user_agent) = configuration.user_agent {
8730        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8731    }
8732    if let Some(ref apikey) = configuration.api_key {
8733        let key = apikey.key.clone();
8734        let value = match apikey.prefix {
8735            Some(ref prefix) => format!("{} {}", prefix, key),
8736            None => key,
8737        };
8738        req_builder = req_builder.header("Authorization", value);
8739    };
8740    req_builder = req_builder.json(&p_body_integration_request);
8741
8742    let req = req_builder.build()?;
8743    let resp = configuration.client.execute(req).await?;
8744
8745    let status = resp.status();
8746    let content_type = resp
8747        .headers()
8748        .get("content-type")
8749        .and_then(|v| v.to_str().ok())
8750        .unwrap_or("application/octet-stream");
8751    let content_type = super::ContentType::from(content_type);
8752
8753    if !status.is_client_error() && !status.is_server_error() {
8754        let content = resp.text().await?;
8755        match content_type {
8756            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8757            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationResponse`"))),
8758            ContentType::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`")))),
8759        }
8760    } else {
8761        let content = resp.text().await?;
8762        let entity: Option<PatchIntegrationsWithIdError> = serde_json::from_str(&content).ok();
8763        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8764    }
8765}
8766
8767/// Update the IP Access Control List with the given Id.
8768pub 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>> {
8769    // add a prefix to parameters to efficiently prevent name collisions
8770    let p_path_access_control_list_id = access_control_list_id;
8771    let p_body_ip_access_control_list_request = ip_access_control_list_request;
8772
8773    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_path_access_control_list_id));
8774    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8775
8776    if let Some(ref user_agent) = configuration.user_agent {
8777        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8778    }
8779    if let Some(ref apikey) = configuration.api_key {
8780        let key = apikey.key.clone();
8781        let value = match apikey.prefix {
8782            Some(ref prefix) => format!("{} {}", prefix, key),
8783            None => key,
8784        };
8785        req_builder = req_builder.header("Authorization", value);
8786    };
8787    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
8788
8789    let req = req_builder.build()?;
8790    let resp = configuration.client.execute(req).await?;
8791
8792    let status = resp.status();
8793    let content_type = resp
8794        .headers()
8795        .get("content-type")
8796        .and_then(|v| v.to_str().ok())
8797        .unwrap_or("application/octet-stream");
8798    let content_type = super::ContentType::from(content_type);
8799
8800    if !status.is_client_error() && !status.is_server_error() {
8801        let content = resp.text().await?;
8802        match content_type {
8803            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8804            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
8805            ContentType::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`")))),
8806        }
8807    } else {
8808        let content = resp.text().await?;
8809        let entity: Option<PatchIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
8810        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8811    }
8812}
8813
8814/// Updates, via PATCH, the lambda with the given Id.
8815pub async fn patch_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<PatchLambdaWithIdError>> {
8816    // add a prefix to parameters to efficiently prevent name collisions
8817    let p_path_lambda_id = lambda_id;
8818    let p_body_lambda_request = lambda_request;
8819
8820    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
8821    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8822
8823    if let Some(ref user_agent) = configuration.user_agent {
8824        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8825    }
8826    if let Some(ref apikey) = configuration.api_key {
8827        let key = apikey.key.clone();
8828        let value = match apikey.prefix {
8829            Some(ref prefix) => format!("{} {}", prefix, key),
8830            None => key,
8831        };
8832        req_builder = req_builder.header("Authorization", value);
8833    };
8834    req_builder = req_builder.json(&p_body_lambda_request);
8835
8836    let req = req_builder.build()?;
8837    let resp = configuration.client.execute(req).await?;
8838
8839    let status = resp.status();
8840    let content_type = resp
8841        .headers()
8842        .get("content-type")
8843        .and_then(|v| v.to_str().ok())
8844        .unwrap_or("application/octet-stream");
8845    let content_type = super::ContentType::from(content_type);
8846
8847    if !status.is_client_error() && !status.is_server_error() {
8848        let content = resp.text().await?;
8849        match content_type {
8850            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8851            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
8852            ContentType::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`")))),
8853        }
8854    } else {
8855        let content = resp.text().await?;
8856        let entity: Option<PatchLambdaWithIdError> = serde_json::from_str(&content).ok();
8857        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8858    }
8859}
8860
8861/// Updates, via PATCH, the message template with the given Id.
8862pub 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>> {
8863    // add a prefix to parameters to efficiently prevent name collisions
8864    let p_path_message_template_id = message_template_id;
8865    let p_body_message_template_request = message_template_request;
8866
8867    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
8868    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8869
8870    if let Some(ref user_agent) = configuration.user_agent {
8871        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8872    }
8873    if let Some(ref apikey) = configuration.api_key {
8874        let key = apikey.key.clone();
8875        let value = match apikey.prefix {
8876            Some(ref prefix) => format!("{} {}", prefix, key),
8877            None => key,
8878        };
8879        req_builder = req_builder.header("Authorization", value);
8880    };
8881    req_builder = req_builder.json(&p_body_message_template_request);
8882
8883    let req = req_builder.build()?;
8884    let resp = configuration.client.execute(req).await?;
8885
8886    let status = resp.status();
8887    let content_type = resp
8888        .headers()
8889        .get("content-type")
8890        .and_then(|v| v.to_str().ok())
8891        .unwrap_or("application/octet-stream");
8892    let content_type = super::ContentType::from(content_type);
8893
8894    if !status.is_client_error() && !status.is_server_error() {
8895        let content = resp.text().await?;
8896        match content_type {
8897            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8898            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
8899            ContentType::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`")))),
8900        }
8901    } else {
8902        let content = resp.text().await?;
8903        let entity: Option<PatchMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
8904        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8905    }
8906}
8907
8908/// Updates, via PATCH, the messenger with the given Id.
8909pub async fn patch_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<PatchMessengerWithIdError>> {
8910    // add a prefix to parameters to efficiently prevent name collisions
8911    let p_path_messenger_id = messenger_id;
8912    let p_body_messenger_request = messenger_request;
8913
8914    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
8915    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8916
8917    if let Some(ref user_agent) = configuration.user_agent {
8918        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8919    }
8920    if let Some(ref apikey) = configuration.api_key {
8921        let key = apikey.key.clone();
8922        let value = match apikey.prefix {
8923            Some(ref prefix) => format!("{} {}", prefix, key),
8924            None => key,
8925        };
8926        req_builder = req_builder.header("Authorization", value);
8927    };
8928    req_builder = req_builder.json(&p_body_messenger_request);
8929
8930    let req = req_builder.build()?;
8931    let resp = configuration.client.execute(req).await?;
8932
8933    let status = resp.status();
8934    let content_type = resp
8935        .headers()
8936        .get("content-type")
8937        .and_then(|v| v.to_str().ok())
8938        .unwrap_or("application/octet-stream");
8939    let content_type = super::ContentType::from(content_type);
8940
8941    if !status.is_client_error() && !status.is_server_error() {
8942        let content = resp.text().await?;
8943        match content_type {
8944            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8945            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
8946            ContentType::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`")))),
8947        }
8948    } else {
8949        let content = resp.text().await?;
8950        let entity: Option<PatchMessengerWithIdError> = serde_json::from_str(&content).ok();
8951        Err(Error::ResponseError(ResponseContent { status, content, entity }))
8952    }
8953}
8954
8955/// Updates, via PATCH, the custom OAuth scope with the given Id for the application.
8956pub 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>> {
8957    // add a prefix to parameters to efficiently prevent name collisions
8958    let p_path_application_id = application_id;
8959    let p_path_scope_id = scope_id;
8960    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
8961    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
8962
8963    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));
8964    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8965
8966    if let Some(ref user_agent) = configuration.user_agent {
8967        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8968    }
8969    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
8970        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
8971    }
8972    if let Some(ref apikey) = configuration.api_key {
8973        let key = apikey.key.clone();
8974        let value = match apikey.prefix {
8975            Some(ref prefix) => format!("{} {}", prefix, key),
8976            None => key,
8977        };
8978        req_builder = req_builder.header("Authorization", value);
8979    };
8980    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
8981
8982    let req = req_builder.build()?;
8983    let resp = configuration.client.execute(req).await?;
8984
8985    let status = resp.status();
8986    let content_type = resp
8987        .headers()
8988        .get("content-type")
8989        .and_then(|v| v.to_str().ok())
8990        .unwrap_or("application/octet-stream");
8991    let content_type = super::ContentType::from(content_type);
8992
8993    if !status.is_client_error() && !status.is_server_error() {
8994        let content = resp.text().await?;
8995        match content_type {
8996            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8997            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
8998            ContentType::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`")))),
8999        }
9000    } else {
9001        let content = resp.text().await?;
9002        let entity: Option<PatchOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
9003        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9004    }
9005}
9006
9007/// Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
9008pub 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>> {
9009    // add a prefix to parameters to efficiently prevent name collisions
9010    let p_path_user_id = user_id;
9011    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9012    let p_body_registration_request = registration_request;
9013
9014    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
9015    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9016
9017    if let Some(ref user_agent) = configuration.user_agent {
9018        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9019    }
9020    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9021        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9022    }
9023    if let Some(ref apikey) = configuration.api_key {
9024        let key = apikey.key.clone();
9025        let value = match apikey.prefix {
9026            Some(ref prefix) => format!("{} {}", prefix, key),
9027            None => key,
9028        };
9029        req_builder = req_builder.header("Authorization", value);
9030    };
9031    req_builder = req_builder.json(&p_body_registration_request);
9032
9033    let req = req_builder.build()?;
9034    let resp = configuration.client.execute(req).await?;
9035
9036    let status = resp.status();
9037    let content_type = resp
9038        .headers()
9039        .get("content-type")
9040        .and_then(|v| v.to_str().ok())
9041        .unwrap_or("application/octet-stream");
9042    let content_type = super::ContentType::from(content_type);
9043
9044    if !status.is_client_error() && !status.is_server_error() {
9045        let content = resp.text().await?;
9046        match content_type {
9047            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9048            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9049            ContentType::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`")))),
9050        }
9051    } else {
9052        let content = resp.text().await?;
9053        let entity: Option<PatchRegistrationWithIdError> = serde_json::from_str(&content).ok();
9054        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9055    }
9056}
9057
9058/// Updates, via PATCH, the system configuration.
9059pub async fn patch_system_configuration_with_id(configuration: &configuration::Configuration, system_configuration_request: Option<models::SystemConfigurationRequest>) -> Result<models::SystemConfigurationResponse, Error<PatchSystemConfigurationWithIdError>> {
9060    // add a prefix to parameters to efficiently prevent name collisions
9061    let p_body_system_configuration_request = system_configuration_request;
9062
9063    let uri_str = format!("{}/api/system-configuration", configuration.base_path);
9064    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9065
9066    if let Some(ref user_agent) = configuration.user_agent {
9067        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9068    }
9069    if let Some(ref apikey) = configuration.api_key {
9070        let key = apikey.key.clone();
9071        let value = match apikey.prefix {
9072            Some(ref prefix) => format!("{} {}", prefix, key),
9073            None => key,
9074        };
9075        req_builder = req_builder.header("Authorization", value);
9076    };
9077    req_builder = req_builder.json(&p_body_system_configuration_request);
9078
9079    let req = req_builder.build()?;
9080    let resp = configuration.client.execute(req).await?;
9081
9082    let status = resp.status();
9083    let content_type = resp
9084        .headers()
9085        .get("content-type")
9086        .and_then(|v| v.to_str().ok())
9087        .unwrap_or("application/octet-stream");
9088    let content_type = super::ContentType::from(content_type);
9089
9090    if !status.is_client_error() && !status.is_server_error() {
9091        let content = resp.text().await?;
9092        match content_type {
9093            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9094            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SystemConfigurationResponse`"))),
9095            ContentType::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`")))),
9096        }
9097    } else {
9098        let content = resp.text().await?;
9099        let entity: Option<PatchSystemConfigurationWithIdError> = serde_json::from_str(&content).ok();
9100        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9101    }
9102}
9103
9104/// Updates, via PATCH, the tenant with the given Id.
9105pub 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>> {
9106    // add a prefix to parameters to efficiently prevent name collisions
9107    let p_path_tenant_id = tenant_id;
9108    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9109    let p_body_tenant_request = tenant_request;
9110
9111    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
9112    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9113
9114    if let Some(ref user_agent) = configuration.user_agent {
9115        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9116    }
9117    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9118        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9119    }
9120    if let Some(ref apikey) = configuration.api_key {
9121        let key = apikey.key.clone();
9122        let value = match apikey.prefix {
9123            Some(ref prefix) => format!("{} {}", prefix, key),
9124            None => key,
9125        };
9126        req_builder = req_builder.header("Authorization", value);
9127    };
9128    req_builder = req_builder.json(&p_body_tenant_request);
9129
9130    let req = req_builder.build()?;
9131    let resp = configuration.client.execute(req).await?;
9132
9133    let status = resp.status();
9134    let content_type = resp
9135        .headers()
9136        .get("content-type")
9137        .and_then(|v| v.to_str().ok())
9138        .unwrap_or("application/octet-stream");
9139    let content_type = super::ContentType::from(content_type);
9140
9141    if !status.is_client_error() && !status.is_server_error() {
9142        let content = resp.text().await?;
9143        match content_type {
9144            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9145            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
9146            ContentType::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`")))),
9147        }
9148    } else {
9149        let content = resp.text().await?;
9150        let entity: Option<PatchTenantWithIdError> = serde_json::from_str(&content).ok();
9151        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9152    }
9153}
9154
9155/// Updates, via PATCH, the theme with the given Id.
9156pub async fn patch_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<PatchThemeWithIdError>> {
9157    // add a prefix to parameters to efficiently prevent name collisions
9158    let p_path_theme_id = theme_id;
9159    let p_body_theme_request = theme_request;
9160
9161    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
9162    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9163
9164    if let Some(ref user_agent) = configuration.user_agent {
9165        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9166    }
9167    if let Some(ref apikey) = configuration.api_key {
9168        let key = apikey.key.clone();
9169        let value = match apikey.prefix {
9170            Some(ref prefix) => format!("{} {}", prefix, key),
9171            None => key,
9172        };
9173        req_builder = req_builder.header("Authorization", value);
9174    };
9175    req_builder = req_builder.json(&p_body_theme_request);
9176
9177    let req = req_builder.build()?;
9178    let resp = configuration.client.execute(req).await?;
9179
9180    let status = resp.status();
9181    let content_type = resp
9182        .headers()
9183        .get("content-type")
9184        .and_then(|v| v.to_str().ok())
9185        .unwrap_or("application/octet-stream");
9186    let content_type = super::ContentType::from(content_type);
9187
9188    if !status.is_client_error() && !status.is_server_error() {
9189        let content = resp.text().await?;
9190        match content_type {
9191            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9192            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
9193            ContentType::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`")))),
9194        }
9195    } else {
9196        let content = resp.text().await?;
9197        let entity: Option<PatchThemeWithIdError> = serde_json::from_str(&content).ok();
9198        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9199    }
9200}
9201
9202/// Updates, via PATCH, the user action reason with the given Id.
9203pub 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>> {
9204    // add a prefix to parameters to efficiently prevent name collisions
9205    let p_path_user_action_reason_id = user_action_reason_id;
9206    let p_body_user_action_reason_request = user_action_reason_request;
9207
9208    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
9209    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9210
9211    if let Some(ref user_agent) = configuration.user_agent {
9212        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9213    }
9214    if let Some(ref apikey) = configuration.api_key {
9215        let key = apikey.key.clone();
9216        let value = match apikey.prefix {
9217            Some(ref prefix) => format!("{} {}", prefix, key),
9218            None => key,
9219        };
9220        req_builder = req_builder.header("Authorization", value);
9221    };
9222    req_builder = req_builder.json(&p_body_user_action_reason_request);
9223
9224    let req = req_builder.build()?;
9225    let resp = configuration.client.execute(req).await?;
9226
9227    let status = resp.status();
9228    let content_type = resp
9229        .headers()
9230        .get("content-type")
9231        .and_then(|v| v.to_str().ok())
9232        .unwrap_or("application/octet-stream");
9233    let content_type = super::ContentType::from(content_type);
9234
9235    if !status.is_client_error() && !status.is_server_error() {
9236        let content = resp.text().await?;
9237        match content_type {
9238            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9239            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
9240            ContentType::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`")))),
9241        }
9242    } else {
9243        let content = resp.text().await?;
9244        let entity: Option<PatchUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
9245        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9246    }
9247}
9248
9249/// Updates, via PATCH, the user action with the given Id.
9250pub 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>> {
9251    // add a prefix to parameters to efficiently prevent name collisions
9252    let p_path_user_action_id = user_action_id;
9253    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9254    let p_body_user_action_request = user_action_request;
9255
9256    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
9257    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9258
9259    if let Some(ref user_agent) = configuration.user_agent {
9260        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9261    }
9262    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9263        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9264    }
9265    if let Some(ref apikey) = configuration.api_key {
9266        let key = apikey.key.clone();
9267        let value = match apikey.prefix {
9268            Some(ref prefix) => format!("{} {}", prefix, key),
9269            None => key,
9270        };
9271        req_builder = req_builder.header("Authorization", value);
9272    };
9273    req_builder = req_builder.json(&p_body_user_action_request);
9274
9275    let req = req_builder.build()?;
9276    let resp = configuration.client.execute(req).await?;
9277
9278    let status = resp.status();
9279    let content_type = resp
9280        .headers()
9281        .get("content-type")
9282        .and_then(|v| v.to_str().ok())
9283        .unwrap_or("application/octet-stream");
9284    let content_type = super::ContentType::from(content_type);
9285
9286    if !status.is_client_error() && !status.is_server_error() {
9287        let content = resp.text().await?;
9288        match content_type {
9289            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9290            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
9291            ContentType::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`")))),
9292        }
9293    } else {
9294        let content = resp.text().await?;
9295        let entity: Option<PatchUserActionWithIdError> = serde_json::from_str(&content).ok();
9296        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9297    }
9298}
9299
9300/// Updates, via PATCH, a single User consent by Id.
9301pub 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>> {
9302    // add a prefix to parameters to efficiently prevent name collisions
9303    let p_path_user_consent_id = user_consent_id;
9304    let p_body_user_consent_request = user_consent_request;
9305
9306    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
9307    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9308
9309    if let Some(ref user_agent) = configuration.user_agent {
9310        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9311    }
9312    if let Some(ref apikey) = configuration.api_key {
9313        let key = apikey.key.clone();
9314        let value = match apikey.prefix {
9315            Some(ref prefix) => format!("{} {}", prefix, key),
9316            None => key,
9317        };
9318        req_builder = req_builder.header("Authorization", value);
9319    };
9320    req_builder = req_builder.json(&p_body_user_consent_request);
9321
9322    let req = req_builder.build()?;
9323    let resp = configuration.client.execute(req).await?;
9324
9325    let status = resp.status();
9326    let content_type = resp
9327        .headers()
9328        .get("content-type")
9329        .and_then(|v| v.to_str().ok())
9330        .unwrap_or("application/octet-stream");
9331    let content_type = super::ContentType::from(content_type);
9332
9333    if !status.is_client_error() && !status.is_server_error() {
9334        let content = resp.text().await?;
9335        match content_type {
9336            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9337            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
9338            ContentType::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`")))),
9339        }
9340    } else {
9341        let content = resp.text().await?;
9342        let entity: Option<PatchUserConsentWithIdError> = serde_json::from_str(&content).ok();
9343        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9344    }
9345}
9346
9347/// Updates, via PATCH, the user with the given Id.
9348pub 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>> {
9349    // add a prefix to parameters to efficiently prevent name collisions
9350    let p_path_user_id = user_id;
9351    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9352    let p_body_user_request = user_request;
9353
9354    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
9355    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9356
9357    if let Some(ref user_agent) = configuration.user_agent {
9358        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9359    }
9360    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9361        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9362    }
9363    if let Some(ref apikey) = configuration.api_key {
9364        let key = apikey.key.clone();
9365        let value = match apikey.prefix {
9366            Some(ref prefix) => format!("{} {}", prefix, key),
9367            None => key,
9368        };
9369        req_builder = req_builder.header("Authorization", value);
9370    };
9371    req_builder = req_builder.json(&p_body_user_request);
9372
9373    let req = req_builder.build()?;
9374    let resp = configuration.client.execute(req).await?;
9375
9376    let status = resp.status();
9377    let content_type = resp
9378        .headers()
9379        .get("content-type")
9380        .and_then(|v| v.to_str().ok())
9381        .unwrap_or("application/octet-stream");
9382    let content_type = super::ContentType::from(content_type);
9383
9384    if !status.is_client_error() && !status.is_server_error() {
9385        let content = resp.text().await?;
9386        match content_type {
9387            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9388            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
9389            ContentType::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`")))),
9390        }
9391    } else {
9392        let content = resp.text().await?;
9393        let entity: Option<PatchUserWithIdError> = serde_json::from_str(&content).ok();
9394        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9395    }
9396}
9397
9398/// Patches the webhook with the given Id.
9399pub async fn patch_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<PatchWebhookWithIdError>> {
9400    // add a prefix to parameters to efficiently prevent name collisions
9401    let p_path_webhook_id = webhook_id;
9402    let p_body_webhook_request = webhook_request;
9403
9404    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
9405    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9406
9407    if let Some(ref user_agent) = configuration.user_agent {
9408        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9409    }
9410    if let Some(ref apikey) = configuration.api_key {
9411        let key = apikey.key.clone();
9412        let value = match apikey.prefix {
9413            Some(ref prefix) => format!("{} {}", prefix, key),
9414            None => key,
9415        };
9416        req_builder = req_builder.header("Authorization", value);
9417    };
9418    req_builder = req_builder.json(&p_body_webhook_request);
9419
9420    let req = req_builder.build()?;
9421    let resp = configuration.client.execute(req).await?;
9422
9423    let status = resp.status();
9424    let content_type = resp
9425        .headers()
9426        .get("content-type")
9427        .and_then(|v| v.to_str().ok())
9428        .unwrap_or("application/octet-stream");
9429    let content_type = super::ContentType::from(content_type);
9430
9431    if !status.is_client_error() && !status.is_server_error() {
9432        let content = resp.text().await?;
9433        match content_type {
9434            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9435            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
9436            ContentType::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`")))),
9437        }
9438    } else {
9439        let content = resp.text().await?;
9440        let entity: Option<PatchWebhookWithIdError> = serde_json::from_str(&content).ok();
9441        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9442    }
9443}
9444
9445/// Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
9446pub async fn reconcile_jwt_with_id(configuration: &configuration::Configuration, identity_provider_login_request: Option<models::IdentityProviderLoginRequest>) -> Result<models::LoginResponse, Error<ReconcileJwtWithIdError>> {
9447    // add a prefix to parameters to efficiently prevent name collisions
9448    let p_body_identity_provider_login_request = identity_provider_login_request;
9449
9450    let uri_str = format!("{}/api/jwt/reconcile", configuration.base_path);
9451    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9452
9453    if let Some(ref user_agent) = configuration.user_agent {
9454        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9455    }
9456    if let Some(ref apikey) = configuration.api_key {
9457        let key = apikey.key.clone();
9458        let value = match apikey.prefix {
9459            Some(ref prefix) => format!("{} {}", prefix, key),
9460            None => key,
9461        };
9462        req_builder = req_builder.header("Authorization", value);
9463    };
9464    req_builder = req_builder.json(&p_body_identity_provider_login_request);
9465
9466    let req = req_builder.build()?;
9467    let resp = configuration.client.execute(req).await?;
9468
9469    let status = resp.status();
9470    let content_type = resp
9471        .headers()
9472        .get("content-type")
9473        .and_then(|v| v.to_str().ok())
9474        .unwrap_or("application/octet-stream");
9475    let content_type = super::ContentType::from(content_type);
9476
9477    if !status.is_client_error() && !status.is_server_error() {
9478        let content = resp.text().await?;
9479        match content_type {
9480            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9481            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
9482            ContentType::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`")))),
9483        }
9484    } else {
9485        let content = resp.text().await?;
9486        let entity: Option<ReconcileJwtWithIdError> = serde_json::from_str(&content).ok();
9487        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9488    }
9489}
9490
9491/// 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.
9492pub async fn register(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, registration_request: Option<models::RegistrationRequest>) -> Result<models::RegistrationResponse, Error<RegisterError>> {
9493    // add a prefix to parameters to efficiently prevent name collisions
9494    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9495    let p_body_registration_request = registration_request;
9496
9497    let uri_str = format!("{}/api/user/registration", configuration.base_path);
9498    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9499
9500    if let Some(ref user_agent) = configuration.user_agent {
9501        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9502    }
9503    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9504        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9505    }
9506    if let Some(ref apikey) = configuration.api_key {
9507        let key = apikey.key.clone();
9508        let value = match apikey.prefix {
9509            Some(ref prefix) => format!("{} {}", prefix, key),
9510            None => key,
9511        };
9512        req_builder = req_builder.header("Authorization", value);
9513    };
9514    req_builder = req_builder.json(&p_body_registration_request);
9515
9516    let req = req_builder.build()?;
9517    let resp = configuration.client.execute(req).await?;
9518
9519    let status = resp.status();
9520    let content_type = resp
9521        .headers()
9522        .get("content-type")
9523        .and_then(|v| v.to_str().ok())
9524        .unwrap_or("application/octet-stream");
9525    let content_type = super::ContentType::from(content_type);
9526
9527    if !status.is_client_error() && !status.is_server_error() {
9528        let content = resp.text().await?;
9529        match content_type {
9530            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9531            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9532            ContentType::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`")))),
9533        }
9534    } else {
9535        let content = resp.text().await?;
9536        let entity: Option<RegisterError> = serde_json::from_str(&content).ok();
9537        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9538    }
9539}
9540
9541/// 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.
9542pub 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>> {
9543    // add a prefix to parameters to efficiently prevent name collisions
9544    let p_path_user_id = user_id;
9545    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9546    let p_body_registration_request = registration_request;
9547
9548    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
9549    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9550
9551    if let Some(ref user_agent) = configuration.user_agent {
9552        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9553    }
9554    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9555        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9556    }
9557    if let Some(ref apikey) = configuration.api_key {
9558        let key = apikey.key.clone();
9559        let value = match apikey.prefix {
9560            Some(ref prefix) => format!("{} {}", prefix, key),
9561            None => key,
9562        };
9563        req_builder = req_builder.header("Authorization", value);
9564    };
9565    req_builder = req_builder.json(&p_body_registration_request);
9566
9567    let req = req_builder.build()?;
9568    let resp = configuration.client.execute(req).await?;
9569
9570    let status = resp.status();
9571    let content_type = resp
9572        .headers()
9573        .get("content-type")
9574        .and_then(|v| v.to_str().ok())
9575        .unwrap_or("application/octet-stream");
9576    let content_type = super::ContentType::from(content_type);
9577
9578    if !status.is_client_error() && !status.is_server_error() {
9579        let content = resp.text().await?;
9580        match content_type {
9581            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9582            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
9583            ContentType::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`")))),
9584        }
9585    } else {
9586        let content = resp.text().await?;
9587        let entity: Option<RegisterWithIdError> = serde_json::from_str(&content).ok();
9588        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9589    }
9590}
9591
9592/// 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.
9593pub async fn reindex_with_id(configuration: &configuration::Configuration, reindex_request: Option<models::ReindexRequest>) -> Result<(), Error<ReindexWithIdError>> {
9594    // add a prefix to parameters to efficiently prevent name collisions
9595    let p_body_reindex_request = reindex_request;
9596
9597    let uri_str = format!("{}/api/system/reindex", configuration.base_path);
9598    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9599
9600    if let Some(ref user_agent) = configuration.user_agent {
9601        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9602    }
9603    if let Some(ref apikey) = configuration.api_key {
9604        let key = apikey.key.clone();
9605        let value = match apikey.prefix {
9606            Some(ref prefix) => format!("{} {}", prefix, key),
9607            None => key,
9608        };
9609        req_builder = req_builder.header("Authorization", value);
9610    };
9611    req_builder = req_builder.json(&p_body_reindex_request);
9612
9613    let req = req_builder.build()?;
9614    let resp = configuration.client.execute(req).await?;
9615
9616    let status = resp.status();
9617
9618    if !status.is_client_error() && !status.is_server_error() {
9619        Ok(())
9620    } else {
9621        let content = resp.text().await?;
9622        let entity: Option<ReindexWithIdError> = serde_json::from_str(&content).ok();
9623        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9624    }
9625}
9626
9627/// Removes a user from the family with the given Id.
9628pub 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>> {
9629    // add a prefix to parameters to efficiently prevent name collisions
9630    let p_path_family_id = family_id;
9631    let p_path_user_id = user_id;
9632    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9633
9634    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));
9635    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9636
9637    if let Some(ref user_agent) = configuration.user_agent {
9638        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9639    }
9640    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9641        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9642    }
9643    if let Some(ref apikey) = configuration.api_key {
9644        let key = apikey.key.clone();
9645        let value = match apikey.prefix {
9646            Some(ref prefix) => format!("{} {}", prefix, key),
9647            None => key,
9648        };
9649        req_builder = req_builder.header("Authorization", value);
9650    };
9651
9652    let req = req_builder.build()?;
9653    let resp = configuration.client.execute(req).await?;
9654
9655    let status = resp.status();
9656
9657    if !status.is_client_error() && !status.is_server_error() {
9658        Ok(())
9659    } else {
9660        let content = resp.text().await?;
9661        let entity: Option<RemoveUserFromFamilyWithIdError> = serde_json::from_str(&content).ok();
9662        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9663    }
9664}
9665
9666/// Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
9667pub async fn retrieve_action_with_id(configuration: &configuration::Configuration, action_id: &str) -> Result<models::ActionResponse, Error<RetrieveActionWithIdError>> {
9668    // add a prefix to parameters to efficiently prevent name collisions
9669    let p_path_action_id = action_id;
9670
9671    let uri_str = format!("{}/api/user/action/{actionId}", configuration.base_path, actionId=crate::apis::urlencode(p_path_action_id));
9672    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9673
9674    if let Some(ref user_agent) = configuration.user_agent {
9675        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9676    }
9677    if let Some(ref apikey) = configuration.api_key {
9678        let key = apikey.key.clone();
9679        let value = match apikey.prefix {
9680            Some(ref prefix) => format!("{} {}", prefix, key),
9681            None => key,
9682        };
9683        req_builder = req_builder.header("Authorization", value);
9684    };
9685
9686    let req = req_builder.build()?;
9687    let resp = configuration.client.execute(req).await?;
9688
9689    let status = resp.status();
9690    let content_type = resp
9691        .headers()
9692        .get("content-type")
9693        .and_then(|v| v.to_str().ok())
9694        .unwrap_or("application/octet-stream");
9695    let content_type = super::ContentType::from(content_type);
9696
9697    if !status.is_client_error() && !status.is_server_error() {
9698        let content = resp.text().await?;
9699        match content_type {
9700            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9701            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
9702            ContentType::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`")))),
9703        }
9704    } else {
9705        let content = resp.text().await?;
9706        let entity: Option<RetrieveActionWithIdError> = serde_json::from_str(&content).ok();
9707        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9708    }
9709}
9710
9711/// Retrieves an authentication API key for the given Id.
9712pub async fn retrieve_api_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<models::ApiKeyResponse, Error<RetrieveApiKeyWithIdError>> {
9713    // add a prefix to parameters to efficiently prevent name collisions
9714    let p_path_key_id = key_id;
9715
9716    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
9717    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9718
9719    if let Some(ref user_agent) = configuration.user_agent {
9720        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9721    }
9722    if let Some(ref apikey) = configuration.api_key {
9723        let key = apikey.key.clone();
9724        let value = match apikey.prefix {
9725            Some(ref prefix) => format!("{} {}", prefix, key),
9726            None => key,
9727        };
9728        req_builder = req_builder.header("Authorization", value);
9729    };
9730
9731    let req = req_builder.build()?;
9732    let resp = configuration.client.execute(req).await?;
9733
9734    let status = resp.status();
9735    let content_type = resp
9736        .headers()
9737        .get("content-type")
9738        .and_then(|v| v.to_str().ok())
9739        .unwrap_or("application/octet-stream");
9740    let content_type = super::ContentType::from(content_type);
9741
9742    if !status.is_client_error() && !status.is_server_error() {
9743        let content = resp.text().await?;
9744        match content_type {
9745            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9746            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
9747            ContentType::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`")))),
9748        }
9749    } else {
9750        let content = resp.text().await?;
9751        let entity: Option<RetrieveApiKeyWithIdError> = serde_json::from_str(&content).ok();
9752        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9753    }
9754}
9755
9756/// 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.
9757pub async fn retrieve_application(configuration: &configuration::Configuration, inactive: Option<&str>, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ApplicationResponse, Error<RetrieveApplicationError>> {
9758    // add a prefix to parameters to efficiently prevent name collisions
9759    let p_query_inactive = inactive;
9760    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9761
9762    let uri_str = format!("{}/api/application", configuration.base_path);
9763    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9764
9765    if let Some(ref param_value) = p_query_inactive {
9766        req_builder = req_builder.query(&[("inactive", &param_value.to_string())]);
9767    }
9768    if let Some(ref user_agent) = configuration.user_agent {
9769        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9770    }
9771    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9772        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9773    }
9774    if let Some(ref apikey) = configuration.api_key {
9775        let key = apikey.key.clone();
9776        let value = match apikey.prefix {
9777            Some(ref prefix) => format!("{} {}", prefix, key),
9778            None => key,
9779        };
9780        req_builder = req_builder.header("Authorization", value);
9781    };
9782
9783    let req = req_builder.build()?;
9784    let resp = configuration.client.execute(req).await?;
9785
9786    let status = resp.status();
9787    let content_type = resp
9788        .headers()
9789        .get("content-type")
9790        .and_then(|v| v.to_str().ok())
9791        .unwrap_or("application/octet-stream");
9792    let content_type = super::ContentType::from(content_type);
9793
9794    if !status.is_client_error() && !status.is_server_error() {
9795        let content = resp.text().await?;
9796        match content_type {
9797            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9798            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
9799            ContentType::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`")))),
9800        }
9801    } else {
9802        let content = resp.text().await?;
9803        let entity: Option<RetrieveApplicationError> = serde_json::from_str(&content).ok();
9804        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9805    }
9806}
9807
9808/// Retrieves the application for the given Id or all the applications if the Id is null.
9809pub async fn retrieve_application_with_id(configuration: &configuration::Configuration, application_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ApplicationResponse, Error<RetrieveApplicationWithIdError>> {
9810    // add a prefix to parameters to efficiently prevent name collisions
9811    let p_path_application_id = application_id;
9812    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9813
9814    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
9815    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9816
9817    if let Some(ref user_agent) = configuration.user_agent {
9818        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9819    }
9820    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9821        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9822    }
9823    if let Some(ref apikey) = configuration.api_key {
9824        let key = apikey.key.clone();
9825        let value = match apikey.prefix {
9826            Some(ref prefix) => format!("{} {}", prefix, key),
9827            None => key,
9828        };
9829        req_builder = req_builder.header("Authorization", value);
9830    };
9831
9832    let req = req_builder.build()?;
9833    let resp = configuration.client.execute(req).await?;
9834
9835    let status = resp.status();
9836    let content_type = resp
9837        .headers()
9838        .get("content-type")
9839        .and_then(|v| v.to_str().ok())
9840        .unwrap_or("application/octet-stream");
9841    let content_type = super::ContentType::from(content_type);
9842
9843    if !status.is_client_error() && !status.is_server_error() {
9844        let content = resp.text().await?;
9845        match content_type {
9846            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9847            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
9848            ContentType::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`")))),
9849        }
9850    } else {
9851        let content = resp.text().await?;
9852        let entity: Option<RetrieveApplicationWithIdError> = serde_json::from_str(&content).ok();
9853        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9854    }
9855}
9856
9857/// Retrieves a single audit log for the given Id.
9858pub async fn retrieve_audit_log_with_id(configuration: &configuration::Configuration, audit_log_id: &str) -> Result<models::AuditLogResponse, Error<RetrieveAuditLogWithIdError>> {
9859    // add a prefix to parameters to efficiently prevent name collisions
9860    let p_path_audit_log_id = audit_log_id;
9861
9862    let uri_str = format!("{}/api/system/audit-log/{auditLogId}", configuration.base_path, auditLogId=crate::apis::urlencode(p_path_audit_log_id));
9863    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9864
9865    if let Some(ref user_agent) = configuration.user_agent {
9866        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9867    }
9868    if let Some(ref apikey) = configuration.api_key {
9869        let key = apikey.key.clone();
9870        let value = match apikey.prefix {
9871            Some(ref prefix) => format!("{} {}", prefix, key),
9872            None => key,
9873        };
9874        req_builder = req_builder.header("Authorization", value);
9875    };
9876
9877    let req = req_builder.build()?;
9878    let resp = configuration.client.execute(req).await?;
9879
9880    let status = resp.status();
9881    let content_type = resp
9882        .headers()
9883        .get("content-type")
9884        .and_then(|v| v.to_str().ok())
9885        .unwrap_or("application/octet-stream");
9886    let content_type = super::ContentType::from(content_type);
9887
9888    if !status.is_client_error() && !status.is_server_error() {
9889        let content = resp.text().await?;
9890        match content_type {
9891            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9892            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogResponse`"))),
9893            ContentType::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`")))),
9894        }
9895    } else {
9896        let content = resp.text().await?;
9897        let entity: Option<RetrieveAuditLogWithIdError> = serde_json::from_str(&content).ok();
9898        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9899    }
9900}
9901
9902/// Retrieves the connector with the given Id.
9903pub async fn retrieve_connector_with_id(configuration: &configuration::Configuration, connector_id: &str) -> Result<models::ConnectorResponse, Error<RetrieveConnectorWithIdError>> {
9904    // add a prefix to parameters to efficiently prevent name collisions
9905    let p_path_connector_id = connector_id;
9906
9907    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
9908    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9909
9910    if let Some(ref user_agent) = configuration.user_agent {
9911        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9912    }
9913    if let Some(ref apikey) = configuration.api_key {
9914        let key = apikey.key.clone();
9915        let value = match apikey.prefix {
9916            Some(ref prefix) => format!("{} {}", prefix, key),
9917            None => key,
9918        };
9919        req_builder = req_builder.header("Authorization", value);
9920    };
9921
9922    let req = req_builder.build()?;
9923    let resp = configuration.client.execute(req).await?;
9924
9925    let status = resp.status();
9926    let content_type = resp
9927        .headers()
9928        .get("content-type")
9929        .and_then(|v| v.to_str().ok())
9930        .unwrap_or("application/octet-stream");
9931    let content_type = super::ContentType::from(content_type);
9932
9933    if !status.is_client_error() && !status.is_server_error() {
9934        let content = resp.text().await?;
9935        match content_type {
9936            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9937            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
9938            ContentType::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`")))),
9939        }
9940    } else {
9941        let content = resp.text().await?;
9942        let entity: Option<RetrieveConnectorWithIdError> = serde_json::from_str(&content).ok();
9943        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9944    }
9945}
9946
9947/// Retrieves the Consent for the given Id.
9948pub async fn retrieve_consent_with_id(configuration: &configuration::Configuration, consent_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::ConsentResponse, Error<RetrieveConsentWithIdError>> {
9949    // add a prefix to parameters to efficiently prevent name collisions
9950    let p_path_consent_id = consent_id;
9951    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
9952
9953    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
9954    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9955
9956    if let Some(ref user_agent) = configuration.user_agent {
9957        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9958    }
9959    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
9960        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
9961    }
9962    if let Some(ref apikey) = configuration.api_key {
9963        let key = apikey.key.clone();
9964        let value = match apikey.prefix {
9965            Some(ref prefix) => format!("{} {}", prefix, key),
9966            None => key,
9967        };
9968        req_builder = req_builder.header("Authorization", value);
9969    };
9970
9971    let req = req_builder.build()?;
9972    let resp = configuration.client.execute(req).await?;
9973
9974    let status = resp.status();
9975    let content_type = resp
9976        .headers()
9977        .get("content-type")
9978        .and_then(|v| v.to_str().ok())
9979        .unwrap_or("application/octet-stream");
9980    let content_type = super::ContentType::from(content_type);
9981
9982    if !status.is_client_error() && !status.is_server_error() {
9983        let content = resp.text().await?;
9984        match content_type {
9985            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9986            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
9987            ContentType::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`")))),
9988        }
9989    } else {
9990        let content = resp.text().await?;
9991        let entity: Option<RetrieveConsentWithIdError> = serde_json::from_str(&content).ok();
9992        Err(Error::ResponseError(ResponseContent { status, content, entity }))
9993    }
9994}
9995
9996/// 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.
9997pub 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>> {
9998    // add a prefix to parameters to efficiently prevent name collisions
9999    let p_query_application_id = application_id;
10000    let p_query_start = start;
10001    let p_query_end = end;
10002
10003    let uri_str = format!("{}/api/report/daily-active-user", configuration.base_path);
10004    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10005
10006    if let Some(ref param_value) = p_query_application_id {
10007        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
10008    }
10009    if let Some(ref param_value) = p_query_start {
10010        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
10011    }
10012    if let Some(ref param_value) = p_query_end {
10013        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
10014    }
10015    if let Some(ref user_agent) = configuration.user_agent {
10016        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10017    }
10018    if let Some(ref apikey) = configuration.api_key {
10019        let key = apikey.key.clone();
10020        let value = match apikey.prefix {
10021            Some(ref prefix) => format!("{} {}", prefix, key),
10022            None => key,
10023        };
10024        req_builder = req_builder.header("Authorization", value);
10025    };
10026
10027    let req = req_builder.build()?;
10028    let resp = configuration.client.execute(req).await?;
10029
10030    let status = resp.status();
10031    let content_type = resp
10032        .headers()
10033        .get("content-type")
10034        .and_then(|v| v.to_str().ok())
10035        .unwrap_or("application/octet-stream");
10036    let content_type = super::ContentType::from(content_type);
10037
10038    if !status.is_client_error() && !status.is_server_error() {
10039        let content = resp.text().await?;
10040        match content_type {
10041            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10042            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DailyActiveUserReportResponse`"))),
10043            ContentType::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`")))),
10044        }
10045    } else {
10046        let content = resp.text().await?;
10047        let entity: Option<RetrieveDailyActiveReportWithIdError> = serde_json::from_str(&content).ok();
10048        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10049    }
10050}
10051
10052/// 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.
10053pub async fn retrieve_device_user_code(configuration: &configuration::Configuration, ) -> Result<(), Error<RetrieveDeviceUserCodeError>> {
10054
10055    let uri_str = format!("{}/oauth2/device/user-code", configuration.base_path);
10056    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10057
10058    if let Some(ref user_agent) = configuration.user_agent {
10059        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10060    }
10061    if let Some(ref apikey) = configuration.api_key {
10062        let key = apikey.key.clone();
10063        let value = match apikey.prefix {
10064            Some(ref prefix) => format!("{} {}", prefix, key),
10065            None => key,
10066        };
10067        req_builder = req_builder.header("Authorization", value);
10068    };
10069
10070    let req = req_builder.build()?;
10071    let resp = configuration.client.execute(req).await?;
10072
10073    let status = resp.status();
10074
10075    if !status.is_client_error() && !status.is_server_error() {
10076        Ok(())
10077    } else {
10078        let content = resp.text().await?;
10079        let entity: Option<RetrieveDeviceUserCodeError> = serde_json::from_str(&content).ok();
10080        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10081    }
10082}
10083
10084/// 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. OR 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.
10085pub async fn retrieve_device_validate(configuration: &configuration::Configuration, user_code: Option<&str>, client_id: Option<&str>) -> Result<(), Error<RetrieveDeviceValidateError>> {
10086    // add a prefix to parameters to efficiently prevent name collisions
10087    let p_query_user_code = user_code;
10088    let p_query_client_id = client_id;
10089
10090    let uri_str = format!("{}/oauth2/device/validate", configuration.base_path);
10091    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10092
10093    if let Some(ref param_value) = p_query_user_code {
10094        req_builder = req_builder.query(&[("user_code", &param_value.to_string())]);
10095    }
10096    if let Some(ref param_value) = p_query_client_id {
10097        req_builder = req_builder.query(&[("client_id", &param_value.to_string())]);
10098    }
10099    if let Some(ref user_agent) = configuration.user_agent {
10100        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10101    }
10102    if let Some(ref apikey) = configuration.api_key {
10103        let key = apikey.key.clone();
10104        let value = match apikey.prefix {
10105            Some(ref prefix) => format!("{} {}", prefix, key),
10106            None => key,
10107        };
10108        req_builder = req_builder.header("Authorization", value);
10109    };
10110
10111    let req = req_builder.build()?;
10112    let resp = configuration.client.execute(req).await?;
10113
10114    let status = resp.status();
10115
10116    if !status.is_client_error() && !status.is_server_error() {
10117        Ok(())
10118    } else {
10119        let content = resp.text().await?;
10120        let entity: Option<RetrieveDeviceValidateError> = serde_json::from_str(&content).ok();
10121        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10122    }
10123}
10124
10125/// Retrieves the email template for the given Id. If you don't specify the Id, this will return all the email templates.
10126pub async fn retrieve_email_template(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EmailTemplateResponse, Error<RetrieveEmailTemplateError>> {
10127    // add a prefix to parameters to efficiently prevent name collisions
10128    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10129
10130    let uri_str = format!("{}/api/email/template", configuration.base_path);
10131    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10132
10133    if let Some(ref user_agent) = configuration.user_agent {
10134        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10135    }
10136    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10137        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10138    }
10139    if let Some(ref apikey) = configuration.api_key {
10140        let key = apikey.key.clone();
10141        let value = match apikey.prefix {
10142            Some(ref prefix) => format!("{} {}", prefix, key),
10143            None => key,
10144        };
10145        req_builder = req_builder.header("Authorization", value);
10146    };
10147
10148    let req = req_builder.build()?;
10149    let resp = configuration.client.execute(req).await?;
10150
10151    let status = resp.status();
10152    let content_type = resp
10153        .headers()
10154        .get("content-type")
10155        .and_then(|v| v.to_str().ok())
10156        .unwrap_or("application/octet-stream");
10157    let content_type = super::ContentType::from(content_type);
10158
10159    if !status.is_client_error() && !status.is_server_error() {
10160        let content = resp.text().await?;
10161        match content_type {
10162            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10163            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
10164            ContentType::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`")))),
10165        }
10166    } else {
10167        let content = resp.text().await?;
10168        let entity: Option<RetrieveEmailTemplateError> = serde_json::from_str(&content).ok();
10169        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10170    }
10171}
10172
10173/// 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.
10174pub async fn retrieve_email_template_preview_with_id(configuration: &configuration::Configuration, preview_request: Option<models::PreviewRequest>) -> Result<models::PreviewResponse, Error<RetrieveEmailTemplatePreviewWithIdError>> {
10175    // add a prefix to parameters to efficiently prevent name collisions
10176    let p_body_preview_request = preview_request;
10177
10178    let uri_str = format!("{}/api/email/template/preview", configuration.base_path);
10179    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10180
10181    if let Some(ref user_agent) = configuration.user_agent {
10182        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10183    }
10184    if let Some(ref apikey) = configuration.api_key {
10185        let key = apikey.key.clone();
10186        let value = match apikey.prefix {
10187            Some(ref prefix) => format!("{} {}", prefix, key),
10188            None => key,
10189        };
10190        req_builder = req_builder.header("Authorization", value);
10191    };
10192    req_builder = req_builder.json(&p_body_preview_request);
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::PreviewResponse`"))),
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::PreviewResponse`")))),
10211        }
10212    } else {
10213        let content = resp.text().await?;
10214        let entity: Option<RetrieveEmailTemplatePreviewWithIdError> = serde_json::from_str(&content).ok();
10215        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10216    }
10217}
10218
10219/// Retrieves the email template for the given Id. If you don't specify the Id, this will return all the email templates.
10220pub 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>> {
10221    // add a prefix to parameters to efficiently prevent name collisions
10222    let p_path_email_template_id = email_template_id;
10223    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10224
10225    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
10226    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10227
10228    if let Some(ref user_agent) = configuration.user_agent {
10229        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10230    }
10231    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10232        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10233    }
10234    if let Some(ref apikey) = configuration.api_key {
10235        let key = apikey.key.clone();
10236        let value = match apikey.prefix {
10237            Some(ref prefix) => format!("{} {}", prefix, key),
10238            None => key,
10239        };
10240        req_builder = req_builder.header("Authorization", value);
10241    };
10242
10243    let req = req_builder.build()?;
10244    let resp = configuration.client.execute(req).await?;
10245
10246    let status = resp.status();
10247    let content_type = resp
10248        .headers()
10249        .get("content-type")
10250        .and_then(|v| v.to_str().ok())
10251        .unwrap_or("application/octet-stream");
10252    let content_type = super::ContentType::from(content_type);
10253
10254    if !status.is_client_error() && !status.is_server_error() {
10255        let content = resp.text().await?;
10256        match content_type {
10257            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10258            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
10259            ContentType::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`")))),
10260        }
10261    } else {
10262        let content = resp.text().await?;
10263        let entity: Option<RetrieveEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
10264        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10265    }
10266}
10267
10268/// Retrieves an Entity Grant for the given Entity and User/Entity.
10269pub 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>> {
10270    // add a prefix to parameters to efficiently prevent name collisions
10271    let p_path_entity_id = entity_id;
10272    let p_query_recipient_entity_id = recipient_entity_id;
10273    let p_query_user_id = user_id;
10274    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10275
10276    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
10277    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10278
10279    if let Some(ref param_value) = p_query_recipient_entity_id {
10280        req_builder = req_builder.query(&[("recipientEntityId", &param_value.to_string())]);
10281    }
10282    if let Some(ref param_value) = p_query_user_id {
10283        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10284    }
10285    if let Some(ref user_agent) = configuration.user_agent {
10286        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10287    }
10288    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10289        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10290    }
10291    if let Some(ref apikey) = configuration.api_key {
10292        let key = apikey.key.clone();
10293        let value = match apikey.prefix {
10294            Some(ref prefix) => format!("{} {}", prefix, key),
10295            None => key,
10296        };
10297        req_builder = req_builder.header("Authorization", value);
10298    };
10299
10300    let req = req_builder.build()?;
10301    let resp = configuration.client.execute(req).await?;
10302
10303    let status = resp.status();
10304    let content_type = resp
10305        .headers()
10306        .get("content-type")
10307        .and_then(|v| v.to_str().ok())
10308        .unwrap_or("application/octet-stream");
10309    let content_type = super::ContentType::from(content_type);
10310
10311    if !status.is_client_error() && !status.is_server_error() {
10312        let content = resp.text().await?;
10313        match content_type {
10314            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10315            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityGrantResponse`"))),
10316            ContentType::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`")))),
10317        }
10318    } else {
10319        let content = resp.text().await?;
10320        let entity: Option<RetrieveEntityGrantWithIdError> = serde_json::from_str(&content).ok();
10321        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10322    }
10323}
10324
10325/// Retrieves the Entity Type for the given Id.
10326pub async fn retrieve_entity_type_with_id(configuration: &configuration::Configuration, entity_type_id: &str) -> Result<models::EntityTypeResponse, Error<RetrieveEntityTypeWithIdError>> {
10327    // add a prefix to parameters to efficiently prevent name collisions
10328    let p_path_entity_type_id = entity_type_id;
10329
10330    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
10331    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10332
10333    if let Some(ref user_agent) = configuration.user_agent {
10334        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10335    }
10336    if let Some(ref apikey) = configuration.api_key {
10337        let key = apikey.key.clone();
10338        let value = match apikey.prefix {
10339            Some(ref prefix) => format!("{} {}", prefix, key),
10340            None => key,
10341        };
10342        req_builder = req_builder.header("Authorization", value);
10343    };
10344
10345    let req = req_builder.build()?;
10346    let resp = configuration.client.execute(req).await?;
10347
10348    let status = resp.status();
10349    let content_type = resp
10350        .headers()
10351        .get("content-type")
10352        .and_then(|v| v.to_str().ok())
10353        .unwrap_or("application/octet-stream");
10354    let content_type = super::ContentType::from(content_type);
10355
10356    if !status.is_client_error() && !status.is_server_error() {
10357        let content = resp.text().await?;
10358        match content_type {
10359            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10360            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
10361            ContentType::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`")))),
10362        }
10363    } else {
10364        let content = resp.text().await?;
10365        let entity: Option<RetrieveEntityTypeWithIdError> = serde_json::from_str(&content).ok();
10366        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10367    }
10368}
10369
10370/// Retrieves the Entity for the given Id.
10371pub async fn retrieve_entity_with_id(configuration: &configuration::Configuration, entity_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::EntityResponse, Error<RetrieveEntityWithIdError>> {
10372    // add a prefix to parameters to efficiently prevent name collisions
10373    let p_path_entity_id = entity_id;
10374    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10375
10376    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
10377    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10378
10379    if let Some(ref user_agent) = configuration.user_agent {
10380        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10381    }
10382    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10383        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10384    }
10385    if let Some(ref apikey) = configuration.api_key {
10386        let key = apikey.key.clone();
10387        let value = match apikey.prefix {
10388            Some(ref prefix) => format!("{} {}", prefix, key),
10389            None => key,
10390        };
10391        req_builder = req_builder.header("Authorization", value);
10392    };
10393
10394    let req = req_builder.build()?;
10395    let resp = configuration.client.execute(req).await?;
10396
10397    let status = resp.status();
10398    let content_type = resp
10399        .headers()
10400        .get("content-type")
10401        .and_then(|v| v.to_str().ok())
10402        .unwrap_or("application/octet-stream");
10403    let content_type = super::ContentType::from(content_type);
10404
10405    if !status.is_client_error() && !status.is_server_error() {
10406        let content = resp.text().await?;
10407        match content_type {
10408            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10409            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
10410            ContentType::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`")))),
10411        }
10412    } else {
10413        let content = resp.text().await?;
10414        let entity: Option<RetrieveEntityWithIdError> = serde_json::from_str(&content).ok();
10415        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10416    }
10417}
10418
10419/// Retrieves a single event log for the given Id.
10420pub async fn retrieve_event_log_with_id(configuration: &configuration::Configuration, event_log_id: &str) -> Result<models::EventLogResponse, Error<RetrieveEventLogWithIdError>> {
10421    // add a prefix to parameters to efficiently prevent name collisions
10422    let p_path_event_log_id = event_log_id;
10423
10424    let uri_str = format!("{}/api/system/event-log/{eventLogId}", configuration.base_path, eventLogId=crate::apis::urlencode(p_path_event_log_id));
10425    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10426
10427    if let Some(ref user_agent) = configuration.user_agent {
10428        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10429    }
10430    if let Some(ref apikey) = configuration.api_key {
10431        let key = apikey.key.clone();
10432        let value = match apikey.prefix {
10433            Some(ref prefix) => format!("{} {}", prefix, key),
10434            None => key,
10435        };
10436        req_builder = req_builder.header("Authorization", value);
10437    };
10438
10439    let req = req_builder.build()?;
10440    let resp = configuration.client.execute(req).await?;
10441
10442    let status = resp.status();
10443    let content_type = resp
10444        .headers()
10445        .get("content-type")
10446        .and_then(|v| v.to_str().ok())
10447        .unwrap_or("application/octet-stream");
10448    let content_type = super::ContentType::from(content_type);
10449
10450    if !status.is_client_error() && !status.is_server_error() {
10451        let content = resp.text().await?;
10452        match content_type {
10453            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10454            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventLogResponse`"))),
10455            ContentType::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`")))),
10456        }
10457    } else {
10458        let content = resp.text().await?;
10459        let entity: Option<RetrieveEventLogWithIdError> = serde_json::from_str(&content).ok();
10460        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10461    }
10462}
10463
10464/// Retrieves all the families that a user belongs to.
10465pub 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>> {
10466    // add a prefix to parameters to efficiently prevent name collisions
10467    let p_query_user_id = user_id;
10468    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10469
10470    let uri_str = format!("{}/api/user/family", configuration.base_path);
10471    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10472
10473    if let Some(ref param_value) = p_query_user_id {
10474        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10475    }
10476    if let Some(ref user_agent) = configuration.user_agent {
10477        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10478    }
10479    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10480        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10481    }
10482    if let Some(ref apikey) = configuration.api_key {
10483        let key = apikey.key.clone();
10484        let value = match apikey.prefix {
10485            Some(ref prefix) => format!("{} {}", prefix, key),
10486            None => key,
10487        };
10488        req_builder = req_builder.header("Authorization", value);
10489    };
10490
10491    let req = req_builder.build()?;
10492    let resp = configuration.client.execute(req).await?;
10493
10494    let status = resp.status();
10495    let content_type = resp
10496        .headers()
10497        .get("content-type")
10498        .and_then(|v| v.to_str().ok())
10499        .unwrap_or("application/octet-stream");
10500    let content_type = super::ContentType::from(content_type);
10501
10502    if !status.is_client_error() && !status.is_server_error() {
10503        let content = resp.text().await?;
10504        match content_type {
10505            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10506            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
10507            ContentType::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`")))),
10508        }
10509    } else {
10510        let content = resp.text().await?;
10511        let entity: Option<RetrieveFamiliesWithIdError> = serde_json::from_str(&content).ok();
10512        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10513    }
10514}
10515
10516/// Retrieves all the members of a family by the unique Family Id.
10517pub 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>> {
10518    // add a prefix to parameters to efficiently prevent name collisions
10519    let p_path_family_id = family_id;
10520    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10521
10522    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_id));
10523    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10524
10525    if let Some(ref user_agent) = configuration.user_agent {
10526        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10527    }
10528    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10529        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10530    }
10531    if let Some(ref apikey) = configuration.api_key {
10532        let key = apikey.key.clone();
10533        let value = match apikey.prefix {
10534            Some(ref prefix) => format!("{} {}", prefix, key),
10535            None => key,
10536        };
10537        req_builder = req_builder.header("Authorization", value);
10538    };
10539
10540    let req = req_builder.build()?;
10541    let resp = configuration.client.execute(req).await?;
10542
10543    let status = resp.status();
10544    let content_type = resp
10545        .headers()
10546        .get("content-type")
10547        .and_then(|v| v.to_str().ok())
10548        .unwrap_or("application/octet-stream");
10549    let content_type = super::ContentType::from(content_type);
10550
10551    if !status.is_client_error() && !status.is_server_error() {
10552        let content = resp.text().await?;
10553        match content_type {
10554            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10555            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
10556            ContentType::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`")))),
10557        }
10558    } else {
10559        let content = resp.text().await?;
10560        let entity: Option<RetrieveFamilyMembersByFamilyIdWithIdError> = serde_json::from_str(&content).ok();
10561        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10562    }
10563}
10564
10565/// Retrieves the form field with the given Id.
10566pub async fn retrieve_form_field_with_id(configuration: &configuration::Configuration, field_id: &str) -> Result<models::FormFieldResponse, Error<RetrieveFormFieldWithIdError>> {
10567    // add a prefix to parameters to efficiently prevent name collisions
10568    let p_path_field_id = field_id;
10569
10570    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
10571    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10572
10573    if let Some(ref user_agent) = configuration.user_agent {
10574        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10575    }
10576    if let Some(ref apikey) = configuration.api_key {
10577        let key = apikey.key.clone();
10578        let value = match apikey.prefix {
10579            Some(ref prefix) => format!("{} {}", prefix, key),
10580            None => key,
10581        };
10582        req_builder = req_builder.header("Authorization", value);
10583    };
10584
10585    let req = req_builder.build()?;
10586    let resp = configuration.client.execute(req).await?;
10587
10588    let status = resp.status();
10589    let content_type = resp
10590        .headers()
10591        .get("content-type")
10592        .and_then(|v| v.to_str().ok())
10593        .unwrap_or("application/octet-stream");
10594    let content_type = super::ContentType::from(content_type);
10595
10596    if !status.is_client_error() && !status.is_server_error() {
10597        let content = resp.text().await?;
10598        match content_type {
10599            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10600            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
10601            ContentType::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`")))),
10602        }
10603    } else {
10604        let content = resp.text().await?;
10605        let entity: Option<RetrieveFormFieldWithIdError> = serde_json::from_str(&content).ok();
10606        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10607    }
10608}
10609
10610/// Retrieves the form with the given Id.
10611pub async fn retrieve_form_with_id(configuration: &configuration::Configuration, form_id: &str) -> Result<models::FormResponse, Error<RetrieveFormWithIdError>> {
10612    // add a prefix to parameters to efficiently prevent name collisions
10613    let p_path_form_id = form_id;
10614
10615    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
10616    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10617
10618    if let Some(ref user_agent) = configuration.user_agent {
10619        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10620    }
10621    if let Some(ref apikey) = configuration.api_key {
10622        let key = apikey.key.clone();
10623        let value = match apikey.prefix {
10624            Some(ref prefix) => format!("{} {}", prefix, key),
10625            None => key,
10626        };
10627        req_builder = req_builder.header("Authorization", value);
10628    };
10629
10630    let req = req_builder.build()?;
10631    let resp = configuration.client.execute(req).await?;
10632
10633    let status = resp.status();
10634    let content_type = resp
10635        .headers()
10636        .get("content-type")
10637        .and_then(|v| v.to_str().ok())
10638        .unwrap_or("application/octet-stream");
10639    let content_type = super::ContentType::from(content_type);
10640
10641    if !status.is_client_error() && !status.is_server_error() {
10642        let content = resp.text().await?;
10643        match content_type {
10644            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10645            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
10646            ContentType::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`")))),
10647        }
10648    } else {
10649        let content = resp.text().await?;
10650        let entity: Option<RetrieveFormWithIdError> = serde_json::from_str(&content).ok();
10651        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10652    }
10653}
10654
10655/// Retrieves the group for the given Id.
10656pub async fn retrieve_group_with_id(configuration: &configuration::Configuration, group_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::GroupResponse, Error<RetrieveGroupWithIdError>> {
10657    // add a prefix to parameters to efficiently prevent name collisions
10658    let p_path_group_id = group_id;
10659    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
10660
10661    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
10662    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10663
10664    if let Some(ref user_agent) = configuration.user_agent {
10665        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10666    }
10667    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
10668        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
10669    }
10670    if let Some(ref apikey) = configuration.api_key {
10671        let key = apikey.key.clone();
10672        let value = match apikey.prefix {
10673            Some(ref prefix) => format!("{} {}", prefix, key),
10674            None => key,
10675        };
10676        req_builder = req_builder.header("Authorization", value);
10677    };
10678
10679    let req = req_builder.build()?;
10680    let resp = configuration.client.execute(req).await?;
10681
10682    let status = resp.status();
10683    let content_type = resp
10684        .headers()
10685        .get("content-type")
10686        .and_then(|v| v.to_str().ok())
10687        .unwrap_or("application/octet-stream");
10688    let content_type = super::ContentType::from(content_type);
10689
10690    if !status.is_client_error() && !status.is_server_error() {
10691        let content = resp.text().await?;
10692        match content_type {
10693            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10694            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
10695            ContentType::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`")))),
10696        }
10697    } else {
10698        let content = resp.text().await?;
10699        let entity: Option<RetrieveGroupWithIdError> = serde_json::from_str(&content).ok();
10700        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10701    }
10702}
10703
10704/// 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.
10705pub async fn retrieve_identity_provider_by_type_with_id(configuration: &configuration::Configuration, r#type: Option<&str>) -> Result<models::IdentityProviderResponse, Error<RetrieveIdentityProviderByTypeWithIdError>> {
10706    // add a prefix to parameters to efficiently prevent name collisions
10707    let p_query_type = r#type;
10708
10709    let uri_str = format!("{}/api/identity-provider", configuration.base_path);
10710    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10711
10712    if let Some(ref param_value) = p_query_type {
10713        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
10714    }
10715    if let Some(ref user_agent) = configuration.user_agent {
10716        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10717    }
10718    if let Some(ref apikey) = configuration.api_key {
10719        let key = apikey.key.clone();
10720        let value = match apikey.prefix {
10721            Some(ref prefix) => format!("{} {}", prefix, key),
10722            None => key,
10723        };
10724        req_builder = req_builder.header("Authorization", value);
10725    };
10726
10727    let req = req_builder.build()?;
10728    let resp = configuration.client.execute(req).await?;
10729
10730    let status = resp.status();
10731    let content_type = resp
10732        .headers()
10733        .get("content-type")
10734        .and_then(|v| v.to_str().ok())
10735        .unwrap_or("application/octet-stream");
10736    let content_type = super::ContentType::from(content_type);
10737
10738    if !status.is_client_error() && !status.is_server_error() {
10739        let content = resp.text().await?;
10740        match content_type {
10741            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10742            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
10743            ContentType::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`")))),
10744        }
10745    } else {
10746        let content = resp.text().await?;
10747        let entity: Option<RetrieveIdentityProviderByTypeWithIdError> = serde_json::from_str(&content).ok();
10748        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10749    }
10750}
10751
10752/// 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).
10753pub 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>> {
10754    // add a prefix to parameters to efficiently prevent name collisions
10755    let p_query_identity_provider_id = identity_provider_id;
10756    let p_query_user_id = user_id;
10757    let p_query_identity_provider_user_id = identity_provider_user_id;
10758
10759    let uri_str = format!("{}/api/identity-provider/link", configuration.base_path);
10760    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10761
10762    if let Some(ref param_value) = p_query_identity_provider_id {
10763        req_builder = req_builder.query(&[("identityProviderId", &param_value.to_string())]);
10764    }
10765    if let Some(ref param_value) = p_query_user_id {
10766        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
10767    }
10768    if let Some(ref param_value) = p_query_identity_provider_user_id {
10769        req_builder = req_builder.query(&[("identityProviderUserId", &param_value.to_string())]);
10770    }
10771    if let Some(ref user_agent) = configuration.user_agent {
10772        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10773    }
10774    if let Some(ref apikey) = configuration.api_key {
10775        let key = apikey.key.clone();
10776        let value = match apikey.prefix {
10777            Some(ref prefix) => format!("{} {}", prefix, key),
10778            None => key,
10779        };
10780        req_builder = req_builder.header("Authorization", value);
10781    };
10782
10783    let req = req_builder.build()?;
10784    let resp = configuration.client.execute(req).await?;
10785
10786    let status = resp.status();
10787    let content_type = resp
10788        .headers()
10789        .get("content-type")
10790        .and_then(|v| v.to_str().ok())
10791        .unwrap_or("application/octet-stream");
10792    let content_type = super::ContentType::from(content_type);
10793
10794    if !status.is_client_error() && !status.is_server_error() {
10795        let content = resp.text().await?;
10796        match content_type {
10797            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10798            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderLinkResponse`"))),
10799            ContentType::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`")))),
10800        }
10801    } else {
10802        let content = resp.text().await?;
10803        let entity: Option<RetrieveIdentityProviderLinkError> = serde_json::from_str(&content).ok();
10804        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10805    }
10806}
10807
10808/// Retrieves the identity provider for the given Id or all the identity providers if the Id is null.
10809pub async fn retrieve_identity_provider_with_id(configuration: &configuration::Configuration, identity_provider_id: &str) -> Result<models::IdentityProviderResponse, Error<RetrieveIdentityProviderWithIdError>> {
10810    // add a prefix to parameters to efficiently prevent name collisions
10811    let p_path_identity_provider_id = identity_provider_id;
10812
10813    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
10814    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10815
10816    if let Some(ref user_agent) = configuration.user_agent {
10817        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10818    }
10819    if let Some(ref apikey) = configuration.api_key {
10820        let key = apikey.key.clone();
10821        let value = match apikey.prefix {
10822            Some(ref prefix) => format!("{} {}", prefix, key),
10823            None => key,
10824        };
10825        req_builder = req_builder.header("Authorization", value);
10826    };
10827
10828    let req = req_builder.build()?;
10829    let resp = configuration.client.execute(req).await?;
10830
10831    let status = resp.status();
10832    let content_type = resp
10833        .headers()
10834        .get("content-type")
10835        .and_then(|v| v.to_str().ok())
10836        .unwrap_or("application/octet-stream");
10837    let content_type = super::ContentType::from(content_type);
10838
10839    if !status.is_client_error() && !status.is_server_error() {
10840        let content = resp.text().await?;
10841        match content_type {
10842            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10843            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
10844            ContentType::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`")))),
10845        }
10846    } else {
10847        let content = resp.text().await?;
10848        let entity: Option<RetrieveIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
10849        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10850    }
10851}
10852
10853/// Retrieves the IP Access Control List with the given Id.
10854pub async fn retrieve_ip_access_control_list_with_id(configuration: &configuration::Configuration, ip_access_control_list_id: &str) -> Result<models::IpAccessControlListResponse, Error<RetrieveIpAccessControlListWithIdError>> {
10855    // add a prefix to parameters to efficiently prevent name collisions
10856    let p_path_ip_access_control_list_id = ip_access_control_list_id;
10857
10858    let uri_str = format!("{}/api/ip-acl/{ipAccessControlListId}", configuration.base_path, ipAccessControlListId=crate::apis::urlencode(p_path_ip_access_control_list_id));
10859    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10860
10861    if let Some(ref user_agent) = configuration.user_agent {
10862        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10863    }
10864    if let Some(ref apikey) = configuration.api_key {
10865        let key = apikey.key.clone();
10866        let value = match apikey.prefix {
10867            Some(ref prefix) => format!("{} {}", prefix, key),
10868            None => key,
10869        };
10870        req_builder = req_builder.header("Authorization", value);
10871    };
10872
10873    let req = req_builder.build()?;
10874    let resp = configuration.client.execute(req).await?;
10875
10876    let status = resp.status();
10877    let content_type = resp
10878        .headers()
10879        .get("content-type")
10880        .and_then(|v| v.to_str().ok())
10881        .unwrap_or("application/octet-stream");
10882    let content_type = super::ContentType::from(content_type);
10883
10884    if !status.is_client_error() && !status.is_server_error() {
10885        let content = resp.text().await?;
10886        match content_type {
10887            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10888            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
10889            ContentType::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`")))),
10890        }
10891    } else {
10892        let content = resp.text().await?;
10893        let entity: Option<RetrieveIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
10894        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10895    }
10896}
10897
10898/// Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format.
10899pub async fn retrieve_json_web_key_set_with_id(configuration: &configuration::Configuration, ) -> Result<models::JwksResponse, Error<RetrieveJsonWebKeySetWithIdError>> {
10900
10901    let uri_str = format!("{}/.well-known/jwks.json", configuration.base_path);
10902    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10903
10904    if let Some(ref user_agent) = configuration.user_agent {
10905        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10906    }
10907    if let Some(ref apikey) = configuration.api_key {
10908        let key = apikey.key.clone();
10909        let value = match apikey.prefix {
10910            Some(ref prefix) => format!("{} {}", prefix, key),
10911            None => key,
10912        };
10913        req_builder = req_builder.header("Authorization", value);
10914    };
10915
10916    let req = req_builder.build()?;
10917    let resp = configuration.client.execute(req).await?;
10918
10919    let status = resp.status();
10920    let content_type = resp
10921        .headers()
10922        .get("content-type")
10923        .and_then(|v| v.to_str().ok())
10924        .unwrap_or("application/octet-stream");
10925    let content_type = super::ContentType::from(content_type);
10926
10927    if !status.is_client_error() && !status.is_server_error() {
10928        let content = resp.text().await?;
10929        match content_type {
10930            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10931            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwksResponse`"))),
10932            ContentType::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`")))),
10933        }
10934    } else {
10935        let content = resp.text().await?;
10936        let entity: Option<RetrieveJsonWebKeySetWithIdError> = serde_json::from_str(&content).ok();
10937        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10938    }
10939}
10940
10941/// 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).
10942pub async fn retrieve_jwt_public_key(configuration: &configuration::Configuration, application_id: Option<&str>, key_id: Option<&str>) -> Result<models::PublicKeyResponse, Error<RetrieveJwtPublicKeyError>> {
10943    // add a prefix to parameters to efficiently prevent name collisions
10944    let p_query_application_id = application_id;
10945    let p_query_key_id = key_id;
10946
10947    let uri_str = format!("{}/api/jwt/public-key", configuration.base_path);
10948    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10949
10950    if let Some(ref param_value) = p_query_application_id {
10951        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
10952    }
10953    if let Some(ref param_value) = p_query_key_id {
10954        req_builder = req_builder.query(&[("keyId", &param_value.to_string())]);
10955    }
10956    if let Some(ref user_agent) = configuration.user_agent {
10957        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10958    }
10959    if let Some(ref apikey) = configuration.api_key {
10960        let key = apikey.key.clone();
10961        let value = match apikey.prefix {
10962            Some(ref prefix) => format!("{} {}", prefix, key),
10963            None => key,
10964        };
10965        req_builder = req_builder.header("Authorization", value);
10966    };
10967
10968    let req = req_builder.build()?;
10969    let resp = configuration.client.execute(req).await?;
10970
10971    let status = resp.status();
10972    let content_type = resp
10973        .headers()
10974        .get("content-type")
10975        .and_then(|v| v.to_str().ok())
10976        .unwrap_or("application/octet-stream");
10977    let content_type = super::ContentType::from(content_type);
10978
10979    if !status.is_client_error() && !status.is_server_error() {
10980        let content = resp.text().await?;
10981        match content_type {
10982            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10983            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PublicKeyResponse`"))),
10984            ContentType::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`")))),
10985        }
10986    } else {
10987        let content = resp.text().await?;
10988        let entity: Option<RetrieveJwtPublicKeyError> = serde_json::from_str(&content).ok();
10989        Err(Error::ResponseError(ResponseContent { status, content, entity }))
10990    }
10991}
10992
10993/// Retrieves the key for the given Id.
10994pub async fn retrieve_key_with_id(configuration: &configuration::Configuration, key_id: &str) -> Result<models::KeyResponse, Error<RetrieveKeyWithIdError>> {
10995    // add a prefix to parameters to efficiently prevent name collisions
10996    let p_path_key_id = key_id;
10997
10998    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
10999    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11000
11001    if let Some(ref user_agent) = configuration.user_agent {
11002        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11003    }
11004    if let Some(ref apikey) = configuration.api_key {
11005        let key = apikey.key.clone();
11006        let value = match apikey.prefix {
11007            Some(ref prefix) => format!("{} {}", prefix, key),
11008            None => key,
11009        };
11010        req_builder = req_builder.header("Authorization", value);
11011    };
11012
11013    let req = req_builder.build()?;
11014    let resp = configuration.client.execute(req).await?;
11015
11016    let status = resp.status();
11017    let content_type = resp
11018        .headers()
11019        .get("content-type")
11020        .and_then(|v| v.to_str().ok())
11021        .unwrap_or("application/octet-stream");
11022    let content_type = super::ContentType::from(content_type);
11023
11024    if !status.is_client_error() && !status.is_server_error() {
11025        let content = resp.text().await?;
11026        match content_type {
11027            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11028            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
11029            ContentType::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`")))),
11030        }
11031    } else {
11032        let content = resp.text().await?;
11033        let entity: Option<RetrieveKeyWithIdError> = serde_json::from_str(&content).ok();
11034        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11035    }
11036}
11037
11038/// Retrieves all the keys.
11039pub async fn retrieve_keys_with_id(configuration: &configuration::Configuration, ) -> Result<models::KeyResponse, Error<RetrieveKeysWithIdError>> {
11040
11041    let uri_str = format!("{}/api/key", configuration.base_path);
11042    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11043
11044    if let Some(ref user_agent) = configuration.user_agent {
11045        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11046    }
11047    if let Some(ref apikey) = configuration.api_key {
11048        let key = apikey.key.clone();
11049        let value = match apikey.prefix {
11050            Some(ref prefix) => format!("{} {}", prefix, key),
11051            None => key,
11052        };
11053        req_builder = req_builder.header("Authorization", value);
11054    };
11055
11056    let req = req_builder.build()?;
11057    let resp = configuration.client.execute(req).await?;
11058
11059    let status = resp.status();
11060    let content_type = resp
11061        .headers()
11062        .get("content-type")
11063        .and_then(|v| v.to_str().ok())
11064        .unwrap_or("application/octet-stream");
11065    let content_type = super::ContentType::from(content_type);
11066
11067    if !status.is_client_error() && !status.is_server_error() {
11068        let content = resp.text().await?;
11069        match content_type {
11070            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11071            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
11072            ContentType::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`")))),
11073        }
11074    } else {
11075        let content = resp.text().await?;
11076        let entity: Option<RetrieveKeysWithIdError> = serde_json::from_str(&content).ok();
11077        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11078    }
11079}
11080
11081/// Retrieves the lambda for the given Id.
11082pub async fn retrieve_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str) -> Result<models::LambdaResponse, Error<RetrieveLambdaWithIdError>> {
11083    // add a prefix to parameters to efficiently prevent name collisions
11084    let p_path_lambda_id = lambda_id;
11085
11086    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
11087    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11088
11089    if let Some(ref user_agent) = configuration.user_agent {
11090        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11091    }
11092    if let Some(ref apikey) = configuration.api_key {
11093        let key = apikey.key.clone();
11094        let value = match apikey.prefix {
11095            Some(ref prefix) => format!("{} {}", prefix, key),
11096            None => key,
11097        };
11098        req_builder = req_builder.header("Authorization", value);
11099    };
11100
11101    let req = req_builder.build()?;
11102    let resp = configuration.client.execute(req).await?;
11103
11104    let status = resp.status();
11105    let content_type = resp
11106        .headers()
11107        .get("content-type")
11108        .and_then(|v| v.to_str().ok())
11109        .unwrap_or("application/octet-stream");
11110    let content_type = super::ContentType::from(content_type);
11111
11112    if !status.is_client_error() && !status.is_server_error() {
11113        let content = resp.text().await?;
11114        match content_type {
11115            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11116            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
11117            ContentType::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`")))),
11118        }
11119    } else {
11120        let content = resp.text().await?;
11121        let entity: Option<RetrieveLambdaWithIdError> = serde_json::from_str(&content).ok();
11122        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11123    }
11124}
11125
11126/// Retrieves all the lambdas for the provided type.
11127pub async fn retrieve_lambdas_by_type_with_id(configuration: &configuration::Configuration, r#type: Option<&str>) -> Result<models::LambdaResponse, Error<RetrieveLambdasByTypeWithIdError>> {
11128    // add a prefix to parameters to efficiently prevent name collisions
11129    let p_query_type = r#type;
11130
11131    let uri_str = format!("{}/api/lambda", configuration.base_path);
11132    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11133
11134    if let Some(ref param_value) = p_query_type {
11135        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
11136    }
11137    if let Some(ref user_agent) = configuration.user_agent {
11138        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11139    }
11140    if let Some(ref apikey) = configuration.api_key {
11141        let key = apikey.key.clone();
11142        let value = match apikey.prefix {
11143            Some(ref prefix) => format!("{} {}", prefix, key),
11144            None => key,
11145        };
11146        req_builder = req_builder.header("Authorization", value);
11147    };
11148
11149    let req = req_builder.build()?;
11150    let resp = configuration.client.execute(req).await?;
11151
11152    let status = resp.status();
11153    let content_type = resp
11154        .headers()
11155        .get("content-type")
11156        .and_then(|v| v.to_str().ok())
11157        .unwrap_or("application/octet-stream");
11158    let content_type = super::ContentType::from(content_type);
11159
11160    if !status.is_client_error() && !status.is_server_error() {
11161        let content = resp.text().await?;
11162        match content_type {
11163            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11164            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
11165            ContentType::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`")))),
11166        }
11167    } else {
11168        let content = resp.text().await?;
11169        let entity: Option<RetrieveLambdasByTypeWithIdError> = serde_json::from_str(&content).ok();
11170        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11171    }
11172}
11173
11174/// Retrieves the message template for the given Id. If you don't specify the Id, this will return all the message templates.
11175pub async fn retrieve_message_template(configuration: &configuration::Configuration, ) -> Result<models::MessageTemplateResponse, Error<RetrieveMessageTemplateError>> {
11176
11177    let uri_str = format!("{}/api/message/template", configuration.base_path);
11178    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11179
11180    if let Some(ref user_agent) = configuration.user_agent {
11181        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11182    }
11183    if let Some(ref apikey) = configuration.api_key {
11184        let key = apikey.key.clone();
11185        let value = match apikey.prefix {
11186            Some(ref prefix) => format!("{} {}", prefix, key),
11187            None => key,
11188        };
11189        req_builder = req_builder.header("Authorization", value);
11190    };
11191
11192    let req = req_builder.build()?;
11193    let resp = configuration.client.execute(req).await?;
11194
11195    let status = resp.status();
11196    let content_type = resp
11197        .headers()
11198        .get("content-type")
11199        .and_then(|v| v.to_str().ok())
11200        .unwrap_or("application/octet-stream");
11201    let content_type = super::ContentType::from(content_type);
11202
11203    if !status.is_client_error() && !status.is_server_error() {
11204        let content = resp.text().await?;
11205        match content_type {
11206            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11207            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
11208            ContentType::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`")))),
11209        }
11210    } else {
11211        let content = resp.text().await?;
11212        let entity: Option<RetrieveMessageTemplateError> = serde_json::from_str(&content).ok();
11213        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11214    }
11215}
11216
11217/// Creates a preview of the message template provided in the request, normalized to a given locale.
11218pub async fn retrieve_message_template_preview_with_id(configuration: &configuration::Configuration, preview_message_template_request: Option<models::PreviewMessageTemplateRequest>) -> Result<models::PreviewMessageTemplateResponse, Error<RetrieveMessageTemplatePreviewWithIdError>> {
11219    // add a prefix to parameters to efficiently prevent name collisions
11220    let p_body_preview_message_template_request = preview_message_template_request;
11221
11222    let uri_str = format!("{}/api/message/template/preview", configuration.base_path);
11223    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11224
11225    if let Some(ref user_agent) = configuration.user_agent {
11226        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11227    }
11228    if let Some(ref apikey) = configuration.api_key {
11229        let key = apikey.key.clone();
11230        let value = match apikey.prefix {
11231            Some(ref prefix) => format!("{} {}", prefix, key),
11232            None => key,
11233        };
11234        req_builder = req_builder.header("Authorization", value);
11235    };
11236    req_builder = req_builder.json(&p_body_preview_message_template_request);
11237
11238    let req = req_builder.build()?;
11239    let resp = configuration.client.execute(req).await?;
11240
11241    let status = resp.status();
11242    let content_type = resp
11243        .headers()
11244        .get("content-type")
11245        .and_then(|v| v.to_str().ok())
11246        .unwrap_or("application/octet-stream");
11247    let content_type = super::ContentType::from(content_type);
11248
11249    if !status.is_client_error() && !status.is_server_error() {
11250        let content = resp.text().await?;
11251        match content_type {
11252            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11253            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PreviewMessageTemplateResponse`"))),
11254            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PreviewMessageTemplateResponse`")))),
11255        }
11256    } else {
11257        let content = resp.text().await?;
11258        let entity: Option<RetrieveMessageTemplatePreviewWithIdError> = serde_json::from_str(&content).ok();
11259        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11260    }
11261}
11262
11263/// Retrieves the message template for the given Id. If you don't specify the Id, this will return all the message templates.
11264pub async fn retrieve_message_template_with_id(configuration: &configuration::Configuration, message_template_id: &str) -> Result<models::MessageTemplateResponse, Error<RetrieveMessageTemplateWithIdError>> {
11265    // add a prefix to parameters to efficiently prevent name collisions
11266    let p_path_message_template_id = message_template_id;
11267
11268    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
11269    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11270
11271    if let Some(ref user_agent) = configuration.user_agent {
11272        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11273    }
11274    if let Some(ref apikey) = configuration.api_key {
11275        let key = apikey.key.clone();
11276        let value = match apikey.prefix {
11277            Some(ref prefix) => format!("{} {}", prefix, key),
11278            None => key,
11279        };
11280        req_builder = req_builder.header("Authorization", value);
11281    };
11282
11283    let req = req_builder.build()?;
11284    let resp = configuration.client.execute(req).await?;
11285
11286    let status = resp.status();
11287    let content_type = resp
11288        .headers()
11289        .get("content-type")
11290        .and_then(|v| v.to_str().ok())
11291        .unwrap_or("application/octet-stream");
11292    let content_type = super::ContentType::from(content_type);
11293
11294    if !status.is_client_error() && !status.is_server_error() {
11295        let content = resp.text().await?;
11296        match content_type {
11297            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11298            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
11299            ContentType::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`")))),
11300        }
11301    } else {
11302        let content = resp.text().await?;
11303        let entity: Option<RetrieveMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
11304        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11305    }
11306}
11307
11308/// Retrieves the messenger with the given Id.
11309pub async fn retrieve_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str) -> Result<models::MessengerResponse, Error<RetrieveMessengerWithIdError>> {
11310    // add a prefix to parameters to efficiently prevent name collisions
11311    let p_path_messenger_id = messenger_id;
11312
11313    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
11314    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11315
11316    if let Some(ref user_agent) = configuration.user_agent {
11317        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
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::MessengerResponse`"))),
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::MessengerResponse`")))),
11345        }
11346    } else {
11347        let content = resp.text().await?;
11348        let entity: Option<RetrieveMessengerWithIdError> = serde_json::from_str(&content).ok();
11349        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11350    }
11351}
11352
11353/// 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.
11354pub 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>> {
11355    // add a prefix to parameters to efficiently prevent name collisions
11356    let p_query_application_id = application_id;
11357    let p_query_start = start;
11358    let p_query_end = end;
11359
11360    let uri_str = format!("{}/api/report/monthly-active-user", configuration.base_path);
11361    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11362
11363    if let Some(ref param_value) = p_query_application_id {
11364        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11365    }
11366    if let Some(ref param_value) = p_query_start {
11367        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11368    }
11369    if let Some(ref param_value) = p_query_end {
11370        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11371    }
11372    if let Some(ref user_agent) = configuration.user_agent {
11373        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11374    }
11375    if let Some(ref apikey) = configuration.api_key {
11376        let key = apikey.key.clone();
11377        let value = match apikey.prefix {
11378            Some(ref prefix) => format!("{} {}", prefix, key),
11379            None => key,
11380        };
11381        req_builder = req_builder.header("Authorization", value);
11382    };
11383
11384    let req = req_builder.build()?;
11385    let resp = configuration.client.execute(req).await?;
11386
11387    let status = resp.status();
11388    let content_type = resp
11389        .headers()
11390        .get("content-type")
11391        .and_then(|v| v.to_str().ok())
11392        .unwrap_or("application/octet-stream");
11393    let content_type = super::ContentType::from(content_type);
11394
11395    if !status.is_client_error() && !status.is_server_error() {
11396        let content = resp.text().await?;
11397        match content_type {
11398            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11399            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MonthlyActiveUserReportResponse`"))),
11400            ContentType::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`")))),
11401        }
11402    } else {
11403        let content = resp.text().await?;
11404        let entity: Option<RetrieveMonthlyActiveReportWithIdError> = serde_json::from_str(&content).ok();
11405        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11406    }
11407}
11408
11409/// Retrieves a custom OAuth scope.
11410pub 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>> {
11411    // add a prefix to parameters to efficiently prevent name collisions
11412    let p_path_application_id = application_id;
11413    let p_path_scope_id = scope_id;
11414    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11415
11416    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));
11417    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11418
11419    if let Some(ref user_agent) = configuration.user_agent {
11420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11421    }
11422    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
11423        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11424    }
11425    if let Some(ref apikey) = configuration.api_key {
11426        let key = apikey.key.clone();
11427        let value = match apikey.prefix {
11428            Some(ref prefix) => format!("{} {}", prefix, key),
11429            None => key,
11430        };
11431        req_builder = req_builder.header("Authorization", value);
11432    };
11433
11434    let req = req_builder.build()?;
11435    let resp = configuration.client.execute(req).await?;
11436
11437    let status = resp.status();
11438    let content_type = resp
11439        .headers()
11440        .get("content-type")
11441        .and_then(|v| v.to_str().ok())
11442        .unwrap_or("application/octet-stream");
11443    let content_type = super::ContentType::from(content_type);
11444
11445    if !status.is_client_error() && !status.is_server_error() {
11446        let content = resp.text().await?;
11447        match content_type {
11448            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11449            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
11450            ContentType::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`")))),
11451        }
11452    } else {
11453        let content = resp.text().await?;
11454        let entity: Option<RetrieveOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
11455        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11456    }
11457}
11458
11459/// Retrieves the Oauth2 configuration for the application for the given Application Id.
11460pub 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>> {
11461    // add a prefix to parameters to efficiently prevent name collisions
11462    let p_path_application_id = application_id;
11463    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11464
11465    let uri_str = format!("{}/api/application/{applicationId}/oauth-configuration", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
11466    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11467
11468    if let Some(ref user_agent) = configuration.user_agent {
11469        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11470    }
11471    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
11472        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11473    }
11474    if let Some(ref apikey) = configuration.api_key {
11475        let key = apikey.key.clone();
11476        let value = match apikey.prefix {
11477            Some(ref prefix) => format!("{} {}", prefix, key),
11478            None => key,
11479        };
11480        req_builder = req_builder.header("Authorization", value);
11481    };
11482
11483    let req = req_builder.build()?;
11484    let resp = configuration.client.execute(req).await?;
11485
11486    let status = resp.status();
11487    let content_type = resp
11488        .headers()
11489        .get("content-type")
11490        .and_then(|v| v.to_str().ok())
11491        .unwrap_or("application/octet-stream");
11492    let content_type = super::ContentType::from(content_type);
11493
11494    if !status.is_client_error() && !status.is_server_error() {
11495        let content = resp.text().await?;
11496        match content_type {
11497            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11498            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthConfigurationResponse`"))),
11499            ContentType::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`")))),
11500        }
11501    } else {
11502        let content = resp.text().await?;
11503        let entity: Option<RetrieveOauthConfigurationWithIdError> = serde_json::from_str(&content).ok();
11504        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11505    }
11506}
11507
11508/// Returns the well known OpenID Configuration JSON document
11509pub async fn retrieve_open_id_configuration_with_id(configuration: &configuration::Configuration, ) -> Result<models::OpenIdConfiguration, Error<RetrieveOpenIdConfigurationWithIdError>> {
11510
11511    let uri_str = format!("{}/.well-known/openid-configuration", configuration.base_path);
11512    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11513
11514    if let Some(ref user_agent) = configuration.user_agent {
11515        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11516    }
11517    if let Some(ref apikey) = configuration.api_key {
11518        let key = apikey.key.clone();
11519        let value = match apikey.prefix {
11520            Some(ref prefix) => format!("{} {}", prefix, key),
11521            None => key,
11522        };
11523        req_builder = req_builder.header("Authorization", value);
11524    };
11525
11526    let req = req_builder.build()?;
11527    let resp = configuration.client.execute(req).await?;
11528
11529    let status = resp.status();
11530    let content_type = resp
11531        .headers()
11532        .get("content-type")
11533        .and_then(|v| v.to_str().ok())
11534        .unwrap_or("application/octet-stream");
11535    let content_type = super::ContentType::from(content_type);
11536
11537    if !status.is_client_error() && !status.is_server_error() {
11538        let content = resp.text().await?;
11539        match content_type {
11540            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11541            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OpenIdConfiguration`"))),
11542            ContentType::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`")))),
11543        }
11544    } else {
11545        let content = resp.text().await?;
11546        let entity: Option<RetrieveOpenIdConfigurationWithIdError> = serde_json::from_str(&content).ok();
11547        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11548    }
11549}
11550
11551/// 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.
11552pub async fn retrieve_password_validation_rules_with_id(configuration: &configuration::Configuration, ) -> Result<models::PasswordValidationRulesResponse, Error<RetrievePasswordValidationRulesWithIdError>> {
11553
11554    let uri_str = format!("{}/api/tenant/password-validation-rules", configuration.base_path);
11555    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11556
11557    if let Some(ref user_agent) = configuration.user_agent {
11558        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11559    }
11560    if let Some(ref apikey) = configuration.api_key {
11561        let key = apikey.key.clone();
11562        let value = match apikey.prefix {
11563            Some(ref prefix) => format!("{} {}", prefix, key),
11564            None => key,
11565        };
11566        req_builder = req_builder.header("Authorization", value);
11567    };
11568
11569    let req = req_builder.build()?;
11570    let resp = configuration.client.execute(req).await?;
11571
11572    let status = resp.status();
11573    let content_type = resp
11574        .headers()
11575        .get("content-type")
11576        .and_then(|v| v.to_str().ok())
11577        .unwrap_or("application/octet-stream");
11578    let content_type = super::ContentType::from(content_type);
11579
11580    if !status.is_client_error() && !status.is_server_error() {
11581        let content = resp.text().await?;
11582        match content_type {
11583            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11584            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordValidationRulesResponse`"))),
11585            ContentType::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`")))),
11586        }
11587    } else {
11588        let content = resp.text().await?;
11589        let entity: Option<RetrievePasswordValidationRulesWithIdError> = serde_json::from_str(&content).ok();
11590        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11591    }
11592}
11593
11594/// Retrieves the password validation rules for a specific tenant.  This API does not require an API key.
11595pub async fn retrieve_password_validation_rules_with_tenant_id_with_id(configuration: &configuration::Configuration, tenant_id: &str) -> Result<models::PasswordValidationRulesResponse, Error<RetrievePasswordValidationRulesWithTenantIdWithIdError>> {
11596    // add a prefix to parameters to efficiently prevent name collisions
11597    let p_path_tenant_id = tenant_id;
11598
11599    let uri_str = format!("{}/api/tenant/password-validation-rules/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
11600    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11601
11602    if let Some(ref user_agent) = configuration.user_agent {
11603        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11604    }
11605    if let Some(ref apikey) = configuration.api_key {
11606        let key = apikey.key.clone();
11607        let value = match apikey.prefix {
11608            Some(ref prefix) => format!("{} {}", prefix, key),
11609            None => key,
11610        };
11611        req_builder = req_builder.header("Authorization", value);
11612    };
11613
11614    let req = req_builder.build()?;
11615    let resp = configuration.client.execute(req).await?;
11616
11617    let status = resp.status();
11618    let content_type = resp
11619        .headers()
11620        .get("content-type")
11621        .and_then(|v| v.to_str().ok())
11622        .unwrap_or("application/octet-stream");
11623    let content_type = super::ContentType::from(content_type);
11624
11625    if !status.is_client_error() && !status.is_server_error() {
11626        let content = resp.text().await?;
11627        match content_type {
11628            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11629            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordValidationRulesResponse`"))),
11630            ContentType::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`")))),
11631        }
11632    } else {
11633        let content = resp.text().await?;
11634        let entity: Option<RetrievePasswordValidationRulesWithTenantIdWithIdError> = serde_json::from_str(&content).ok();
11635        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11636    }
11637}
11638
11639/// Retrieves all the children for the given parent email address.
11640pub async fn retrieve_pending_children_with_id(configuration: &configuration::Configuration, parent_email: Option<&str>) -> Result<models::PendingResponse, Error<RetrievePendingChildrenWithIdError>> {
11641    // add a prefix to parameters to efficiently prevent name collisions
11642    let p_query_parent_email = parent_email;
11643
11644    let uri_str = format!("{}/api/user/family/pending", configuration.base_path);
11645    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11646
11647    if let Some(ref param_value) = p_query_parent_email {
11648        req_builder = req_builder.query(&[("parentEmail", &param_value.to_string())]);
11649    }
11650    if let Some(ref user_agent) = configuration.user_agent {
11651        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11652    }
11653    if let Some(ref apikey) = configuration.api_key {
11654        let key = apikey.key.clone();
11655        let value = match apikey.prefix {
11656            Some(ref prefix) => format!("{} {}", prefix, key),
11657            None => key,
11658        };
11659        req_builder = req_builder.header("Authorization", value);
11660    };
11661
11662    let req = req_builder.build()?;
11663    let resp = configuration.client.execute(req).await?;
11664
11665    let status = resp.status();
11666    let content_type = resp
11667        .headers()
11668        .get("content-type")
11669        .and_then(|v| v.to_str().ok())
11670        .unwrap_or("application/octet-stream");
11671    let content_type = super::ContentType::from(content_type);
11672
11673    if !status.is_client_error() && !status.is_server_error() {
11674        let content = resp.text().await?;
11675        match content_type {
11676            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11677            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PendingResponse`"))),
11678            ContentType::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`")))),
11679        }
11680    } else {
11681        let content = resp.text().await?;
11682        let entity: Option<RetrievePendingChildrenWithIdError> = serde_json::from_str(&content).ok();
11683        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11684    }
11685}
11686
11687/// Retrieve a pending identity provider link. This is useful to validate a pending link and retrieve meta-data about the identity provider link.
11688pub async fn retrieve_pending_link_with_id(configuration: &configuration::Configuration, pending_link_id: &str, user_id: Option<&str>) -> Result<models::IdentityProviderPendingLinkResponse, Error<RetrievePendingLinkWithIdError>> {
11689    // add a prefix to parameters to efficiently prevent name collisions
11690    let p_path_pending_link_id = pending_link_id;
11691    let p_query_user_id = user_id;
11692
11693    let uri_str = format!("{}/api/identity-provider/link/pending/{pendingLinkId}", configuration.base_path, pendingLinkId=crate::apis::urlencode(p_path_pending_link_id));
11694    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11695
11696    if let Some(ref param_value) = p_query_user_id {
11697        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11698    }
11699    if let Some(ref user_agent) = configuration.user_agent {
11700        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11701    }
11702    if let Some(ref apikey) = configuration.api_key {
11703        let key = apikey.key.clone();
11704        let value = match apikey.prefix {
11705            Some(ref prefix) => format!("{} {}", prefix, key),
11706            None => key,
11707        };
11708        req_builder = req_builder.header("Authorization", value);
11709    };
11710
11711    let req = req_builder.build()?;
11712    let resp = configuration.client.execute(req).await?;
11713
11714    let status = resp.status();
11715    let content_type = resp
11716        .headers()
11717        .get("content-type")
11718        .and_then(|v| v.to_str().ok())
11719        .unwrap_or("application/octet-stream");
11720    let content_type = super::ContentType::from(content_type);
11721
11722    if !status.is_client_error() && !status.is_server_error() {
11723        let content = resp.text().await?;
11724        match content_type {
11725            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11726            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderPendingLinkResponse`"))),
11727            ContentType::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`")))),
11728        }
11729    } else {
11730        let content = resp.text().await?;
11731        let entity: Option<RetrievePendingLinkWithIdError> = serde_json::from_str(&content).ok();
11732        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11733    }
11734}
11735
11736/// Retrieves the FusionAuth Reactor metrics.
11737pub async fn retrieve_reactor_metrics_with_id(configuration: &configuration::Configuration, ) -> Result<models::ReactorMetricsResponse, Error<RetrieveReactorMetricsWithIdError>> {
11738
11739    let uri_str = format!("{}/api/reactor/metrics", configuration.base_path);
11740    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11741
11742    if let Some(ref user_agent) = configuration.user_agent {
11743        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11744    }
11745    if let Some(ref apikey) = configuration.api_key {
11746        let key = apikey.key.clone();
11747        let value = match apikey.prefix {
11748            Some(ref prefix) => format!("{} {}", prefix, key),
11749            None => key,
11750        };
11751        req_builder = req_builder.header("Authorization", value);
11752    };
11753
11754    let req = req_builder.build()?;
11755    let resp = configuration.client.execute(req).await?;
11756
11757    let status = resp.status();
11758    let content_type = resp
11759        .headers()
11760        .get("content-type")
11761        .and_then(|v| v.to_str().ok())
11762        .unwrap_or("application/octet-stream");
11763    let content_type = super::ContentType::from(content_type);
11764
11765    if !status.is_client_error() && !status.is_server_error() {
11766        let content = resp.text().await?;
11767        match content_type {
11768            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11769            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReactorMetricsResponse`"))),
11770            ContentType::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`")))),
11771        }
11772    } else {
11773        let content = resp.text().await?;
11774        let entity: Option<RetrieveReactorMetricsWithIdError> = serde_json::from_str(&content).ok();
11775        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11776    }
11777}
11778
11779/// 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.
11780pub async fn retrieve_refresh_token_by_id_with_id(configuration: &configuration::Configuration, token_id: &str) -> Result<models::RefreshTokenResponse, Error<RetrieveRefreshTokenByIdWithIdError>> {
11781    // add a prefix to parameters to efficiently prevent name collisions
11782    let p_path_token_id = token_id;
11783
11784    let uri_str = format!("{}/api/jwt/refresh/{tokenId}", configuration.base_path, tokenId=crate::apis::urlencode(p_path_token_id));
11785    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11786
11787    if let Some(ref user_agent) = configuration.user_agent {
11788        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11789    }
11790    if let Some(ref apikey) = configuration.api_key {
11791        let key = apikey.key.clone();
11792        let value = match apikey.prefix {
11793            Some(ref prefix) => format!("{} {}", prefix, key),
11794            None => key,
11795        };
11796        req_builder = req_builder.header("Authorization", value);
11797    };
11798
11799    let req = req_builder.build()?;
11800    let resp = configuration.client.execute(req).await?;
11801
11802    let status = resp.status();
11803    let content_type = resp
11804        .headers()
11805        .get("content-type")
11806        .and_then(|v| v.to_str().ok())
11807        .unwrap_or("application/octet-stream");
11808    let content_type = super::ContentType::from(content_type);
11809
11810    if !status.is_client_error() && !status.is_server_error() {
11811        let content = resp.text().await?;
11812        match content_type {
11813            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11814            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefreshTokenResponse`"))),
11815            ContentType::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`")))),
11816        }
11817    } else {
11818        let content = resp.text().await?;
11819        let entity: Option<RetrieveRefreshTokenByIdWithIdError> = serde_json::from_str(&content).ok();
11820        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11821    }
11822}
11823
11824/// Retrieves the refresh tokens that belong to the user with the given Id.
11825pub async fn retrieve_refresh_tokens_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::RefreshTokenResponse, Error<RetrieveRefreshTokensWithIdError>> {
11826    // add a prefix to parameters to efficiently prevent name collisions
11827    let p_query_user_id = user_id;
11828
11829    let uri_str = format!("{}/api/jwt/refresh", configuration.base_path);
11830    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11831
11832    if let Some(ref param_value) = p_query_user_id {
11833        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
11834    }
11835    if let Some(ref user_agent) = configuration.user_agent {
11836        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
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::RefreshTokenResponse`"))),
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::RefreshTokenResponse`")))),
11864        }
11865    } else {
11866        let content = resp.text().await?;
11867        let entity: Option<RetrieveRefreshTokensWithIdError> = serde_json::from_str(&content).ok();
11868        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11869    }
11870}
11871
11872/// Retrieves the registration report between the two instants. If you specify an application Id, it will only return the registration counts for that application.
11873pub 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>> {
11874    // add a prefix to parameters to efficiently prevent name collisions
11875    let p_query_application_id = application_id;
11876    let p_query_start = start;
11877    let p_query_end = end;
11878
11879    let uri_str = format!("{}/api/report/registration", configuration.base_path);
11880    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11881
11882    if let Some(ref param_value) = p_query_application_id {
11883        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11884    }
11885    if let Some(ref param_value) = p_query_start {
11886        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11887    }
11888    if let Some(ref param_value) = p_query_end {
11889        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
11890    }
11891    if let Some(ref user_agent) = configuration.user_agent {
11892        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11893    }
11894    if let Some(ref apikey) = configuration.api_key {
11895        let key = apikey.key.clone();
11896        let value = match apikey.prefix {
11897            Some(ref prefix) => format!("{} {}", prefix, key),
11898            None => key,
11899        };
11900        req_builder = req_builder.header("Authorization", value);
11901    };
11902
11903    let req = req_builder.build()?;
11904    let resp = configuration.client.execute(req).await?;
11905
11906    let status = resp.status();
11907    let content_type = resp
11908        .headers()
11909        .get("content-type")
11910        .and_then(|v| v.to_str().ok())
11911        .unwrap_or("application/octet-stream");
11912    let content_type = super::ContentType::from(content_type);
11913
11914    if !status.is_client_error() && !status.is_server_error() {
11915        let content = resp.text().await?;
11916        match content_type {
11917            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11918            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationReportResponse`"))),
11919            ContentType::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`")))),
11920        }
11921    } else {
11922        let content = resp.text().await?;
11923        let entity: Option<RetrieveRegistrationReportWithIdError> = serde_json::from_str(&content).ok();
11924        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11925    }
11926}
11927
11928/// Retrieves the user registration for the user with the given Id and the given application Id.
11929pub 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>> {
11930    // add a prefix to parameters to efficiently prevent name collisions
11931    let p_path_user_id = user_id;
11932    let p_path_application_id = application_id;
11933    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
11934
11935    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));
11936    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11937
11938    if let Some(ref user_agent) = configuration.user_agent {
11939        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11940    }
11941    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
11942        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
11943    }
11944    if let Some(ref apikey) = configuration.api_key {
11945        let key = apikey.key.clone();
11946        let value = match apikey.prefix {
11947            Some(ref prefix) => format!("{} {}", prefix, key),
11948            None => key,
11949        };
11950        req_builder = req_builder.header("Authorization", value);
11951    };
11952
11953    let req = req_builder.build()?;
11954    let resp = configuration.client.execute(req).await?;
11955
11956    let status = resp.status();
11957    let content_type = resp
11958        .headers()
11959        .get("content-type")
11960        .and_then(|v| v.to_str().ok())
11961        .unwrap_or("application/octet-stream");
11962    let content_type = super::ContentType::from(content_type);
11963
11964    if !status.is_client_error() && !status.is_server_error() {
11965        let content = resp.text().await?;
11966        match content_type {
11967            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11968            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
11969            ContentType::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`")))),
11970        }
11971    } else {
11972        let content = resp.text().await?;
11973        let entity: Option<RetrieveRegistrationWithIdError> = serde_json::from_str(&content).ok();
11974        Err(Error::ResponseError(ResponseContent { status, content, entity }))
11975    }
11976}
11977
11978/// 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.
11979pub 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>> {
11980    // add a prefix to parameters to efficiently prevent name collisions
11981    let p_query_application_id = application_id;
11982    let p_query_login_id = login_id;
11983    let p_query_start = start;
11984    let p_query_end = end;
11985    let p_query_login_id_types = login_id_types;
11986    let p_query_user_id = user_id;
11987
11988    let uri_str = format!("{}/api/report/login", configuration.base_path);
11989    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11990
11991    if let Some(ref param_value) = p_query_application_id {
11992        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
11993    }
11994    if let Some(ref param_value) = p_query_login_id {
11995        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
11996    }
11997    if let Some(ref param_value) = p_query_start {
11998        req_builder = req_builder.query(&[("start", &param_value.to_string())]);
11999    }
12000    if let Some(ref param_value) = p_query_end {
12001        req_builder = req_builder.query(&[("end", &param_value.to_string())]);
12002    }
12003    if let Some(ref param_value) = p_query_login_id_types {
12004        req_builder = match "multi" {
12005            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("loginIdTypes".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
12006            _ => req_builder.query(&[("loginIdTypes", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
12007        };
12008    }
12009    if let Some(ref param_value) = p_query_user_id {
12010        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12011    }
12012    if let Some(ref user_agent) = configuration.user_agent {
12013        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12014    }
12015    if let Some(ref apikey) = configuration.api_key {
12016        let key = apikey.key.clone();
12017        let value = match apikey.prefix {
12018            Some(ref prefix) => format!("{} {}", prefix, key),
12019            None => key,
12020        };
12021        req_builder = req_builder.header("Authorization", value);
12022    };
12023
12024    let req = req_builder.build()?;
12025    let resp = configuration.client.execute(req).await?;
12026
12027    let status = resp.status();
12028    let content_type = resp
12029        .headers()
12030        .get("content-type")
12031        .and_then(|v| v.to_str().ok())
12032        .unwrap_or("application/octet-stream");
12033    let content_type = super::ContentType::from(content_type);
12034
12035    if !status.is_client_error() && !status.is_server_error() {
12036        let content = resp.text().await?;
12037        match content_type {
12038            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12039            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginReportResponse`"))),
12040            ContentType::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`")))),
12041        }
12042    } else {
12043        let content = resp.text().await?;
12044        let entity: Option<RetrieveReportLoginError> = serde_json::from_str(&content).ok();
12045        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12046    }
12047}
12048
12049/// 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.
12050pub async fn retrieve_status(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RetrieveStatusError>> {
12051
12052    let uri_str = format!("{}/api/status", configuration.base_path);
12053    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12054
12055    if let Some(ref user_agent) = configuration.user_agent {
12056        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12057    }
12058    if let Some(ref apikey) = configuration.api_key {
12059        let key = apikey.key.clone();
12060        let value = match apikey.prefix {
12061            Some(ref prefix) => format!("{} {}", prefix, key),
12062            None => key,
12063        };
12064        req_builder = req_builder.header("Authorization", value);
12065    };
12066
12067    let req = req_builder.build()?;
12068    let resp = configuration.client.execute(req).await?;
12069
12070    let status = resp.status();
12071    let content_type = resp
12072        .headers()
12073        .get("content-type")
12074        .and_then(|v| v.to_str().ok())
12075        .unwrap_or("application/octet-stream");
12076    let content_type = super::ContentType::from(content_type);
12077
12078    if !status.is_client_error() && !status.is_server_error() {
12079        let content = resp.text().await?;
12080        match content_type {
12081            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12082            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
12083            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`")))),
12084        }
12085    } else {
12086        let content = resp.text().await?;
12087        let entity: Option<RetrieveStatusError> = serde_json::from_str(&content).ok();
12088        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12089    }
12090}
12091
12092/// Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.
12093pub async fn retrieve_system_health_with_id(configuration: &configuration::Configuration, ) -> Result<(), Error<RetrieveSystemHealthWithIdError>> {
12094
12095    let uri_str = format!("{}/api/health", configuration.base_path);
12096    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12097
12098    if let Some(ref user_agent) = configuration.user_agent {
12099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12100    }
12101    if let Some(ref apikey) = configuration.api_key {
12102        let key = apikey.key.clone();
12103        let value = match apikey.prefix {
12104            Some(ref prefix) => format!("{} {}", prefix, key),
12105            None => key,
12106        };
12107        req_builder = req_builder.header("Authorization", value);
12108    };
12109
12110    let req = req_builder.build()?;
12111    let resp = configuration.client.execute(req).await?;
12112
12113    let status = resp.status();
12114
12115    if !status.is_client_error() && !status.is_server_error() {
12116        Ok(())
12117    } else {
12118        let content = resp.text().await?;
12119        let entity: Option<RetrieveSystemHealthWithIdError> = serde_json::from_str(&content).ok();
12120        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12121    }
12122}
12123
12124/// Retrieves the tenant for the given Id.
12125pub async fn retrieve_tenant_with_id(configuration: &configuration::Configuration, tenant_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::TenantResponse, Error<RetrieveTenantWithIdError>> {
12126    // add a prefix to parameters to efficiently prevent name collisions
12127    let p_path_tenant_id = tenant_id;
12128    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12129
12130    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
12131    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12132
12133    if let Some(ref user_agent) = configuration.user_agent {
12134        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12135    }
12136    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12137        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12138    }
12139    if let Some(ref apikey) = configuration.api_key {
12140        let key = apikey.key.clone();
12141        let value = match apikey.prefix {
12142            Some(ref prefix) => format!("{} {}", prefix, key),
12143            None => key,
12144        };
12145        req_builder = req_builder.header("Authorization", value);
12146    };
12147
12148    let req = req_builder.build()?;
12149    let resp = configuration.client.execute(req).await?;
12150
12151    let status = resp.status();
12152    let content_type = resp
12153        .headers()
12154        .get("content-type")
12155        .and_then(|v| v.to_str().ok())
12156        .unwrap_or("application/octet-stream");
12157    let content_type = super::ContentType::from(content_type);
12158
12159    if !status.is_client_error() && !status.is_server_error() {
12160        let content = resp.text().await?;
12161        match content_type {
12162            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12163            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
12164            ContentType::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`")))),
12165        }
12166    } else {
12167        let content = resp.text().await?;
12168        let entity: Option<RetrieveTenantWithIdError> = serde_json::from_str(&content).ok();
12169        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12170    }
12171}
12172
12173/// Retrieves the theme for the given Id.
12174pub async fn retrieve_theme_with_id(configuration: &configuration::Configuration, theme_id: &str) -> Result<models::ThemeResponse, Error<RetrieveThemeWithIdError>> {
12175    // add a prefix to parameters to efficiently prevent name collisions
12176    let p_path_theme_id = theme_id;
12177
12178    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
12179    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12180
12181    if let Some(ref user_agent) = configuration.user_agent {
12182        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12183    }
12184    if let Some(ref apikey) = configuration.api_key {
12185        let key = apikey.key.clone();
12186        let value = match apikey.prefix {
12187            Some(ref prefix) => format!("{} {}", prefix, key),
12188            None => key,
12189        };
12190        req_builder = req_builder.header("Authorization", value);
12191    };
12192
12193    let req = req_builder.build()?;
12194    let resp = configuration.client.execute(req).await?;
12195
12196    let status = resp.status();
12197    let content_type = resp
12198        .headers()
12199        .get("content-type")
12200        .and_then(|v| v.to_str().ok())
12201        .unwrap_or("application/octet-stream");
12202    let content_type = super::ContentType::from(content_type);
12203
12204    if !status.is_client_error() && !status.is_server_error() {
12205        let content = resp.text().await?;
12206        match content_type {
12207            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12208            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
12209            ContentType::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`")))),
12210        }
12211    } else {
12212        let content = resp.text().await?;
12213        let entity: Option<RetrieveThemeWithIdError> = serde_json::from_str(&content).ok();
12214        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12215    }
12216}
12217
12218/// Retrieves the totals report. This allows excluding applicationTotals from the report. An empty list will include the applicationTotals.
12219pub async fn retrieve_total_report_with_excludes_with_id(configuration: &configuration::Configuration, excludes: Option<Vec<String>>) -> Result<models::TotalsReportResponse, Error<RetrieveTotalReportWithExcludesWithIdError>> {
12220    // add a prefix to parameters to efficiently prevent name collisions
12221    let p_query_excludes = excludes;
12222
12223    let uri_str = format!("{}/api/report/totals", configuration.base_path);
12224    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12225
12226    if let Some(ref param_value) = p_query_excludes {
12227        req_builder = match "multi" {
12228            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("excludes".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
12229            _ => req_builder.query(&[("excludes", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
12230        };
12231    }
12232    if let Some(ref user_agent) = configuration.user_agent {
12233        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12234    }
12235    if let Some(ref apikey) = configuration.api_key {
12236        let key = apikey.key.clone();
12237        let value = match apikey.prefix {
12238            Some(ref prefix) => format!("{} {}", prefix, key),
12239            None => key,
12240        };
12241        req_builder = req_builder.header("Authorization", value);
12242    };
12243
12244    let req = req_builder.build()?;
12245    let resp = configuration.client.execute(req).await?;
12246
12247    let status = resp.status();
12248    let content_type = resp
12249        .headers()
12250        .get("content-type")
12251        .and_then(|v| v.to_str().ok())
12252        .unwrap_or("application/octet-stream");
12253    let content_type = super::ContentType::from(content_type);
12254
12255    if !status.is_client_error() && !status.is_server_error() {
12256        let content = resp.text().await?;
12257        match content_type {
12258            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12259            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TotalsReportResponse`"))),
12260            ContentType::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`")))),
12261        }
12262    } else {
12263        let content = resp.text().await?;
12264        let entity: Option<RetrieveTotalReportWithExcludesWithIdError> = serde_json::from_str(&content).ok();
12265        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12266    }
12267}
12268
12269/// Retrieve two-factor recovery codes for a user.
12270pub async fn retrieve_two_factor_recovery_codes_with_id(configuration: &configuration::Configuration, user_id: &str) -> Result<models::TwoFactorRecoveryCodeResponse, Error<RetrieveTwoFactorRecoveryCodesWithIdError>> {
12271    // add a prefix to parameters to efficiently prevent name collisions
12272    let p_path_user_id = user_id;
12273
12274    let uri_str = format!("{}/api/user/two-factor/recovery-code/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
12275    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12276
12277    if let Some(ref user_agent) = configuration.user_agent {
12278        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12279    }
12280    if let Some(ref apikey) = configuration.api_key {
12281        let key = apikey.key.clone();
12282        let value = match apikey.prefix {
12283            Some(ref prefix) => format!("{} {}", prefix, key),
12284            None => key,
12285        };
12286        req_builder = req_builder.header("Authorization", value);
12287    };
12288
12289    let req = req_builder.build()?;
12290    let resp = configuration.client.execute(req).await?;
12291
12292    let status = resp.status();
12293    let content_type = resp
12294        .headers()
12295        .get("content-type")
12296        .and_then(|v| v.to_str().ok())
12297        .unwrap_or("application/octet-stream");
12298    let content_type = super::ContentType::from(content_type);
12299
12300    if !status.is_client_error() && !status.is_server_error() {
12301        let content = resp.text().await?;
12302        match content_type {
12303            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12304            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorRecoveryCodeResponse`"))),
12305            ContentType::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`")))),
12306        }
12307    } else {
12308        let content = resp.text().await?;
12309        let entity: Option<RetrieveTwoFactorRecoveryCodesWithIdError> = serde_json::from_str(&content).ok();
12310        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12311    }
12312}
12313
12314/// 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.
12315pub 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>> {
12316    // add a prefix to parameters to efficiently prevent name collisions
12317    let p_path_two_factor_trust_id = two_factor_trust_id;
12318    let p_query_user_id = user_id;
12319    let p_query_application_id = application_id;
12320
12321    let uri_str = format!("{}/api/two-factor/status/{twoFactorTrustId}", configuration.base_path, twoFactorTrustId=crate::apis::urlencode(p_path_two_factor_trust_id));
12322    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12323
12324    if let Some(ref param_value) = p_query_user_id {
12325        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12326    }
12327    if let Some(ref param_value) = p_query_application_id {
12328        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
12329    }
12330    if let Some(ref user_agent) = configuration.user_agent {
12331        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12332    }
12333    if let Some(ref apikey) = configuration.api_key {
12334        let key = apikey.key.clone();
12335        let value = match apikey.prefix {
12336            Some(ref prefix) => format!("{} {}", prefix, key),
12337            None => key,
12338        };
12339        req_builder = req_builder.header("Authorization", value);
12340    };
12341
12342    let req = req_builder.build()?;
12343    let resp = configuration.client.execute(req).await?;
12344
12345    let status = resp.status();
12346    let content_type = resp
12347        .headers()
12348        .get("content-type")
12349        .and_then(|v| v.to_str().ok())
12350        .unwrap_or("application/octet-stream");
12351    let content_type = super::ContentType::from(content_type);
12352
12353    if !status.is_client_error() && !status.is_server_error() {
12354        let content = resp.text().await?;
12355        match content_type {
12356            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12357            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStatusResponse`"))),
12358            ContentType::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`")))),
12359        }
12360    } else {
12361        let content = resp.text().await?;
12362        let entity: Option<RetrieveTwoFactorStatusWithIdError> = serde_json::from_str(&content).ok();
12363        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12364    }
12365}
12366
12367/// 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. This operation provides more payload options than retrieveTwoFactorStatus.
12368pub async fn retrieve_two_factor_status_with_request_with_id(configuration: &configuration::Configuration, two_factor_status_request: Option<models::TwoFactorStatusRequest>) -> Result<models::TwoFactorStatusResponse, Error<RetrieveTwoFactorStatusWithRequestWithIdError>> {
12369    // add a prefix to parameters to efficiently prevent name collisions
12370    let p_body_two_factor_status_request = two_factor_status_request;
12371
12372    let uri_str = format!("{}/api/two-factor/status", configuration.base_path);
12373    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
12374
12375    if let Some(ref user_agent) = configuration.user_agent {
12376        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12377    }
12378    if let Some(ref apikey) = configuration.api_key {
12379        let key = apikey.key.clone();
12380        let value = match apikey.prefix {
12381            Some(ref prefix) => format!("{} {}", prefix, key),
12382            None => key,
12383        };
12384        req_builder = req_builder.header("Authorization", value);
12385    };
12386    req_builder = req_builder.json(&p_body_two_factor_status_request);
12387
12388    let req = req_builder.build()?;
12389    let resp = configuration.client.execute(req).await?;
12390
12391    let status = resp.status();
12392    let content_type = resp
12393        .headers()
12394        .get("content-type")
12395        .and_then(|v| v.to_str().ok())
12396        .unwrap_or("application/octet-stream");
12397    let content_type = super::ContentType::from(content_type);
12398
12399    if !status.is_client_error() && !status.is_server_error() {
12400        let content = resp.text().await?;
12401        match content_type {
12402            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12403            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStatusResponse`"))),
12404            ContentType::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`")))),
12405        }
12406    } else {
12407        let content = resp.text().await?;
12408        let entity: Option<RetrieveTwoFactorStatusWithRequestWithIdError> = serde_json::from_str(&content).ok();
12409        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12410    }
12411}
12412
12413/// 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.
12414pub 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>> {
12415    // add a prefix to parameters to efficiently prevent name collisions
12416    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12417    let p_query_verification_id = verification_id;
12418    let p_query_username = username;
12419    let p_query_login_id = login_id;
12420    let p_query_login_id_types = login_id_types;
12421    let p_query_email = email;
12422    let p_query_change_password_id = change_password_id;
12423
12424    let uri_str = format!("{}/api/user", configuration.base_path);
12425    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12426
12427    if let Some(ref param_value) = p_query_verification_id {
12428        req_builder = req_builder.query(&[("verificationId", &param_value.to_string())]);
12429    }
12430    if let Some(ref param_value) = p_query_username {
12431        req_builder = req_builder.query(&[("username", &param_value.to_string())]);
12432    }
12433    if let Some(ref param_value) = p_query_login_id {
12434        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
12435    }
12436    if let Some(ref param_value) = p_query_login_id_types {
12437        req_builder = match "multi" {
12438            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("loginIdTypes".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
12439            _ => req_builder.query(&[("loginIdTypes", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
12440        };
12441    }
12442    if let Some(ref param_value) = p_query_email {
12443        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
12444    }
12445    if let Some(ref param_value) = p_query_change_password_id {
12446        req_builder = req_builder.query(&[("changePasswordId", &param_value.to_string())]);
12447    }
12448    if let Some(ref user_agent) = configuration.user_agent {
12449        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12450    }
12451    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12452        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12453    }
12454    if let Some(ref token) = configuration.bearer_access_token {
12455        req_builder = req_builder.bearer_auth(token.to_owned());
12456    };
12457
12458    let req = req_builder.build()?;
12459    let resp = configuration.client.execute(req).await?;
12460
12461    let status = resp.status();
12462    let content_type = resp
12463        .headers()
12464        .get("content-type")
12465        .and_then(|v| v.to_str().ok())
12466        .unwrap_or("application/octet-stream");
12467    let content_type = super::ContentType::from(content_type);
12468
12469    if !status.is_client_error() && !status.is_server_error() {
12470        let content = resp.text().await?;
12471        match content_type {
12472            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12473            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
12474            ContentType::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`")))),
12475        }
12476    } else {
12477        let content = resp.text().await?;
12478        let entity: Option<RetrieveUserError> = serde_json::from_str(&content).ok();
12479        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12480    }
12481}
12482
12483/// 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.
12484pub async fn retrieve_user_action(configuration: &configuration::Configuration, x_fusion_auth_tenant_id: Option<&str>, inactive: Option<&str>) -> Result<models::UserActionResponse, Error<RetrieveUserActionError>> {
12485    // add a prefix to parameters to efficiently prevent name collisions
12486    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12487    let p_query_inactive = inactive;
12488
12489    let uri_str = format!("{}/api/user-action", configuration.base_path);
12490    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12491
12492    if let Some(ref param_value) = p_query_inactive {
12493        req_builder = req_builder.query(&[("inactive", &param_value.to_string())]);
12494    }
12495    if let Some(ref user_agent) = configuration.user_agent {
12496        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12497    }
12498    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12499        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12500    }
12501    if let Some(ref apikey) = configuration.api_key {
12502        let key = apikey.key.clone();
12503        let value = match apikey.prefix {
12504            Some(ref prefix) => format!("{} {}", prefix, key),
12505            None => key,
12506        };
12507        req_builder = req_builder.header("Authorization", value);
12508    };
12509
12510    let req = req_builder.build()?;
12511    let resp = configuration.client.execute(req).await?;
12512
12513    let status = resp.status();
12514    let content_type = resp
12515        .headers()
12516        .get("content-type")
12517        .and_then(|v| v.to_str().ok())
12518        .unwrap_or("application/octet-stream");
12519    let content_type = super::ContentType::from(content_type);
12520
12521    if !status.is_client_error() && !status.is_server_error() {
12522        let content = resp.text().await?;
12523        match content_type {
12524            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12525            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
12526            ContentType::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`")))),
12527        }
12528    } else {
12529        let content = resp.text().await?;
12530        let entity: Option<RetrieveUserActionError> = serde_json::from_str(&content).ok();
12531        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12532    }
12533}
12534
12535/// 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.
12536pub async fn retrieve_user_action_reason(configuration: &configuration::Configuration, ) -> Result<models::UserActionReasonResponse, Error<RetrieveUserActionReasonError>> {
12537
12538    let uri_str = format!("{}/api/user-action-reason", configuration.base_path);
12539    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12540
12541    if let Some(ref user_agent) = configuration.user_agent {
12542        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12543    }
12544    if let Some(ref apikey) = configuration.api_key {
12545        let key = apikey.key.clone();
12546        let value = match apikey.prefix {
12547            Some(ref prefix) => format!("{} {}", prefix, key),
12548            None => key,
12549        };
12550        req_builder = req_builder.header("Authorization", value);
12551    };
12552
12553    let req = req_builder.build()?;
12554    let resp = configuration.client.execute(req).await?;
12555
12556    let status = resp.status();
12557    let content_type = resp
12558        .headers()
12559        .get("content-type")
12560        .and_then(|v| v.to_str().ok())
12561        .unwrap_or("application/octet-stream");
12562    let content_type = super::ContentType::from(content_type);
12563
12564    if !status.is_client_error() && !status.is_server_error() {
12565        let content = resp.text().await?;
12566        match content_type {
12567            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12568            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
12569            ContentType::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`")))),
12570        }
12571    } else {
12572        let content = resp.text().await?;
12573        let entity: Option<RetrieveUserActionReasonError> = serde_json::from_str(&content).ok();
12574        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12575    }
12576}
12577
12578/// 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.
12579pub async fn retrieve_user_action_reason_with_id(configuration: &configuration::Configuration, user_action_reason_id: &str) -> Result<models::UserActionReasonResponse, Error<RetrieveUserActionReasonWithIdError>> {
12580    // add a prefix to parameters to efficiently prevent name collisions
12581    let p_path_user_action_reason_id = user_action_reason_id;
12582
12583    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
12584    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12585
12586    if let Some(ref user_agent) = configuration.user_agent {
12587        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12588    }
12589    if let Some(ref apikey) = configuration.api_key {
12590        let key = apikey.key.clone();
12591        let value = match apikey.prefix {
12592            Some(ref prefix) => format!("{} {}", prefix, key),
12593            None => key,
12594        };
12595        req_builder = req_builder.header("Authorization", value);
12596    };
12597
12598    let req = req_builder.build()?;
12599    let resp = configuration.client.execute(req).await?;
12600
12601    let status = resp.status();
12602    let content_type = resp
12603        .headers()
12604        .get("content-type")
12605        .and_then(|v| v.to_str().ok())
12606        .unwrap_or("application/octet-stream");
12607    let content_type = super::ContentType::from(content_type);
12608
12609    if !status.is_client_error() && !status.is_server_error() {
12610        let content = resp.text().await?;
12611        match content_type {
12612            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12613            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionReasonResponse`"))),
12614            ContentType::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`")))),
12615        }
12616    } else {
12617        let content = resp.text().await?;
12618        let entity: Option<RetrieveUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
12619        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12620    }
12621}
12622
12623/// Retrieves the user action for the given Id. If you pass in null for the Id, this will return all the user actions.
12624pub 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>> {
12625    // add a prefix to parameters to efficiently prevent name collisions
12626    let p_path_user_action_id = user_action_id;
12627    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12628
12629    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
12630    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12631
12632    if let Some(ref user_agent) = configuration.user_agent {
12633        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12634    }
12635    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12636        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12637    }
12638    if let Some(ref apikey) = configuration.api_key {
12639        let key = apikey.key.clone();
12640        let value = match apikey.prefix {
12641            Some(ref prefix) => format!("{} {}", prefix, key),
12642            None => key,
12643        };
12644        req_builder = req_builder.header("Authorization", value);
12645    };
12646
12647    let req = req_builder.build()?;
12648    let resp = configuration.client.execute(req).await?;
12649
12650    let status = resp.status();
12651    let content_type = resp
12652        .headers()
12653        .get("content-type")
12654        .and_then(|v| v.to_str().ok())
12655        .unwrap_or("application/octet-stream");
12656    let content_type = super::ContentType::from(content_type);
12657
12658    if !status.is_client_error() && !status.is_server_error() {
12659        let content = resp.text().await?;
12660        match content_type {
12661            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12662            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
12663            ContentType::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`")))),
12664        }
12665    } else {
12666        let content = resp.text().await?;
12667        let entity: Option<RetrieveUserActionWithIdError> = serde_json::from_str(&content).ok();
12668        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12669    }
12670}
12671
12672/// 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.
12673pub async fn retrieve_user_actioning(configuration: &configuration::Configuration, user_id: Option<&str>, active: Option<&str>, preventing_login: Option<&str>) -> Result<models::ActionResponse, Error<RetrieveUserActioningError>> {
12674    // add a prefix to parameters to efficiently prevent name collisions
12675    let p_query_user_id = user_id;
12676    let p_query_active = active;
12677    let p_query_preventing_login = preventing_login;
12678
12679    let uri_str = format!("{}/api/user/action", configuration.base_path);
12680    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12681
12682    if let Some(ref param_value) = p_query_user_id {
12683        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12684    }
12685    if let Some(ref param_value) = p_query_active {
12686        req_builder = req_builder.query(&[("active", &param_value.to_string())]);
12687    }
12688    if let Some(ref param_value) = p_query_preventing_login {
12689        req_builder = req_builder.query(&[("preventingLogin", &param_value.to_string())]);
12690    }
12691    if let Some(ref user_agent) = configuration.user_agent {
12692        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12693    }
12694    if let Some(ref apikey) = configuration.api_key {
12695        let key = apikey.key.clone();
12696        let value = match apikey.prefix {
12697            Some(ref prefix) => format!("{} {}", prefix, key),
12698            None => key,
12699        };
12700        req_builder = req_builder.header("Authorization", value);
12701    };
12702
12703    let req = req_builder.build()?;
12704    let resp = configuration.client.execute(req).await?;
12705
12706    let status = resp.status();
12707    let content_type = resp
12708        .headers()
12709        .get("content-type")
12710        .and_then(|v| v.to_str().ok())
12711        .unwrap_or("application/octet-stream");
12712    let content_type = super::ContentType::from(content_type);
12713
12714    if !status.is_client_error() && !status.is_server_error() {
12715        let content = resp.text().await?;
12716        match content_type {
12717            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12718            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionResponse`"))),
12719            ContentType::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`")))),
12720        }
12721    } else {
12722        let content = resp.text().await?;
12723        let entity: Option<RetrieveUserActioningError> = serde_json::from_str(&content).ok();
12724        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12725    }
12726}
12727
12728/// 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 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 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 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. 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.
12729pub async fn retrieve_user_change_password(configuration: &configuration::Configuration, login_id: Option<&str>, login_id_types: Option<Vec<String>>, ip_address: Option<&str>) -> Result<(), Error<RetrieveUserChangePasswordError>> {
12730    // add a prefix to parameters to efficiently prevent name collisions
12731    let p_query_login_id = login_id;
12732    let p_query_login_id_types = login_id_types;
12733    let p_query_ip_address = ip_address;
12734
12735    let uri_str = format!("{}/api/user/change-password", configuration.base_path);
12736    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12737
12738    if let Some(ref param_value) = p_query_login_id {
12739        req_builder = req_builder.query(&[("loginId", &param_value.to_string())]);
12740    }
12741    if let Some(ref param_value) = p_query_login_id_types {
12742        req_builder = match "multi" {
12743            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("loginIdTypes".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
12744            _ => req_builder.query(&[("loginIdTypes", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
12745        };
12746    }
12747    if let Some(ref param_value) = p_query_ip_address {
12748        req_builder = req_builder.query(&[("ipAddress", &param_value.to_string())]);
12749    }
12750    if let Some(ref user_agent) = configuration.user_agent {
12751        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12752    }
12753    if let Some(ref apikey) = configuration.api_key {
12754        let key = apikey.key.clone();
12755        let value = match apikey.prefix {
12756            Some(ref prefix) => format!("{} {}", prefix, key),
12757            None => key,
12758        };
12759        req_builder = req_builder.header("Authorization", value);
12760    };
12761
12762    let req = req_builder.build()?;
12763    let resp = configuration.client.execute(req).await?;
12764
12765    let status = resp.status();
12766
12767    if !status.is_client_error() && !status.is_server_error() {
12768        Ok(())
12769    } else {
12770        let content = resp.text().await?;
12771        let entity: Option<RetrieveUserChangePasswordError> = serde_json::from_str(&content).ok();
12772        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12773    }
12774}
12775
12776/// 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. 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.
12777pub async fn retrieve_user_change_password_with_id(configuration: &configuration::Configuration, change_password_id: &str, ip_address: Option<&str>) -> Result<(), Error<RetrieveUserChangePasswordWithIdError>> {
12778    // add a prefix to parameters to efficiently prevent name collisions
12779    let p_path_change_password_id = change_password_id;
12780    let p_query_ip_address = ip_address;
12781
12782    let uri_str = format!("{}/api/user/change-password/{changePasswordId}", configuration.base_path, changePasswordId=crate::apis::urlencode(p_path_change_password_id));
12783    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12784
12785    if let Some(ref param_value) = p_query_ip_address {
12786        req_builder = req_builder.query(&[("ipAddress", &param_value.to_string())]);
12787    }
12788    if let Some(ref user_agent) = configuration.user_agent {
12789        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12790    }
12791    if let Some(ref apikey) = configuration.api_key {
12792        let key = apikey.key.clone();
12793        let value = match apikey.prefix {
12794            Some(ref prefix) => format!("{} {}", prefix, key),
12795            None => key,
12796        };
12797        req_builder = req_builder.header("Authorization", value);
12798    };
12799
12800    let req = req_builder.build()?;
12801    let resp = configuration.client.execute(req).await?;
12802
12803    let status = resp.status();
12804
12805    if !status.is_client_error() && !status.is_server_error() {
12806        Ok(())
12807    } else {
12808        let content = resp.text().await?;
12809        let entity: Option<RetrieveUserChangePasswordWithIdError> = serde_json::from_str(&content).ok();
12810        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12811    }
12812}
12813
12814/// Retrieves all the comments for the user with the given Id.
12815pub 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>> {
12816    // add a prefix to parameters to efficiently prevent name collisions
12817    let p_path_user_id = user_id;
12818    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
12819
12820    let uri_str = format!("{}/api/user/comment/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
12821    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12822
12823    if let Some(ref user_agent) = configuration.user_agent {
12824        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12825    }
12826    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
12827        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
12828    }
12829    if let Some(ref apikey) = configuration.api_key {
12830        let key = apikey.key.clone();
12831        let value = match apikey.prefix {
12832            Some(ref prefix) => format!("{} {}", prefix, key),
12833            None => key,
12834        };
12835        req_builder = req_builder.header("Authorization", value);
12836    };
12837
12838    let req = req_builder.build()?;
12839    let resp = configuration.client.execute(req).await?;
12840
12841    let status = resp.status();
12842    let content_type = resp
12843        .headers()
12844        .get("content-type")
12845        .and_then(|v| v.to_str().ok())
12846        .unwrap_or("application/octet-stream");
12847    let content_type = super::ContentType::from(content_type);
12848
12849    if !status.is_client_error() && !status.is_server_error() {
12850        let content = resp.text().await?;
12851        match content_type {
12852            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12853            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentResponse`"))),
12854            ContentType::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`")))),
12855        }
12856    } else {
12857        let content = resp.text().await?;
12858        let entity: Option<RetrieveUserCommentsWithIdError> = serde_json::from_str(&content).ok();
12859        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12860    }
12861}
12862
12863/// Retrieve a single User consent by Id.
12864pub async fn retrieve_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str) -> Result<models::UserConsentResponse, Error<RetrieveUserConsentWithIdError>> {
12865    // add a prefix to parameters to efficiently prevent name collisions
12866    let p_path_user_consent_id = user_consent_id;
12867
12868    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
12869    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12870
12871    if let Some(ref user_agent) = configuration.user_agent {
12872        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12873    }
12874    if let Some(ref apikey) = configuration.api_key {
12875        let key = apikey.key.clone();
12876        let value = match apikey.prefix {
12877            Some(ref prefix) => format!("{} {}", prefix, key),
12878            None => key,
12879        };
12880        req_builder = req_builder.header("Authorization", value);
12881    };
12882
12883    let req = req_builder.build()?;
12884    let resp = configuration.client.execute(req).await?;
12885
12886    let status = resp.status();
12887    let content_type = resp
12888        .headers()
12889        .get("content-type")
12890        .and_then(|v| v.to_str().ok())
12891        .unwrap_or("application/octet-stream");
12892    let content_type = super::ContentType::from(content_type);
12893
12894    if !status.is_client_error() && !status.is_server_error() {
12895        let content = resp.text().await?;
12896        match content_type {
12897            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12898            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
12899            ContentType::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`")))),
12900        }
12901    } else {
12902        let content = resp.text().await?;
12903        let entity: Option<RetrieveUserConsentWithIdError> = serde_json::from_str(&content).ok();
12904        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12905    }
12906}
12907
12908/// Retrieves all the consents for a User.
12909pub async fn retrieve_user_consents_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::UserConsentResponse, Error<RetrieveUserConsentsWithIdError>> {
12910    // add a prefix to parameters to efficiently prevent name collisions
12911    let p_query_user_id = user_id;
12912
12913    let uri_str = format!("{}/api/user/consent", configuration.base_path);
12914    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12915
12916    if let Some(ref param_value) = p_query_user_id {
12917        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
12918    }
12919    if let Some(ref user_agent) = configuration.user_agent {
12920        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12921    }
12922    if let Some(ref apikey) = configuration.api_key {
12923        let key = apikey.key.clone();
12924        let value = match apikey.prefix {
12925            Some(ref prefix) => format!("{} {}", prefix, key),
12926            None => key,
12927        };
12928        req_builder = req_builder.header("Authorization", value);
12929    };
12930
12931    let req = req_builder.build()?;
12932    let resp = configuration.client.execute(req).await?;
12933
12934    let status = resp.status();
12935    let content_type = resp
12936        .headers()
12937        .get("content-type")
12938        .and_then(|v| v.to_str().ok())
12939        .unwrap_or("application/octet-stream");
12940    let content_type = super::ContentType::from(content_type);
12941
12942    if !status.is_client_error() && !status.is_server_error() {
12943        let content = resp.text().await?;
12944        match content_type {
12945            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12946            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
12947            ContentType::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`")))),
12948        }
12949    } else {
12950        let content = resp.text().await?;
12951        let entity: Option<RetrieveUserConsentsWithIdError> = serde_json::from_str(&content).ok();
12952        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12953    }
12954}
12955
12956/// Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
12957pub async fn retrieve_user_info_from_access_token_with_id(configuration: &configuration::Configuration, ) -> Result<serde_json::Value, Error<RetrieveUserInfoFromAccessTokenWithIdError>> {
12958
12959    let uri_str = format!("{}/oauth2/userinfo", configuration.base_path);
12960    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12961
12962    if let Some(ref user_agent) = configuration.user_agent {
12963        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12964    }
12965    if let Some(ref token) = configuration.bearer_access_token {
12966        req_builder = req_builder.bearer_auth(token.to_owned());
12967    };
12968
12969    let req = req_builder.build()?;
12970    let resp = configuration.client.execute(req).await?;
12971
12972    let status = resp.status();
12973    let content_type = resp
12974        .headers()
12975        .get("content-type")
12976        .and_then(|v| v.to_str().ok())
12977        .unwrap_or("application/octet-stream");
12978    let content_type = super::ContentType::from(content_type);
12979
12980    if !status.is_client_error() && !status.is_server_error() {
12981        let content = resp.text().await?;
12982        match content_type {
12983            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12984            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
12985            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`")))),
12986        }
12987    } else {
12988        let content = resp.text().await?;
12989        let entity: Option<RetrieveUserInfoFromAccessTokenWithIdError> = serde_json::from_str(&content).ok();
12990        Err(Error::ResponseError(ResponseContent { status, content, entity }))
12991    }
12992}
12993
12994/// Retrieves the last number of login records for a user. OR Retrieves the last number of login records.
12995pub async fn retrieve_user_recent_login(configuration: &configuration::Configuration, user_id: Option<&str>, offset: Option<&str>, limit: Option<&str>) -> Result<models::RecentLoginResponse, Error<RetrieveUserRecentLoginError>> {
12996    // add a prefix to parameters to efficiently prevent name collisions
12997    let p_query_user_id = user_id;
12998    let p_query_offset = offset;
12999    let p_query_limit = limit;
13000
13001    let uri_str = format!("{}/api/user/recent-login", configuration.base_path);
13002    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13003
13004    if let Some(ref param_value) = p_query_user_id {
13005        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
13006    }
13007    if let Some(ref param_value) = p_query_offset {
13008        req_builder = req_builder.query(&[("offset", &param_value.to_string())]);
13009    }
13010    if let Some(ref param_value) = p_query_limit {
13011        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
13012    }
13013    if let Some(ref user_agent) = configuration.user_agent {
13014        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13015    }
13016    if let Some(ref apikey) = configuration.api_key {
13017        let key = apikey.key.clone();
13018        let value = match apikey.prefix {
13019            Some(ref prefix) => format!("{} {}", prefix, key),
13020            None => key,
13021        };
13022        req_builder = req_builder.header("Authorization", value);
13023    };
13024
13025    let req = req_builder.build()?;
13026    let resp = configuration.client.execute(req).await?;
13027
13028    let status = resp.status();
13029    let content_type = resp
13030        .headers()
13031        .get("content-type")
13032        .and_then(|v| v.to_str().ok())
13033        .unwrap_or("application/octet-stream");
13034    let content_type = super::ContentType::from(content_type);
13035
13036    if !status.is_client_error() && !status.is_server_error() {
13037        let content = resp.text().await?;
13038        match content_type {
13039            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13040            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RecentLoginResponse`"))),
13041            ContentType::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`")))),
13042        }
13043    } else {
13044        let content = resp.text().await?;
13045        let entity: Option<RetrieveUserRecentLoginError> = serde_json::from_str(&content).ok();
13046        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13047    }
13048}
13049
13050/// Retrieves the user for the given Id.
13051pub async fn retrieve_user_with_id(configuration: &configuration::Configuration, user_id: &str, x_fusion_auth_tenant_id: Option<&str>) -> Result<models::UserResponse, Error<RetrieveUserWithIdError>> {
13052    // add a prefix to parameters to efficiently prevent name collisions
13053    let p_path_user_id = user_id;
13054    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
13055
13056    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
13057    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13058
13059    if let Some(ref user_agent) = configuration.user_agent {
13060        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13061    }
13062    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
13063        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
13064    }
13065    if let Some(ref apikey) = configuration.api_key {
13066        let key = apikey.key.clone();
13067        let value = match apikey.prefix {
13068            Some(ref prefix) => format!("{} {}", prefix, key),
13069            None => key,
13070        };
13071        req_builder = req_builder.header("Authorization", value);
13072    };
13073
13074    let req = req_builder.build()?;
13075    let resp = configuration.client.execute(req).await?;
13076
13077    let status = resp.status();
13078    let content_type = resp
13079        .headers()
13080        .get("content-type")
13081        .and_then(|v| v.to_str().ok())
13082        .unwrap_or("application/octet-stream");
13083    let content_type = super::ContentType::from(content_type);
13084
13085    if !status.is_client_error() && !status.is_server_error() {
13086        let content = resp.text().await?;
13087        match content_type {
13088            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13089            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
13090            ContentType::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`")))),
13091        }
13092    } else {
13093        let content = resp.text().await?;
13094        let entity: Option<RetrieveUserWithIdError> = serde_json::from_str(&content).ok();
13095        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13096    }
13097}
13098
13099/// Retrieves the FusionAuth version string.
13100pub async fn retrieve_version_with_id(configuration: &configuration::Configuration, ) -> Result<models::VersionResponse, Error<RetrieveVersionWithIdError>> {
13101
13102    let uri_str = format!("{}/api/system/version", configuration.base_path);
13103    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13104
13105    if let Some(ref user_agent) = configuration.user_agent {
13106        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13107    }
13108    if let Some(ref apikey) = configuration.api_key {
13109        let key = apikey.key.clone();
13110        let value = match apikey.prefix {
13111            Some(ref prefix) => format!("{} {}", prefix, key),
13112            None => key,
13113        };
13114        req_builder = req_builder.header("Authorization", value);
13115    };
13116
13117    let req = req_builder.build()?;
13118    let resp = configuration.client.execute(req).await?;
13119
13120    let status = resp.status();
13121    let content_type = resp
13122        .headers()
13123        .get("content-type")
13124        .and_then(|v| v.to_str().ok())
13125        .unwrap_or("application/octet-stream");
13126    let content_type = super::ContentType::from(content_type);
13127
13128    if !status.is_client_error() && !status.is_server_error() {
13129        let content = resp.text().await?;
13130        match content_type {
13131            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13132            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VersionResponse`"))),
13133            ContentType::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`")))),
13134        }
13135    } else {
13136        let content = resp.text().await?;
13137        let entity: Option<RetrieveVersionWithIdError> = serde_json::from_str(&content).ok();
13138        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13139    }
13140}
13141
13142/// Retrieves the WebAuthn credential for the given Id.
13143pub async fn retrieve_web_authn_credential_with_id(configuration: &configuration::Configuration, id: &str) -> Result<models::WebAuthnCredentialResponse, Error<RetrieveWebAuthnCredentialWithIdError>> {
13144    // add a prefix to parameters to efficiently prevent name collisions
13145    let p_path_id = id;
13146
13147    let uri_str = format!("{}/api/webauthn/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
13148    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13149
13150    if let Some(ref user_agent) = configuration.user_agent {
13151        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13152    }
13153    if let Some(ref apikey) = configuration.api_key {
13154        let key = apikey.key.clone();
13155        let value = match apikey.prefix {
13156            Some(ref prefix) => format!("{} {}", prefix, key),
13157            None => key,
13158        };
13159        req_builder = req_builder.header("Authorization", value);
13160    };
13161
13162    let req = req_builder.build()?;
13163    let resp = configuration.client.execute(req).await?;
13164
13165    let status = resp.status();
13166    let content_type = resp
13167        .headers()
13168        .get("content-type")
13169        .and_then(|v| v.to_str().ok())
13170        .unwrap_or("application/octet-stream");
13171    let content_type = super::ContentType::from(content_type);
13172
13173    if !status.is_client_error() && !status.is_server_error() {
13174        let content = resp.text().await?;
13175        match content_type {
13176            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13177            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponse`"))),
13178            ContentType::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`")))),
13179        }
13180    } else {
13181        let content = resp.text().await?;
13182        let entity: Option<RetrieveWebAuthnCredentialWithIdError> = serde_json::from_str(&content).ok();
13183        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13184    }
13185}
13186
13187/// Retrieves all WebAuthn credentials for the given user.
13188pub async fn retrieve_web_authn_credentials_for_user_with_id(configuration: &configuration::Configuration, user_id: Option<&str>) -> Result<models::WebAuthnCredentialResponse, Error<RetrieveWebAuthnCredentialsForUserWithIdError>> {
13189    // add a prefix to parameters to efficiently prevent name collisions
13190    let p_query_user_id = user_id;
13191
13192    let uri_str = format!("{}/api/webauthn", configuration.base_path);
13193    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13194
13195    if let Some(ref param_value) = p_query_user_id {
13196        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
13197    }
13198    if let Some(ref user_agent) = configuration.user_agent {
13199        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13200    }
13201    if let Some(ref apikey) = configuration.api_key {
13202        let key = apikey.key.clone();
13203        let value = match apikey.prefix {
13204            Some(ref prefix) => format!("{} {}", prefix, key),
13205            None => key,
13206        };
13207        req_builder = req_builder.header("Authorization", value);
13208    };
13209
13210    let req = req_builder.build()?;
13211    let resp = configuration.client.execute(req).await?;
13212
13213    let status = resp.status();
13214    let content_type = resp
13215        .headers()
13216        .get("content-type")
13217        .and_then(|v| v.to_str().ok())
13218        .unwrap_or("application/octet-stream");
13219    let content_type = super::ContentType::from(content_type);
13220
13221    if !status.is_client_error() && !status.is_server_error() {
13222        let content = resp.text().await?;
13223        match content_type {
13224            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13225            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnCredentialResponse`"))),
13226            ContentType::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`")))),
13227        }
13228    } else {
13229        let content = resp.text().await?;
13230        let entity: Option<RetrieveWebAuthnCredentialsForUserWithIdError> = serde_json::from_str(&content).ok();
13231        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13232    }
13233}
13234
13235/// Retrieves the webhook for the given Id. If you pass in null for the Id, this will return all the webhooks.
13236pub async fn retrieve_webhook(configuration: &configuration::Configuration, ) -> Result<models::WebhookResponse, Error<RetrieveWebhookError>> {
13237
13238    let uri_str = format!("{}/api/webhook", configuration.base_path);
13239    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13240
13241    if let Some(ref user_agent) = configuration.user_agent {
13242        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13243    }
13244    if let Some(ref apikey) = configuration.api_key {
13245        let key = apikey.key.clone();
13246        let value = match apikey.prefix {
13247            Some(ref prefix) => format!("{} {}", prefix, key),
13248            None => key,
13249        };
13250        req_builder = req_builder.header("Authorization", value);
13251    };
13252
13253    let req = req_builder.build()?;
13254    let resp = configuration.client.execute(req).await?;
13255
13256    let status = resp.status();
13257    let content_type = resp
13258        .headers()
13259        .get("content-type")
13260        .and_then(|v| v.to_str().ok())
13261        .unwrap_or("application/octet-stream");
13262    let content_type = super::ContentType::from(content_type);
13263
13264    if !status.is_client_error() && !status.is_server_error() {
13265        let content = resp.text().await?;
13266        match content_type {
13267            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13268            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
13269            ContentType::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`")))),
13270        }
13271    } else {
13272        let content = resp.text().await?;
13273        let entity: Option<RetrieveWebhookError> = serde_json::from_str(&content).ok();
13274        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13275    }
13276}
13277
13278/// Retrieves a single webhook attempt log for the given Id.
13279pub async fn retrieve_webhook_attempt_log_with_id(configuration: &configuration::Configuration, webhook_attempt_log_id: &str) -> Result<models::WebhookAttemptLogResponse, Error<RetrieveWebhookAttemptLogWithIdError>> {
13280    // add a prefix to parameters to efficiently prevent name collisions
13281    let p_path_webhook_attempt_log_id = webhook_attempt_log_id;
13282
13283    let uri_str = format!("{}/api/system/webhook-attempt-log/{webhookAttemptLogId}", configuration.base_path, webhookAttemptLogId=crate::apis::urlencode(p_path_webhook_attempt_log_id));
13284    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13285
13286    if let Some(ref user_agent) = configuration.user_agent {
13287        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13288    }
13289    if let Some(ref apikey) = configuration.api_key {
13290        let key = apikey.key.clone();
13291        let value = match apikey.prefix {
13292            Some(ref prefix) => format!("{} {}", prefix, key),
13293            None => key,
13294        };
13295        req_builder = req_builder.header("Authorization", value);
13296    };
13297
13298    let req = req_builder.build()?;
13299    let resp = configuration.client.execute(req).await?;
13300
13301    let status = resp.status();
13302    let content_type = resp
13303        .headers()
13304        .get("content-type")
13305        .and_then(|v| v.to_str().ok())
13306        .unwrap_or("application/octet-stream");
13307    let content_type = super::ContentType::from(content_type);
13308
13309    if !status.is_client_error() && !status.is_server_error() {
13310        let content = resp.text().await?;
13311        match content_type {
13312            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13313            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookAttemptLogResponse`"))),
13314            ContentType::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`")))),
13315        }
13316    } else {
13317        let content = resp.text().await?;
13318        let entity: Option<RetrieveWebhookAttemptLogWithIdError> = serde_json::from_str(&content).ok();
13319        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13320    }
13321}
13322
13323/// Retrieves a single webhook event log for the given Id.
13324pub async fn retrieve_webhook_event_log_with_id(configuration: &configuration::Configuration, webhook_event_log_id: &str) -> Result<models::WebhookEventLogResponse, Error<RetrieveWebhookEventLogWithIdError>> {
13325    // add a prefix to parameters to efficiently prevent name collisions
13326    let p_path_webhook_event_log_id = webhook_event_log_id;
13327
13328    let uri_str = format!("{}/api/system/webhook-event-log/{webhookEventLogId}", configuration.base_path, webhookEventLogId=crate::apis::urlencode(p_path_webhook_event_log_id));
13329    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13330
13331    if let Some(ref user_agent) = configuration.user_agent {
13332        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13333    }
13334    if let Some(ref apikey) = configuration.api_key {
13335        let key = apikey.key.clone();
13336        let value = match apikey.prefix {
13337            Some(ref prefix) => format!("{} {}", prefix, key),
13338            None => key,
13339        };
13340        req_builder = req_builder.header("Authorization", value);
13341    };
13342
13343    let req = req_builder.build()?;
13344    let resp = configuration.client.execute(req).await?;
13345
13346    let status = resp.status();
13347    let content_type = resp
13348        .headers()
13349        .get("content-type")
13350        .and_then(|v| v.to_str().ok())
13351        .unwrap_or("application/octet-stream");
13352    let content_type = super::ContentType::from(content_type);
13353
13354    if !status.is_client_error() && !status.is_server_error() {
13355        let content = resp.text().await?;
13356        match content_type {
13357            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13358            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookEventLogResponse`"))),
13359            ContentType::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`")))),
13360        }
13361    } else {
13362        let content = resp.text().await?;
13363        let entity: Option<RetrieveWebhookEventLogWithIdError> = serde_json::from_str(&content).ok();
13364        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13365    }
13366}
13367
13368/// Retrieves the webhook for the given Id. If you pass in null for the Id, this will return all the webhooks.
13369pub async fn retrieve_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str) -> Result<models::WebhookResponse, Error<RetrieveWebhookWithIdError>> {
13370    // add a prefix to parameters to efficiently prevent name collisions
13371    let p_path_webhook_id = webhook_id;
13372
13373    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
13374    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13375
13376    if let Some(ref user_agent) = configuration.user_agent {
13377        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13378    }
13379    if let Some(ref apikey) = configuration.api_key {
13380        let key = apikey.key.clone();
13381        let value = match apikey.prefix {
13382            Some(ref prefix) => format!("{} {}", prefix, key),
13383            None => key,
13384        };
13385        req_builder = req_builder.header("Authorization", value);
13386    };
13387
13388    let req = req_builder.build()?;
13389    let resp = configuration.client.execute(req).await?;
13390
13391    let status = resp.status();
13392    let content_type = resp
13393        .headers()
13394        .get("content-type")
13395        .and_then(|v| v.to_str().ok())
13396        .unwrap_or("application/octet-stream");
13397    let content_type = super::ContentType::from(content_type);
13398
13399    if !status.is_client_error() && !status.is_server_error() {
13400        let content = resp.text().await?;
13401        match content_type {
13402            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13403            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
13404            ContentType::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`")))),
13405        }
13406    } else {
13407        let content = resp.text().await?;
13408        let entity: Option<RetrieveWebhookWithIdError> = serde_json::from_str(&content).ok();
13409        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13410    }
13411}
13412
13413/// Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.
13414pub async fn revoke_refresh_token_by_id_with_id(configuration: &configuration::Configuration, token_id: &str) -> Result<(), Error<RevokeRefreshTokenByIdWithIdError>> {
13415    // add a prefix to parameters to efficiently prevent name collisions
13416    let p_path_token_id = token_id;
13417
13418    let uri_str = format!("{}/api/jwt/refresh/{tokenId}", configuration.base_path, tokenId=crate::apis::urlencode(p_path_token_id));
13419    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
13420
13421    if let Some(ref user_agent) = configuration.user_agent {
13422        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13423    }
13424    if let Some(ref apikey) = configuration.api_key {
13425        let key = apikey.key.clone();
13426        let value = match apikey.prefix {
13427            Some(ref prefix) => format!("{} {}", prefix, key),
13428            None => key,
13429        };
13430        req_builder = req_builder.header("Authorization", value);
13431    };
13432
13433    let req = req_builder.build()?;
13434    let resp = configuration.client.execute(req).await?;
13435
13436    let status = resp.status();
13437
13438    if !status.is_client_error() && !status.is_server_error() {
13439        Ok(())
13440    } else {
13441        let content = resp.text().await?;
13442        let entity: Option<RevokeRefreshTokenByIdWithIdError> = serde_json::from_str(&content).ok();
13443        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13444    }
13445}
13446
13447/// Revokes a single User consent by Id.
13448pub async fn revoke_user_consent_with_id(configuration: &configuration::Configuration, user_consent_id: &str) -> Result<(), Error<RevokeUserConsentWithIdError>> {
13449    // add a prefix to parameters to efficiently prevent name collisions
13450    let p_path_user_consent_id = user_consent_id;
13451
13452    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
13453    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
13454
13455    if let Some(ref user_agent) = configuration.user_agent {
13456        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13457    }
13458    if let Some(ref apikey) = configuration.api_key {
13459        let key = apikey.key.clone();
13460        let value = match apikey.prefix {
13461            Some(ref prefix) => format!("{} {}", prefix, key),
13462            None => key,
13463        };
13464        req_builder = req_builder.header("Authorization", value);
13465    };
13466
13467    let req = req_builder.build()?;
13468    let resp = configuration.client.execute(req).await?;
13469
13470    let status = resp.status();
13471
13472    if !status.is_client_error() && !status.is_server_error() {
13473        Ok(())
13474    } else {
13475        let content = resp.text().await?;
13476        let entity: Option<RevokeUserConsentWithIdError> = serde_json::from_str(&content).ok();
13477        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13478    }
13479}
13480
13481/// Searches applications with the specified criteria and pagination.
13482pub async fn search_applications_with_id(configuration: &configuration::Configuration, application_search_request: Option<models::ApplicationSearchRequest>) -> Result<models::ApplicationSearchResponse, Error<SearchApplicationsWithIdError>> {
13483    // add a prefix to parameters to efficiently prevent name collisions
13484    let p_body_application_search_request = application_search_request;
13485
13486    let uri_str = format!("{}/api/application/search", configuration.base_path);
13487    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13488
13489    if let Some(ref user_agent) = configuration.user_agent {
13490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13491    }
13492    if let Some(ref apikey) = configuration.api_key {
13493        let key = apikey.key.clone();
13494        let value = match apikey.prefix {
13495            Some(ref prefix) => format!("{} {}", prefix, key),
13496            None => key,
13497        };
13498        req_builder = req_builder.header("Authorization", value);
13499    };
13500    req_builder = req_builder.json(&p_body_application_search_request);
13501
13502    let req = req_builder.build()?;
13503    let resp = configuration.client.execute(req).await?;
13504
13505    let status = resp.status();
13506    let content_type = resp
13507        .headers()
13508        .get("content-type")
13509        .and_then(|v| v.to_str().ok())
13510        .unwrap_or("application/octet-stream");
13511    let content_type = super::ContentType::from(content_type);
13512
13513    if !status.is_client_error() && !status.is_server_error() {
13514        let content = resp.text().await?;
13515        match content_type {
13516            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13517            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationSearchResponse`"))),
13518            ContentType::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`")))),
13519        }
13520    } else {
13521        let content = resp.text().await?;
13522        let entity: Option<SearchApplicationsWithIdError> = serde_json::from_str(&content).ok();
13523        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13524    }
13525}
13526
13527/// Searches the audit logs with the specified criteria and pagination.
13528pub async fn search_audit_logs_with_id(configuration: &configuration::Configuration, audit_log_search_request: Option<models::AuditLogSearchRequest>) -> Result<models::AuditLogSearchResponse, Error<SearchAuditLogsWithIdError>> {
13529    // add a prefix to parameters to efficiently prevent name collisions
13530    let p_body_audit_log_search_request = audit_log_search_request;
13531
13532    let uri_str = format!("{}/api/system/audit-log/search", configuration.base_path);
13533    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13534
13535    if let Some(ref user_agent) = configuration.user_agent {
13536        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13537    }
13538    if let Some(ref apikey) = configuration.api_key {
13539        let key = apikey.key.clone();
13540        let value = match apikey.prefix {
13541            Some(ref prefix) => format!("{} {}", prefix, key),
13542            None => key,
13543        };
13544        req_builder = req_builder.header("Authorization", value);
13545    };
13546    req_builder = req_builder.json(&p_body_audit_log_search_request);
13547
13548    let req = req_builder.build()?;
13549    let resp = configuration.client.execute(req).await?;
13550
13551    let status = resp.status();
13552    let content_type = resp
13553        .headers()
13554        .get("content-type")
13555        .and_then(|v| v.to_str().ok())
13556        .unwrap_or("application/octet-stream");
13557    let content_type = super::ContentType::from(content_type);
13558
13559    if !status.is_client_error() && !status.is_server_error() {
13560        let content = resp.text().await?;
13561        match content_type {
13562            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13563            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditLogSearchResponse`"))),
13564            ContentType::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`")))),
13565        }
13566    } else {
13567        let content = resp.text().await?;
13568        let entity: Option<SearchAuditLogsWithIdError> = serde_json::from_str(&content).ok();
13569        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13570    }
13571}
13572
13573/// Searches consents with the specified criteria and pagination.
13574pub async fn search_consents_with_id(configuration: &configuration::Configuration, consent_search_request: Option<models::ConsentSearchRequest>) -> Result<models::ConsentSearchResponse, Error<SearchConsentsWithIdError>> {
13575    // add a prefix to parameters to efficiently prevent name collisions
13576    let p_body_consent_search_request = consent_search_request;
13577
13578    let uri_str = format!("{}/api/consent/search", configuration.base_path);
13579    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13580
13581    if let Some(ref user_agent) = configuration.user_agent {
13582        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13583    }
13584    if let Some(ref apikey) = configuration.api_key {
13585        let key = apikey.key.clone();
13586        let value = match apikey.prefix {
13587            Some(ref prefix) => format!("{} {}", prefix, key),
13588            None => key,
13589        };
13590        req_builder = req_builder.header("Authorization", value);
13591    };
13592    req_builder = req_builder.json(&p_body_consent_search_request);
13593
13594    let req = req_builder.build()?;
13595    let resp = configuration.client.execute(req).await?;
13596
13597    let status = resp.status();
13598    let content_type = resp
13599        .headers()
13600        .get("content-type")
13601        .and_then(|v| v.to_str().ok())
13602        .unwrap_or("application/octet-stream");
13603    let content_type = super::ContentType::from(content_type);
13604
13605    if !status.is_client_error() && !status.is_server_error() {
13606        let content = resp.text().await?;
13607        match content_type {
13608            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13609            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentSearchResponse`"))),
13610            ContentType::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`")))),
13611        }
13612    } else {
13613        let content = resp.text().await?;
13614        let entity: Option<SearchConsentsWithIdError> = serde_json::from_str(&content).ok();
13615        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13616    }
13617}
13618
13619/// Searches email templates with the specified criteria and pagination.
13620pub async fn search_email_templates_with_id(configuration: &configuration::Configuration, email_template_search_request: Option<models::EmailTemplateSearchRequest>) -> Result<models::EmailTemplateSearchResponse, Error<SearchEmailTemplatesWithIdError>> {
13621    // add a prefix to parameters to efficiently prevent name collisions
13622    let p_body_email_template_search_request = email_template_search_request;
13623
13624    let uri_str = format!("{}/api/email/template/search", configuration.base_path);
13625    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13626
13627    if let Some(ref user_agent) = configuration.user_agent {
13628        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13629    }
13630    if let Some(ref apikey) = configuration.api_key {
13631        let key = apikey.key.clone();
13632        let value = match apikey.prefix {
13633            Some(ref prefix) => format!("{} {}", prefix, key),
13634            None => key,
13635        };
13636        req_builder = req_builder.header("Authorization", value);
13637    };
13638    req_builder = req_builder.json(&p_body_email_template_search_request);
13639
13640    let req = req_builder.build()?;
13641    let resp = configuration.client.execute(req).await?;
13642
13643    let status = resp.status();
13644    let content_type = resp
13645        .headers()
13646        .get("content-type")
13647        .and_then(|v| v.to_str().ok())
13648        .unwrap_or("application/octet-stream");
13649    let content_type = super::ContentType::from(content_type);
13650
13651    if !status.is_client_error() && !status.is_server_error() {
13652        let content = resp.text().await?;
13653        match content_type {
13654            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13655            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateSearchResponse`"))),
13656            ContentType::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`")))),
13657        }
13658    } else {
13659        let content = resp.text().await?;
13660        let entity: Option<SearchEmailTemplatesWithIdError> = serde_json::from_str(&content).ok();
13661        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13662    }
13663}
13664
13665/// Retrieves the entities for the given Ids. If any Id is invalid, it is ignored.
13666pub async fn search_entities_by_ids_with_id(configuration: &configuration::Configuration, ids: Option<&str>) -> Result<models::EntitySearchResponse, Error<SearchEntitiesByIdsWithIdError>> {
13667    // add a prefix to parameters to efficiently prevent name collisions
13668    let p_query_ids = ids;
13669
13670    let uri_str = format!("{}/api/entity/search", configuration.base_path);
13671    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13672
13673    if let Some(ref param_value) = p_query_ids {
13674        req_builder = req_builder.query(&[("ids", &param_value.to_string())]);
13675    }
13676    if let Some(ref user_agent) = configuration.user_agent {
13677        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13678    }
13679    if let Some(ref apikey) = configuration.api_key {
13680        let key = apikey.key.clone();
13681        let value = match apikey.prefix {
13682            Some(ref prefix) => format!("{} {}", prefix, key),
13683            None => key,
13684        };
13685        req_builder = req_builder.header("Authorization", value);
13686    };
13687
13688    let req = req_builder.build()?;
13689    let resp = configuration.client.execute(req).await?;
13690
13691    let status = resp.status();
13692    let content_type = resp
13693        .headers()
13694        .get("content-type")
13695        .and_then(|v| v.to_str().ok())
13696        .unwrap_or("application/octet-stream");
13697    let content_type = super::ContentType::from(content_type);
13698
13699    if !status.is_client_error() && !status.is_server_error() {
13700        let content = resp.text().await?;
13701        match content_type {
13702            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13703            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntitySearchResponse`"))),
13704            ContentType::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`")))),
13705        }
13706    } else {
13707        let content = resp.text().await?;
13708        let entity: Option<SearchEntitiesByIdsWithIdError> = serde_json::from_str(&content).ok();
13709        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13710    }
13711}
13712
13713/// Searches entities with the specified criteria and pagination.
13714pub async fn search_entities_with_id(configuration: &configuration::Configuration, entity_search_request: Option<models::EntitySearchRequest>) -> Result<models::EntitySearchResponse, Error<SearchEntitiesWithIdError>> {
13715    // add a prefix to parameters to efficiently prevent name collisions
13716    let p_body_entity_search_request = entity_search_request;
13717
13718    let uri_str = format!("{}/api/entity/search", configuration.base_path);
13719    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13720
13721    if let Some(ref user_agent) = configuration.user_agent {
13722        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13723    }
13724    if let Some(ref apikey) = configuration.api_key {
13725        let key = apikey.key.clone();
13726        let value = match apikey.prefix {
13727            Some(ref prefix) => format!("{} {}", prefix, key),
13728            None => key,
13729        };
13730        req_builder = req_builder.header("Authorization", value);
13731    };
13732    req_builder = req_builder.json(&p_body_entity_search_request);
13733
13734    let req = req_builder.build()?;
13735    let resp = configuration.client.execute(req).await?;
13736
13737    let status = resp.status();
13738    let content_type = resp
13739        .headers()
13740        .get("content-type")
13741        .and_then(|v| v.to_str().ok())
13742        .unwrap_or("application/octet-stream");
13743    let content_type = super::ContentType::from(content_type);
13744
13745    if !status.is_client_error() && !status.is_server_error() {
13746        let content = resp.text().await?;
13747        match content_type {
13748            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13749            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntitySearchResponse`"))),
13750            ContentType::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`")))),
13751        }
13752    } else {
13753        let content = resp.text().await?;
13754        let entity: Option<SearchEntitiesWithIdError> = serde_json::from_str(&content).ok();
13755        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13756    }
13757}
13758
13759/// Searches Entity Grants with the specified criteria and pagination.
13760pub async fn search_entity_grants_with_id(configuration: &configuration::Configuration, entity_grant_search_request: Option<models::EntityGrantSearchRequest>) -> Result<models::EntityGrantSearchResponse, Error<SearchEntityGrantsWithIdError>> {
13761    // add a prefix to parameters to efficiently prevent name collisions
13762    let p_body_entity_grant_search_request = entity_grant_search_request;
13763
13764    let uri_str = format!("{}/api/entity/grant/search", configuration.base_path);
13765    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13766
13767    if let Some(ref user_agent) = configuration.user_agent {
13768        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13769    }
13770    if let Some(ref apikey) = configuration.api_key {
13771        let key = apikey.key.clone();
13772        let value = match apikey.prefix {
13773            Some(ref prefix) => format!("{} {}", prefix, key),
13774            None => key,
13775        };
13776        req_builder = req_builder.header("Authorization", value);
13777    };
13778    req_builder = req_builder.json(&p_body_entity_grant_search_request);
13779
13780    let req = req_builder.build()?;
13781    let resp = configuration.client.execute(req).await?;
13782
13783    let status = resp.status();
13784    let content_type = resp
13785        .headers()
13786        .get("content-type")
13787        .and_then(|v| v.to_str().ok())
13788        .unwrap_or("application/octet-stream");
13789    let content_type = super::ContentType::from(content_type);
13790
13791    if !status.is_client_error() && !status.is_server_error() {
13792        let content = resp.text().await?;
13793        match content_type {
13794            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13795            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityGrantSearchResponse`"))),
13796            ContentType::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`")))),
13797        }
13798    } else {
13799        let content = resp.text().await?;
13800        let entity: Option<SearchEntityGrantsWithIdError> = serde_json::from_str(&content).ok();
13801        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13802    }
13803}
13804
13805/// Searches the entity types with the specified criteria and pagination.
13806pub async fn search_entity_types_with_id(configuration: &configuration::Configuration, entity_type_search_request: Option<models::EntityTypeSearchRequest>) -> Result<models::EntityTypeSearchResponse, Error<SearchEntityTypesWithIdError>> {
13807    // add a prefix to parameters to efficiently prevent name collisions
13808    let p_body_entity_type_search_request = entity_type_search_request;
13809
13810    let uri_str = format!("{}/api/entity/type/search", configuration.base_path);
13811    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13812
13813    if let Some(ref user_agent) = configuration.user_agent {
13814        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13815    }
13816    if let Some(ref apikey) = configuration.api_key {
13817        let key = apikey.key.clone();
13818        let value = match apikey.prefix {
13819            Some(ref prefix) => format!("{} {}", prefix, key),
13820            None => key,
13821        };
13822        req_builder = req_builder.header("Authorization", value);
13823    };
13824    req_builder = req_builder.json(&p_body_entity_type_search_request);
13825
13826    let req = req_builder.build()?;
13827    let resp = configuration.client.execute(req).await?;
13828
13829    let status = resp.status();
13830    let content_type = resp
13831        .headers()
13832        .get("content-type")
13833        .and_then(|v| v.to_str().ok())
13834        .unwrap_or("application/octet-stream");
13835    let content_type = super::ContentType::from(content_type);
13836
13837    if !status.is_client_error() && !status.is_server_error() {
13838        let content = resp.text().await?;
13839        match content_type {
13840            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13841            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeSearchResponse`"))),
13842            ContentType::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`")))),
13843        }
13844    } else {
13845        let content = resp.text().await?;
13846        let entity: Option<SearchEntityTypesWithIdError> = serde_json::from_str(&content).ok();
13847        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13848    }
13849}
13850
13851/// Searches the event logs with the specified criteria and pagination.
13852pub async fn search_event_logs_with_id(configuration: &configuration::Configuration, event_log_search_request: Option<models::EventLogSearchRequest>) -> Result<models::EventLogSearchResponse, Error<SearchEventLogsWithIdError>> {
13853    // add a prefix to parameters to efficiently prevent name collisions
13854    let p_body_event_log_search_request = event_log_search_request;
13855
13856    let uri_str = format!("{}/api/system/event-log/search", configuration.base_path);
13857    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13858
13859    if let Some(ref user_agent) = configuration.user_agent {
13860        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13861    }
13862    if let Some(ref apikey) = configuration.api_key {
13863        let key = apikey.key.clone();
13864        let value = match apikey.prefix {
13865            Some(ref prefix) => format!("{} {}", prefix, key),
13866            None => key,
13867        };
13868        req_builder = req_builder.header("Authorization", value);
13869    };
13870    req_builder = req_builder.json(&p_body_event_log_search_request);
13871
13872    let req = req_builder.build()?;
13873    let resp = configuration.client.execute(req).await?;
13874
13875    let status = resp.status();
13876    let content_type = resp
13877        .headers()
13878        .get("content-type")
13879        .and_then(|v| v.to_str().ok())
13880        .unwrap_or("application/octet-stream");
13881    let content_type = super::ContentType::from(content_type);
13882
13883    if !status.is_client_error() && !status.is_server_error() {
13884        let content = resp.text().await?;
13885        match content_type {
13886            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13887            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EventLogSearchResponse`"))),
13888            ContentType::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`")))),
13889        }
13890    } else {
13891        let content = resp.text().await?;
13892        let entity: Option<SearchEventLogsWithIdError> = serde_json::from_str(&content).ok();
13893        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13894    }
13895}
13896
13897/// Searches group members with the specified criteria and pagination.
13898pub async fn search_group_members_with_id(configuration: &configuration::Configuration, group_member_search_request: Option<models::GroupMemberSearchRequest>) -> Result<models::GroupMemberSearchResponse, Error<SearchGroupMembersWithIdError>> {
13899    // add a prefix to parameters to efficiently prevent name collisions
13900    let p_body_group_member_search_request = group_member_search_request;
13901
13902    let uri_str = format!("{}/api/group/member/search", configuration.base_path);
13903    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13904
13905    if let Some(ref user_agent) = configuration.user_agent {
13906        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13907    }
13908    if let Some(ref apikey) = configuration.api_key {
13909        let key = apikey.key.clone();
13910        let value = match apikey.prefix {
13911            Some(ref prefix) => format!("{} {}", prefix, key),
13912            None => key,
13913        };
13914        req_builder = req_builder.header("Authorization", value);
13915    };
13916    req_builder = req_builder.json(&p_body_group_member_search_request);
13917
13918    let req = req_builder.build()?;
13919    let resp = configuration.client.execute(req).await?;
13920
13921    let status = resp.status();
13922    let content_type = resp
13923        .headers()
13924        .get("content-type")
13925        .and_then(|v| v.to_str().ok())
13926        .unwrap_or("application/octet-stream");
13927    let content_type = super::ContentType::from(content_type);
13928
13929    if !status.is_client_error() && !status.is_server_error() {
13930        let content = resp.text().await?;
13931        match content_type {
13932            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13933            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupMemberSearchResponse`"))),
13934            ContentType::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`")))),
13935        }
13936    } else {
13937        let content = resp.text().await?;
13938        let entity: Option<SearchGroupMembersWithIdError> = serde_json::from_str(&content).ok();
13939        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13940    }
13941}
13942
13943/// Searches groups with the specified criteria and pagination.
13944pub async fn search_groups_with_id(configuration: &configuration::Configuration, group_search_request: Option<models::GroupSearchRequest>) -> Result<models::GroupSearchResponse, Error<SearchGroupsWithIdError>> {
13945    // add a prefix to parameters to efficiently prevent name collisions
13946    let p_body_group_search_request = group_search_request;
13947
13948    let uri_str = format!("{}/api/group/search", configuration.base_path);
13949    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13950
13951    if let Some(ref user_agent) = configuration.user_agent {
13952        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13953    }
13954    if let Some(ref apikey) = configuration.api_key {
13955        let key = apikey.key.clone();
13956        let value = match apikey.prefix {
13957            Some(ref prefix) => format!("{} {}", prefix, key),
13958            None => key,
13959        };
13960        req_builder = req_builder.header("Authorization", value);
13961    };
13962    req_builder = req_builder.json(&p_body_group_search_request);
13963
13964    let req = req_builder.build()?;
13965    let resp = configuration.client.execute(req).await?;
13966
13967    let status = resp.status();
13968    let content_type = resp
13969        .headers()
13970        .get("content-type")
13971        .and_then(|v| v.to_str().ok())
13972        .unwrap_or("application/octet-stream");
13973    let content_type = super::ContentType::from(content_type);
13974
13975    if !status.is_client_error() && !status.is_server_error() {
13976        let content = resp.text().await?;
13977        match content_type {
13978            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13979            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSearchResponse`"))),
13980            ContentType::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`")))),
13981        }
13982    } else {
13983        let content = resp.text().await?;
13984        let entity: Option<SearchGroupsWithIdError> = serde_json::from_str(&content).ok();
13985        Err(Error::ResponseError(ResponseContent { status, content, entity }))
13986    }
13987}
13988
13989/// Searches identity providers with the specified criteria and pagination.
13990pub async fn search_identity_providers_with_id(configuration: &configuration::Configuration, identity_provider_search_request: Option<models::IdentityProviderSearchRequest>) -> Result<models::IdentityProviderSearchResponse, Error<SearchIdentityProvidersWithIdError>> {
13991    // add a prefix to parameters to efficiently prevent name collisions
13992    let p_body_identity_provider_search_request = identity_provider_search_request;
13993
13994    let uri_str = format!("{}/api/identity-provider/search", configuration.base_path);
13995    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
13996
13997    if let Some(ref user_agent) = configuration.user_agent {
13998        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13999    }
14000    if let Some(ref apikey) = configuration.api_key {
14001        let key = apikey.key.clone();
14002        let value = match apikey.prefix {
14003            Some(ref prefix) => format!("{} {}", prefix, key),
14004            None => key,
14005        };
14006        req_builder = req_builder.header("Authorization", value);
14007    };
14008    req_builder = req_builder.json(&p_body_identity_provider_search_request);
14009
14010    let req = req_builder.build()?;
14011    let resp = configuration.client.execute(req).await?;
14012
14013    let status = resp.status();
14014    let content_type = resp
14015        .headers()
14016        .get("content-type")
14017        .and_then(|v| v.to_str().ok())
14018        .unwrap_or("application/octet-stream");
14019    let content_type = super::ContentType::from(content_type);
14020
14021    if !status.is_client_error() && !status.is_server_error() {
14022        let content = resp.text().await?;
14023        match content_type {
14024            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14025            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderSearchResponse`"))),
14026            ContentType::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`")))),
14027        }
14028    } else {
14029        let content = resp.text().await?;
14030        let entity: Option<SearchIdentityProvidersWithIdError> = serde_json::from_str(&content).ok();
14031        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14032    }
14033}
14034
14035/// Searches the IP Access Control Lists with the specified criteria and pagination.
14036pub 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>> {
14037    // add a prefix to parameters to efficiently prevent name collisions
14038    let p_body_ip_access_control_list_search_request = ip_access_control_list_search_request;
14039
14040    let uri_str = format!("{}/api/ip-acl/search", configuration.base_path);
14041    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14042
14043    if let Some(ref user_agent) = configuration.user_agent {
14044        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14045    }
14046    if let Some(ref apikey) = configuration.api_key {
14047        let key = apikey.key.clone();
14048        let value = match apikey.prefix {
14049            Some(ref prefix) => format!("{} {}", prefix, key),
14050            None => key,
14051        };
14052        req_builder = req_builder.header("Authorization", value);
14053    };
14054    req_builder = req_builder.json(&p_body_ip_access_control_list_search_request);
14055
14056    let req = req_builder.build()?;
14057    let resp = configuration.client.execute(req).await?;
14058
14059    let status = resp.status();
14060    let content_type = resp
14061        .headers()
14062        .get("content-type")
14063        .and_then(|v| v.to_str().ok())
14064        .unwrap_or("application/octet-stream");
14065    let content_type = super::ContentType::from(content_type);
14066
14067    if !status.is_client_error() && !status.is_server_error() {
14068        let content = resp.text().await?;
14069        match content_type {
14070            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14071            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListSearchResponse`"))),
14072            ContentType::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`")))),
14073        }
14074    } else {
14075        let content = resp.text().await?;
14076        let entity: Option<SearchIpAccessControlListsWithIdError> = serde_json::from_str(&content).ok();
14077        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14078    }
14079}
14080
14081/// Searches keys with the specified criteria and pagination.
14082pub async fn search_keys_with_id(configuration: &configuration::Configuration, key_search_request: Option<models::KeySearchRequest>) -> Result<models::KeySearchResponse, Error<SearchKeysWithIdError>> {
14083    // add a prefix to parameters to efficiently prevent name collisions
14084    let p_body_key_search_request = key_search_request;
14085
14086    let uri_str = format!("{}/api/key/search", configuration.base_path);
14087    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14088
14089    if let Some(ref user_agent) = configuration.user_agent {
14090        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14091    }
14092    if let Some(ref apikey) = configuration.api_key {
14093        let key = apikey.key.clone();
14094        let value = match apikey.prefix {
14095            Some(ref prefix) => format!("{} {}", prefix, key),
14096            None => key,
14097        };
14098        req_builder = req_builder.header("Authorization", value);
14099    };
14100    req_builder = req_builder.json(&p_body_key_search_request);
14101
14102    let req = req_builder.build()?;
14103    let resp = configuration.client.execute(req).await?;
14104
14105    let status = resp.status();
14106    let content_type = resp
14107        .headers()
14108        .get("content-type")
14109        .and_then(|v| v.to_str().ok())
14110        .unwrap_or("application/octet-stream");
14111    let content_type = super::ContentType::from(content_type);
14112
14113    if !status.is_client_error() && !status.is_server_error() {
14114        let content = resp.text().await?;
14115        match content_type {
14116            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14117            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeySearchResponse`"))),
14118            ContentType::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`")))),
14119        }
14120    } else {
14121        let content = resp.text().await?;
14122        let entity: Option<SearchKeysWithIdError> = serde_json::from_str(&content).ok();
14123        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14124    }
14125}
14126
14127/// Searches lambdas with the specified criteria and pagination.
14128pub async fn search_lambdas_with_id(configuration: &configuration::Configuration, lambda_search_request: Option<models::LambdaSearchRequest>) -> Result<models::LambdaSearchResponse, Error<SearchLambdasWithIdError>> {
14129    // add a prefix to parameters to efficiently prevent name collisions
14130    let p_body_lambda_search_request = lambda_search_request;
14131
14132    let uri_str = format!("{}/api/lambda/search", configuration.base_path);
14133    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14134
14135    if let Some(ref user_agent) = configuration.user_agent {
14136        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14137    }
14138    if let Some(ref apikey) = configuration.api_key {
14139        let key = apikey.key.clone();
14140        let value = match apikey.prefix {
14141            Some(ref prefix) => format!("{} {}", prefix, key),
14142            None => key,
14143        };
14144        req_builder = req_builder.header("Authorization", value);
14145    };
14146    req_builder = req_builder.json(&p_body_lambda_search_request);
14147
14148    let req = req_builder.build()?;
14149    let resp = configuration.client.execute(req).await?;
14150
14151    let status = resp.status();
14152    let content_type = resp
14153        .headers()
14154        .get("content-type")
14155        .and_then(|v| v.to_str().ok())
14156        .unwrap_or("application/octet-stream");
14157    let content_type = super::ContentType::from(content_type);
14158
14159    if !status.is_client_error() && !status.is_server_error() {
14160        let content = resp.text().await?;
14161        match content_type {
14162            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14163            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaSearchResponse`"))),
14164            ContentType::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`")))),
14165        }
14166    } else {
14167        let content = resp.text().await?;
14168        let entity: Option<SearchLambdasWithIdError> = serde_json::from_str(&content).ok();
14169        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14170    }
14171}
14172
14173/// Searches the login records with the specified criteria and pagination.
14174pub async fn search_login_records_with_id(configuration: &configuration::Configuration, login_record_search_request: Option<models::LoginRecordSearchRequest>) -> Result<models::LoginRecordSearchResponse, Error<SearchLoginRecordsWithIdError>> {
14175    // add a prefix to parameters to efficiently prevent name collisions
14176    let p_body_login_record_search_request = login_record_search_request;
14177
14178    let uri_str = format!("{}/api/system/login-record/search", configuration.base_path);
14179    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14180
14181    if let Some(ref user_agent) = configuration.user_agent {
14182        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14183    }
14184    if let Some(ref apikey) = configuration.api_key {
14185        let key = apikey.key.clone();
14186        let value = match apikey.prefix {
14187            Some(ref prefix) => format!("{} {}", prefix, key),
14188            None => key,
14189        };
14190        req_builder = req_builder.header("Authorization", value);
14191    };
14192    req_builder = req_builder.json(&p_body_login_record_search_request);
14193
14194    let req = req_builder.build()?;
14195    let resp = configuration.client.execute(req).await?;
14196
14197    let status = resp.status();
14198    let content_type = resp
14199        .headers()
14200        .get("content-type")
14201        .and_then(|v| v.to_str().ok())
14202        .unwrap_or("application/octet-stream");
14203    let content_type = super::ContentType::from(content_type);
14204
14205    if !status.is_client_error() && !status.is_server_error() {
14206        let content = resp.text().await?;
14207        match content_type {
14208            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14209            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginRecordSearchResponse`"))),
14210            ContentType::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`")))),
14211        }
14212    } else {
14213        let content = resp.text().await?;
14214        let entity: Option<SearchLoginRecordsWithIdError> = serde_json::from_str(&content).ok();
14215        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14216    }
14217}
14218
14219/// Searches tenants with the specified criteria and pagination.
14220pub async fn search_tenants_with_id(configuration: &configuration::Configuration, tenant_search_request: Option<models::TenantSearchRequest>) -> Result<models::TenantSearchResponse, Error<SearchTenantsWithIdError>> {
14221    // add a prefix to parameters to efficiently prevent name collisions
14222    let p_body_tenant_search_request = tenant_search_request;
14223
14224    let uri_str = format!("{}/api/tenant/search", configuration.base_path);
14225    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14226
14227    if let Some(ref user_agent) = configuration.user_agent {
14228        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14229    }
14230    if let Some(ref apikey) = configuration.api_key {
14231        let key = apikey.key.clone();
14232        let value = match apikey.prefix {
14233            Some(ref prefix) => format!("{} {}", prefix, key),
14234            None => key,
14235        };
14236        req_builder = req_builder.header("Authorization", value);
14237    };
14238    req_builder = req_builder.json(&p_body_tenant_search_request);
14239
14240    let req = req_builder.build()?;
14241    let resp = configuration.client.execute(req).await?;
14242
14243    let status = resp.status();
14244    let content_type = resp
14245        .headers()
14246        .get("content-type")
14247        .and_then(|v| v.to_str().ok())
14248        .unwrap_or("application/octet-stream");
14249    let content_type = super::ContentType::from(content_type);
14250
14251    if !status.is_client_error() && !status.is_server_error() {
14252        let content = resp.text().await?;
14253        match content_type {
14254            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14255            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantSearchResponse`"))),
14256            ContentType::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`")))),
14257        }
14258    } else {
14259        let content = resp.text().await?;
14260        let entity: Option<SearchTenantsWithIdError> = serde_json::from_str(&content).ok();
14261        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14262    }
14263}
14264
14265/// Searches themes with the specified criteria and pagination.
14266pub async fn search_themes_with_id(configuration: &configuration::Configuration, theme_search_request: Option<models::ThemeSearchRequest>) -> Result<models::ThemeSearchResponse, Error<SearchThemesWithIdError>> {
14267    // add a prefix to parameters to efficiently prevent name collisions
14268    let p_body_theme_search_request = theme_search_request;
14269
14270    let uri_str = format!("{}/api/theme/search", configuration.base_path);
14271    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14272
14273    if let Some(ref user_agent) = configuration.user_agent {
14274        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14275    }
14276    if let Some(ref apikey) = configuration.api_key {
14277        let key = apikey.key.clone();
14278        let value = match apikey.prefix {
14279            Some(ref prefix) => format!("{} {}", prefix, key),
14280            None => key,
14281        };
14282        req_builder = req_builder.header("Authorization", value);
14283    };
14284    req_builder = req_builder.json(&p_body_theme_search_request);
14285
14286    let req = req_builder.build()?;
14287    let resp = configuration.client.execute(req).await?;
14288
14289    let status = resp.status();
14290    let content_type = resp
14291        .headers()
14292        .get("content-type")
14293        .and_then(|v| v.to_str().ok())
14294        .unwrap_or("application/octet-stream");
14295    let content_type = super::ContentType::from(content_type);
14296
14297    if !status.is_client_error() && !status.is_server_error() {
14298        let content = resp.text().await?;
14299        match content_type {
14300            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14301            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeSearchResponse`"))),
14302            ContentType::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`")))),
14303        }
14304    } else {
14305        let content = resp.text().await?;
14306        let entity: Option<SearchThemesWithIdError> = serde_json::from_str(&content).ok();
14307        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14308    }
14309}
14310
14311/// Searches user comments with the specified criteria and pagination.
14312pub async fn search_user_comments_with_id(configuration: &configuration::Configuration, user_comment_search_request: Option<models::UserCommentSearchRequest>) -> Result<models::UserCommentSearchResponse, Error<SearchUserCommentsWithIdError>> {
14313    // add a prefix to parameters to efficiently prevent name collisions
14314    let p_body_user_comment_search_request = user_comment_search_request;
14315
14316    let uri_str = format!("{}/api/user/comment/search", configuration.base_path);
14317    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14318
14319    if let Some(ref user_agent) = configuration.user_agent {
14320        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14321    }
14322    if let Some(ref apikey) = configuration.api_key {
14323        let key = apikey.key.clone();
14324        let value = match apikey.prefix {
14325            Some(ref prefix) => format!("{} {}", prefix, key),
14326            None => key,
14327        };
14328        req_builder = req_builder.header("Authorization", value);
14329    };
14330    req_builder = req_builder.json(&p_body_user_comment_search_request);
14331
14332    let req = req_builder.build()?;
14333    let resp = configuration.client.execute(req).await?;
14334
14335    let status = resp.status();
14336    let content_type = resp
14337        .headers()
14338        .get("content-type")
14339        .and_then(|v| v.to_str().ok())
14340        .unwrap_or("application/octet-stream");
14341    let content_type = super::ContentType::from(content_type);
14342
14343    if !status.is_client_error() && !status.is_server_error() {
14344        let content = resp.text().await?;
14345        match content_type {
14346            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14347            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommentSearchResponse`"))),
14348            ContentType::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`")))),
14349        }
14350    } else {
14351        let content = resp.text().await?;
14352        let entity: Option<SearchUserCommentsWithIdError> = serde_json::from_str(&content).ok();
14353        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14354    }
14355}
14356
14357/// Retrieves the users for the given Ids. If any Id is invalid, it is ignored.
14358pub async fn search_users_by_ids_with_id(configuration: &configuration::Configuration, ids: Option<&str>) -> Result<models::SearchResponse, Error<SearchUsersByIdsWithIdError>> {
14359    // add a prefix to parameters to efficiently prevent name collisions
14360    let p_query_ids = ids;
14361
14362    let uri_str = format!("{}/api/user/search", configuration.base_path);
14363    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
14364
14365    if let Some(ref param_value) = p_query_ids {
14366        req_builder = req_builder.query(&[("ids", &param_value.to_string())]);
14367    }
14368    if let Some(ref user_agent) = configuration.user_agent {
14369        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14370    }
14371    if let Some(ref apikey) = configuration.api_key {
14372        let key = apikey.key.clone();
14373        let value = match apikey.prefix {
14374            Some(ref prefix) => format!("{} {}", prefix, key),
14375            None => key,
14376        };
14377        req_builder = req_builder.header("Authorization", value);
14378    };
14379
14380    let req = req_builder.build()?;
14381    let resp = configuration.client.execute(req).await?;
14382
14383    let status = resp.status();
14384    let content_type = resp
14385        .headers()
14386        .get("content-type")
14387        .and_then(|v| v.to_str().ok())
14388        .unwrap_or("application/octet-stream");
14389    let content_type = super::ContentType::from(content_type);
14390
14391    if !status.is_client_error() && !status.is_server_error() {
14392        let content = resp.text().await?;
14393        match content_type {
14394            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14395            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResponse`"))),
14396            ContentType::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`")))),
14397        }
14398    } else {
14399        let content = resp.text().await?;
14400        let entity: Option<SearchUsersByIdsWithIdError> = serde_json::from_str(&content).ok();
14401        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14402    }
14403}
14404
14405/// Retrieves the users for the given search criteria and pagination.
14406pub async fn search_users_by_query_with_id(configuration: &configuration::Configuration, search_request: Option<models::SearchRequest>) -> Result<models::SearchResponse, Error<SearchUsersByQueryWithIdError>> {
14407    // add a prefix to parameters to efficiently prevent name collisions
14408    let p_body_search_request = search_request;
14409
14410    let uri_str = format!("{}/api/user/search", configuration.base_path);
14411    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14412
14413    if let Some(ref user_agent) = configuration.user_agent {
14414        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14415    }
14416    if let Some(ref apikey) = configuration.api_key {
14417        let key = apikey.key.clone();
14418        let value = match apikey.prefix {
14419            Some(ref prefix) => format!("{} {}", prefix, key),
14420            None => key,
14421        };
14422        req_builder = req_builder.header("Authorization", value);
14423    };
14424    req_builder = req_builder.json(&p_body_search_request);
14425
14426    let req = req_builder.build()?;
14427    let resp = configuration.client.execute(req).await?;
14428
14429    let status = resp.status();
14430    let content_type = resp
14431        .headers()
14432        .get("content-type")
14433        .and_then(|v| v.to_str().ok())
14434        .unwrap_or("application/octet-stream");
14435    let content_type = super::ContentType::from(content_type);
14436
14437    if !status.is_client_error() && !status.is_server_error() {
14438        let content = resp.text().await?;
14439        match content_type {
14440            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14441            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResponse`"))),
14442            ContentType::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`")))),
14443        }
14444    } else {
14445        let content = resp.text().await?;
14446        let entity: Option<SearchUsersByQueryWithIdError> = serde_json::from_str(&content).ok();
14447        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14448    }
14449}
14450
14451/// Searches the webhook event logs with the specified criteria and pagination.
14452pub async fn search_webhook_event_logs_with_id(configuration: &configuration::Configuration, webhook_event_log_search_request: Option<models::WebhookEventLogSearchRequest>) -> Result<models::WebhookEventLogSearchResponse, Error<SearchWebhookEventLogsWithIdError>> {
14453    // add a prefix to parameters to efficiently prevent name collisions
14454    let p_body_webhook_event_log_search_request = webhook_event_log_search_request;
14455
14456    let uri_str = format!("{}/api/system/webhook-event-log/search", 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_webhook_event_log_search_request);
14471
14472    let req = req_builder.build()?;
14473    let resp = configuration.client.execute(req).await?;
14474
14475    let status = resp.status();
14476    let content_type = resp
14477        .headers()
14478        .get("content-type")
14479        .and_then(|v| v.to_str().ok())
14480        .unwrap_or("application/octet-stream");
14481    let content_type = super::ContentType::from(content_type);
14482
14483    if !status.is_client_error() && !status.is_server_error() {
14484        let content = resp.text().await?;
14485        match content_type {
14486            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14487            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookEventLogSearchResponse`"))),
14488            ContentType::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`")))),
14489        }
14490    } else {
14491        let content = resp.text().await?;
14492        let entity: Option<SearchWebhookEventLogsWithIdError> = serde_json::from_str(&content).ok();
14493        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14494    }
14495}
14496
14497/// Searches webhooks with the specified criteria and pagination.
14498pub async fn search_webhooks_with_id(configuration: &configuration::Configuration, webhook_search_request: Option<models::WebhookSearchRequest>) -> Result<models::WebhookSearchResponse, Error<SearchWebhooksWithIdError>> {
14499    // add a prefix to parameters to efficiently prevent name collisions
14500    let p_body_webhook_search_request = webhook_search_request;
14501
14502    let uri_str = format!("{}/api/webhook/search", configuration.base_path);
14503    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14504
14505    if let Some(ref user_agent) = configuration.user_agent {
14506        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14507    }
14508    if let Some(ref apikey) = configuration.api_key {
14509        let key = apikey.key.clone();
14510        let value = match apikey.prefix {
14511            Some(ref prefix) => format!("{} {}", prefix, key),
14512            None => key,
14513        };
14514        req_builder = req_builder.header("Authorization", value);
14515    };
14516    req_builder = req_builder.json(&p_body_webhook_search_request);
14517
14518    let req = req_builder.build()?;
14519    let resp = configuration.client.execute(req).await?;
14520
14521    let status = resp.status();
14522    let content_type = resp
14523        .headers()
14524        .get("content-type")
14525        .and_then(|v| v.to_str().ok())
14526        .unwrap_or("application/octet-stream");
14527    let content_type = super::ContentType::from(content_type);
14528
14529    if !status.is_client_error() && !status.is_server_error() {
14530        let content = resp.text().await?;
14531        match content_type {
14532            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14533            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookSearchResponse`"))),
14534            ContentType::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`")))),
14535        }
14536    } else {
14537        let content = resp.text().await?;
14538        let entity: Option<SearchWebhooksWithIdError> = serde_json::from_str(&content).ok();
14539        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14540    }
14541}
14542
14543/// Send an email using an email template Id. You can optionally provide <code>requestData</code> to access key value pairs in the email template.
14544pub async fn send_email_with_id(configuration: &configuration::Configuration, email_template_id: &str, send_request: Option<models::SendRequest>) -> Result<models::SendResponse, Error<SendEmailWithIdError>> {
14545    // add a prefix to parameters to efficiently prevent name collisions
14546    let p_path_email_template_id = email_template_id;
14547    let p_body_send_request = send_request;
14548
14549    let uri_str = format!("{}/api/email/send/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
14550    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14551
14552    if let Some(ref user_agent) = configuration.user_agent {
14553        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14554    }
14555    if let Some(ref apikey) = configuration.api_key {
14556        let key = apikey.key.clone();
14557        let value = match apikey.prefix {
14558            Some(ref prefix) => format!("{} {}", prefix, key),
14559            None => key,
14560        };
14561        req_builder = req_builder.header("Authorization", value);
14562    };
14563    req_builder = req_builder.json(&p_body_send_request);
14564
14565    let req = req_builder.build()?;
14566    let resp = configuration.client.execute(req).await?;
14567
14568    let status = resp.status();
14569    let content_type = resp
14570        .headers()
14571        .get("content-type")
14572        .and_then(|v| v.to_str().ok())
14573        .unwrap_or("application/octet-stream");
14574    let content_type = super::ContentType::from(content_type);
14575
14576    if !status.is_client_error() && !status.is_server_error() {
14577        let content = resp.text().await?;
14578        match content_type {
14579            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14580            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SendResponse`"))),
14581            ContentType::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`")))),
14582        }
14583    } else {
14584        let content = resp.text().await?;
14585        let entity: Option<SendEmailWithIdError> = serde_json::from_str(&content).ok();
14586        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14587    }
14588}
14589
14590/// 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.
14591pub async fn send_family_request_email_with_id(configuration: &configuration::Configuration, family_email_request: Option<models::FamilyEmailRequest>) -> Result<(), Error<SendFamilyRequestEmailWithIdError>> {
14592    // add a prefix to parameters to efficiently prevent name collisions
14593    let p_body_family_email_request = family_email_request;
14594
14595    let uri_str = format!("{}/api/user/family/request", configuration.base_path);
14596    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14597
14598    if let Some(ref user_agent) = configuration.user_agent {
14599        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14600    }
14601    if let Some(ref apikey) = configuration.api_key {
14602        let key = apikey.key.clone();
14603        let value = match apikey.prefix {
14604            Some(ref prefix) => format!("{} {}", prefix, key),
14605            None => key,
14606        };
14607        req_builder = req_builder.header("Authorization", value);
14608    };
14609    req_builder = req_builder.json(&p_body_family_email_request);
14610
14611    let req = req_builder.build()?;
14612    let resp = configuration.client.execute(req).await?;
14613
14614    let status = resp.status();
14615
14616    if !status.is_client_error() && !status.is_server_error() {
14617        Ok(())
14618    } else {
14619        let content = resp.text().await?;
14620        let entity: Option<SendFamilyRequestEmailWithIdError> = serde_json::from_str(&content).ok();
14621        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14622    }
14623}
14624
14625/// Send a passwordless authentication code in an email to complete login.
14626pub async fn send_passwordless_code_with_id(configuration: &configuration::Configuration, passwordless_send_request: Option<models::PasswordlessSendRequest>) -> Result<(), Error<SendPasswordlessCodeWithIdError>> {
14627    // add a prefix to parameters to efficiently prevent name collisions
14628    let p_body_passwordless_send_request = passwordless_send_request;
14629
14630    let uri_str = format!("{}/api/passwordless/send", configuration.base_path);
14631    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14632
14633    if let Some(ref user_agent) = configuration.user_agent {
14634        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14635    }
14636    if let Some(ref apikey) = configuration.api_key {
14637        let key = apikey.key.clone();
14638        let value = match apikey.prefix {
14639            Some(ref prefix) => format!("{} {}", prefix, key),
14640            None => key,
14641        };
14642        req_builder = req_builder.header("Authorization", value);
14643    };
14644    req_builder = req_builder.json(&p_body_passwordless_send_request);
14645
14646    let req = req_builder.build()?;
14647    let resp = configuration.client.execute(req).await?;
14648
14649    let status = resp.status();
14650
14651    if !status.is_client_error() && !status.is_server_error() {
14652        Ok(())
14653    } else {
14654        let content = resp.text().await?;
14655        let entity: Option<SendPasswordlessCodeWithIdError> = serde_json::from_str(&content).ok();
14656        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14657    }
14658}
14659
14660/// Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
14661pub async fn send_two_factor_code_for_enable_disable_with_id(configuration: &configuration::Configuration, two_factor_send_request: Option<models::TwoFactorSendRequest>) -> Result<(), Error<SendTwoFactorCodeForEnableDisableWithIdError>> {
14662    // add a prefix to parameters to efficiently prevent name collisions
14663    let p_body_two_factor_send_request = two_factor_send_request;
14664
14665    let uri_str = format!("{}/api/two-factor/send", configuration.base_path);
14666    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14667
14668    if let Some(ref user_agent) = configuration.user_agent {
14669        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14670    }
14671    if let Some(ref apikey) = configuration.api_key {
14672        let key = apikey.key.clone();
14673        let value = match apikey.prefix {
14674            Some(ref prefix) => format!("{} {}", prefix, key),
14675            None => key,
14676        };
14677        req_builder = req_builder.header("Authorization", value);
14678    };
14679    req_builder = req_builder.json(&p_body_two_factor_send_request);
14680
14681    let req = req_builder.build()?;
14682    let resp = configuration.client.execute(req).await?;
14683
14684    let status = resp.status();
14685
14686    if !status.is_client_error() && !status.is_server_error() {
14687        Ok(())
14688    } else {
14689        let content = resp.text().await?;
14690        let entity: Option<SendTwoFactorCodeForEnableDisableWithIdError> = serde_json::from_str(&content).ok();
14691        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14692    }
14693}
14694
14695/// Send a Two Factor authentication code to allow the completion of Two Factor authentication.
14696pub 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>> {
14697    // add a prefix to parameters to efficiently prevent name collisions
14698    let p_path_two_factor_id = two_factor_id;
14699    let p_body_two_factor_send_request = two_factor_send_request;
14700
14701    let uri_str = format!("{}/api/two-factor/send/{twoFactorId}", configuration.base_path, twoFactorId=crate::apis::urlencode(p_path_two_factor_id));
14702    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14703
14704    if let Some(ref user_agent) = configuration.user_agent {
14705        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14706    }
14707    if let Some(ref apikey) = configuration.api_key {
14708        let key = apikey.key.clone();
14709        let value = match apikey.prefix {
14710            Some(ref prefix) => format!("{} {}", prefix, key),
14711            None => key,
14712        };
14713        req_builder = req_builder.header("Authorization", value);
14714    };
14715    req_builder = req_builder.json(&p_body_two_factor_send_request);
14716
14717    let req = req_builder.build()?;
14718    let resp = configuration.client.execute(req).await?;
14719
14720    let status = resp.status();
14721
14722    if !status.is_client_error() && !status.is_server_error() {
14723        Ok(())
14724    } else {
14725        let content = resp.text().await?;
14726        let entity: Option<SendTwoFactorCodeForLoginUsingMethodWithIdError> = serde_json::from_str(&content).ok();
14727        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14728    }
14729}
14730
14731/// Send a verification code using the appropriate transport for the identity type being verified.
14732pub async fn send_verify_identity_with_id(configuration: &configuration::Configuration, verify_send_request: Option<models::VerifySendRequest>) -> Result<(), Error<SendVerifyIdentityWithIdError>> {
14733    // add a prefix to parameters to efficiently prevent name collisions
14734    let p_body_verify_send_request = verify_send_request;
14735
14736    let uri_str = format!("{}/api/identity/verify/send", configuration.base_path);
14737    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14738
14739    if let Some(ref user_agent) = configuration.user_agent {
14740        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14741    }
14742    if let Some(ref apikey) = configuration.api_key {
14743        let key = apikey.key.clone();
14744        let value = match apikey.prefix {
14745            Some(ref prefix) => format!("{} {}", prefix, key),
14746            None => key,
14747        };
14748        req_builder = req_builder.header("Authorization", value);
14749    };
14750    req_builder = req_builder.json(&p_body_verify_send_request);
14751
14752    let req = req_builder.build()?;
14753    let resp = configuration.client.execute(req).await?;
14754
14755    let status = resp.status();
14756
14757    if !status.is_client_error() && !status.is_server_error() {
14758        Ok(())
14759    } else {
14760        let content = resp.text().await?;
14761        let entity: Option<SendVerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
14762        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14763    }
14764}
14765
14766/// Begins a login request for a 3rd party login that requires user interaction such as HYPR.
14767pub async fn start_identity_provider_login_with_id(configuration: &configuration::Configuration, identity_provider_start_login_request: Option<models::IdentityProviderStartLoginRequest>) -> Result<models::IdentityProviderStartLoginResponse, Error<StartIdentityProviderLoginWithIdError>> {
14768    // add a prefix to parameters to efficiently prevent name collisions
14769    let p_body_identity_provider_start_login_request = identity_provider_start_login_request;
14770
14771    let uri_str = format!("{}/api/identity-provider/start", configuration.base_path);
14772    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14773
14774    if let Some(ref user_agent) = configuration.user_agent {
14775        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14776    }
14777    if let Some(ref apikey) = configuration.api_key {
14778        let key = apikey.key.clone();
14779        let value = match apikey.prefix {
14780            Some(ref prefix) => format!("{} {}", prefix, key),
14781            None => key,
14782        };
14783        req_builder = req_builder.header("Authorization", value);
14784    };
14785    req_builder = req_builder.json(&p_body_identity_provider_start_login_request);
14786
14787    let req = req_builder.build()?;
14788    let resp = configuration.client.execute(req).await?;
14789
14790    let status = resp.status();
14791    let content_type = resp
14792        .headers()
14793        .get("content-type")
14794        .and_then(|v| v.to_str().ok())
14795        .unwrap_or("application/octet-stream");
14796    let content_type = super::ContentType::from(content_type);
14797
14798    if !status.is_client_error() && !status.is_server_error() {
14799        let content = resp.text().await?;
14800        match content_type {
14801            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14802            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderStartLoginResponse`"))),
14803            ContentType::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`")))),
14804        }
14805    } else {
14806        let content = resp.text().await?;
14807        let entity: Option<StartIdentityProviderLoginWithIdError> = serde_json::from_str(&content).ok();
14808        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14809    }
14810}
14811
14812/// 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.
14813pub async fn start_passwordless_login_with_id(configuration: &configuration::Configuration, passwordless_start_request: Option<models::PasswordlessStartRequest>) -> Result<models::PasswordlessStartResponse, Error<StartPasswordlessLoginWithIdError>> {
14814    // add a prefix to parameters to efficiently prevent name collisions
14815    let p_body_passwordless_start_request = passwordless_start_request;
14816
14817    let uri_str = format!("{}/api/passwordless/start", configuration.base_path);
14818    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14819
14820    if let Some(ref user_agent) = configuration.user_agent {
14821        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14822    }
14823    if let Some(ref apikey) = configuration.api_key {
14824        let key = apikey.key.clone();
14825        let value = match apikey.prefix {
14826            Some(ref prefix) => format!("{} {}", prefix, key),
14827            None => key,
14828        };
14829        req_builder = req_builder.header("Authorization", value);
14830    };
14831    req_builder = req_builder.json(&p_body_passwordless_start_request);
14832
14833    let req = req_builder.build()?;
14834    let resp = configuration.client.execute(req).await?;
14835
14836    let status = resp.status();
14837    let content_type = resp
14838        .headers()
14839        .get("content-type")
14840        .and_then(|v| v.to_str().ok())
14841        .unwrap_or("application/octet-stream");
14842    let content_type = super::ContentType::from(content_type);
14843
14844    if !status.is_client_error() && !status.is_server_error() {
14845        let content = resp.text().await?;
14846        match content_type {
14847            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14848            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PasswordlessStartResponse`"))),
14849            ContentType::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`")))),
14850        }
14851    } else {
14852        let content = resp.text().await?;
14853        let entity: Option<StartPasswordlessLoginWithIdError> = serde_json::from_str(&content).ok();
14854        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14855    }
14856}
14857
14858/// 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).
14859pub async fn start_two_factor_login_with_id(configuration: &configuration::Configuration, two_factor_start_request: Option<models::TwoFactorStartRequest>) -> Result<models::TwoFactorStartResponse, Error<StartTwoFactorLoginWithIdError>> {
14860    // add a prefix to parameters to efficiently prevent name collisions
14861    let p_body_two_factor_start_request = two_factor_start_request;
14862
14863    let uri_str = format!("{}/api/two-factor/start", configuration.base_path);
14864    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14865
14866    if let Some(ref user_agent) = configuration.user_agent {
14867        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14868    }
14869    if let Some(ref apikey) = configuration.api_key {
14870        let key = apikey.key.clone();
14871        let value = match apikey.prefix {
14872            Some(ref prefix) => format!("{} {}", prefix, key),
14873            None => key,
14874        };
14875        req_builder = req_builder.header("Authorization", value);
14876    };
14877    req_builder = req_builder.json(&p_body_two_factor_start_request);
14878
14879    let req = req_builder.build()?;
14880    let resp = configuration.client.execute(req).await?;
14881
14882    let status = resp.status();
14883    let content_type = resp
14884        .headers()
14885        .get("content-type")
14886        .and_then(|v| v.to_str().ok())
14887        .unwrap_or("application/octet-stream");
14888    let content_type = super::ContentType::from(content_type);
14889
14890    if !status.is_client_error() && !status.is_server_error() {
14891        let content = resp.text().await?;
14892        match content_type {
14893            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14894            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TwoFactorStartResponse`"))),
14895            ContentType::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`")))),
14896        }
14897    } else {
14898        let content = resp.text().await?;
14899        let entity: Option<StartTwoFactorLoginWithIdError> = serde_json::from_str(&content).ok();
14900        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14901    }
14902}
14903
14904/// 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.
14905pub async fn start_verify_identity_with_id(configuration: &configuration::Configuration, verify_start_request: Option<models::VerifyStartRequest>) -> Result<models::VerifyStartResponse, Error<StartVerifyIdentityWithIdError>> {
14906    // add a prefix to parameters to efficiently prevent name collisions
14907    let p_body_verify_start_request = verify_start_request;
14908
14909    let uri_str = format!("{}/api/identity/verify/start", configuration.base_path);
14910    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14911
14912    if let Some(ref user_agent) = configuration.user_agent {
14913        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14914    }
14915    if let Some(ref apikey) = configuration.api_key {
14916        let key = apikey.key.clone();
14917        let value = match apikey.prefix {
14918            Some(ref prefix) => format!("{} {}", prefix, key),
14919            None => key,
14920        };
14921        req_builder = req_builder.header("Authorization", value);
14922    };
14923    req_builder = req_builder.json(&p_body_verify_start_request);
14924
14925    let req = req_builder.build()?;
14926    let resp = configuration.client.execute(req).await?;
14927
14928    let status = resp.status();
14929    let content_type = resp
14930        .headers()
14931        .get("content-type")
14932        .and_then(|v| v.to_str().ok())
14933        .unwrap_or("application/octet-stream");
14934    let content_type = super::ContentType::from(content_type);
14935
14936    if !status.is_client_error() && !status.is_server_error() {
14937        let content = resp.text().await?;
14938        match content_type {
14939            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14940            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyStartResponse`"))),
14941            ContentType::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`")))),
14942        }
14943    } else {
14944        let content = resp.text().await?;
14945        let entity: Option<StartVerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
14946        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14947    }
14948}
14949
14950/// Start a WebAuthn authentication ceremony by generating a new challenge for the user
14951pub async fn start_web_authn_login_with_id(configuration: &configuration::Configuration, web_authn_start_request: Option<models::WebAuthnStartRequest>) -> Result<models::WebAuthnStartResponse, Error<StartWebAuthnLoginWithIdError>> {
14952    // add a prefix to parameters to efficiently prevent name collisions
14953    let p_body_web_authn_start_request = web_authn_start_request;
14954
14955    let uri_str = format!("{}/api/webauthn/start", configuration.base_path);
14956    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
14957
14958    if let Some(ref user_agent) = configuration.user_agent {
14959        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
14960    }
14961    if let Some(ref apikey) = configuration.api_key {
14962        let key = apikey.key.clone();
14963        let value = match apikey.prefix {
14964            Some(ref prefix) => format!("{} {}", prefix, key),
14965            None => key,
14966        };
14967        req_builder = req_builder.header("Authorization", value);
14968    };
14969    req_builder = req_builder.json(&p_body_web_authn_start_request);
14970
14971    let req = req_builder.build()?;
14972    let resp = configuration.client.execute(req).await?;
14973
14974    let status = resp.status();
14975    let content_type = resp
14976        .headers()
14977        .get("content-type")
14978        .and_then(|v| v.to_str().ok())
14979        .unwrap_or("application/octet-stream");
14980    let content_type = super::ContentType::from(content_type);
14981
14982    if !status.is_client_error() && !status.is_server_error() {
14983        let content = resp.text().await?;
14984        match content_type {
14985            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
14986            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnStartResponse`"))),
14987            ContentType::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`")))),
14988        }
14989    } else {
14990        let content = resp.text().await?;
14991        let entity: Option<StartWebAuthnLoginWithIdError> = serde_json::from_str(&content).ok();
14992        Err(Error::ResponseError(ResponseContent { status, content, entity }))
14993    }
14994}
14995
14996/// Start a WebAuthn registration ceremony by generating a new challenge for the user
14997pub async fn start_web_authn_registration_with_id(configuration: &configuration::Configuration, web_authn_register_start_request: Option<models::WebAuthnRegisterStartRequest>) -> Result<models::WebAuthnRegisterStartResponse, Error<StartWebAuthnRegistrationWithIdError>> {
14998    // add a prefix to parameters to efficiently prevent name collisions
14999    let p_body_web_authn_register_start_request = web_authn_register_start_request;
15000
15001    let uri_str = format!("{}/api/webauthn/register/start", configuration.base_path);
15002    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
15003
15004    if let Some(ref user_agent) = configuration.user_agent {
15005        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15006    }
15007    if let Some(ref apikey) = configuration.api_key {
15008        let key = apikey.key.clone();
15009        let value = match apikey.prefix {
15010            Some(ref prefix) => format!("{} {}", prefix, key),
15011            None => key,
15012        };
15013        req_builder = req_builder.header("Authorization", value);
15014    };
15015    req_builder = req_builder.json(&p_body_web_authn_register_start_request);
15016
15017    let req = req_builder.build()?;
15018    let resp = configuration.client.execute(req).await?;
15019
15020    let status = resp.status();
15021    let content_type = resp
15022        .headers()
15023        .get("content-type")
15024        .and_then(|v| v.to_str().ok())
15025        .unwrap_or("application/octet-stream");
15026    let content_type = super::ContentType::from(content_type);
15027
15028    if !status.is_client_error() && !status.is_server_error() {
15029        let content = resp.text().await?;
15030        match content_type {
15031            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15032            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnRegisterStartResponse`"))),
15033            ContentType::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`")))),
15034        }
15035    } else {
15036        let content = resp.text().await?;
15037        let entity: Option<StartWebAuthnRegistrationWithIdError> = serde_json::from_str(&content).ok();
15038        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15039    }
15040}
15041
15042/// Complete login using a 2FA challenge
15043pub async fn two_factor_login_with_id(configuration: &configuration::Configuration, two_factor_login_request: Option<models::TwoFactorLoginRequest>) -> Result<models::LoginResponse, Error<TwoFactorLoginWithIdError>> {
15044    // add a prefix to parameters to efficiently prevent name collisions
15045    let p_body_two_factor_login_request = two_factor_login_request;
15046
15047    let uri_str = format!("{}/api/two-factor/login", configuration.base_path);
15048    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
15049
15050    if let Some(ref user_agent) = configuration.user_agent {
15051        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15052    }
15053    if let Some(ref apikey) = configuration.api_key {
15054        let key = apikey.key.clone();
15055        let value = match apikey.prefix {
15056            Some(ref prefix) => format!("{} {}", prefix, key),
15057            None => key,
15058        };
15059        req_builder = req_builder.header("Authorization", value);
15060    };
15061    req_builder = req_builder.json(&p_body_two_factor_login_request);
15062
15063    let req = req_builder.build()?;
15064    let resp = configuration.client.execute(req).await?;
15065
15066    let status = resp.status();
15067    let content_type = resp
15068        .headers()
15069        .get("content-type")
15070        .and_then(|v| v.to_str().ok())
15071        .unwrap_or("application/octet-stream");
15072    let content_type = super::ContentType::from(content_type);
15073
15074    if !status.is_client_error() && !status.is_server_error() {
15075        let content = resp.text().await?;
15076        match content_type {
15077            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15078            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LoginResponse`"))),
15079            ContentType::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`")))),
15080        }
15081    } else {
15082        let content = resp.text().await?;
15083        let entity: Option<TwoFactorLoginWithIdError> = serde_json::from_str(&content).ok();
15084        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15085    }
15086}
15087
15088/// Updates an API key with the given Id.
15089pub async fn update_api_key_with_id(configuration: &configuration::Configuration, key_id: &str, api_key_request: Option<models::ApiKeyRequest>) -> Result<models::ApiKeyResponse, Error<UpdateApiKeyWithIdError>> {
15090    // add a prefix to parameters to efficiently prevent name collisions
15091    let p_path_key_id = key_id;
15092    let p_body_api_key_request = api_key_request;
15093
15094    let uri_str = format!("{}/api/api-key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
15095    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15096
15097    if let Some(ref user_agent) = configuration.user_agent {
15098        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15099    }
15100    if let Some(ref apikey) = configuration.api_key {
15101        let key = apikey.key.clone();
15102        let value = match apikey.prefix {
15103            Some(ref prefix) => format!("{} {}", prefix, key),
15104            None => key,
15105        };
15106        req_builder = req_builder.header("Authorization", value);
15107    };
15108    req_builder = req_builder.json(&p_body_api_key_request);
15109
15110    let req = req_builder.build()?;
15111    let resp = configuration.client.execute(req).await?;
15112
15113    let status = resp.status();
15114    let content_type = resp
15115        .headers()
15116        .get("content-type")
15117        .and_then(|v| v.to_str().ok())
15118        .unwrap_or("application/octet-stream");
15119    let content_type = super::ContentType::from(content_type);
15120
15121    if !status.is_client_error() && !status.is_server_error() {
15122        let content = resp.text().await?;
15123        match content_type {
15124            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15125            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponse`"))),
15126            ContentType::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`")))),
15127        }
15128    } else {
15129        let content = resp.text().await?;
15130        let entity: Option<UpdateApiKeyWithIdError> = serde_json::from_str(&content).ok();
15131        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15132    }
15133}
15134
15135/// Updates the application role with the given Id for the application.
15136pub 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>> {
15137    // add a prefix to parameters to efficiently prevent name collisions
15138    let p_path_application_id = application_id;
15139    let p_path_role_id = role_id;
15140    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15141    let p_body_application_request = application_request;
15142
15143    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));
15144    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15145
15146    if let Some(ref user_agent) = configuration.user_agent {
15147        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15148    }
15149    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15150        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15151    }
15152    if let Some(ref apikey) = configuration.api_key {
15153        let key = apikey.key.clone();
15154        let value = match apikey.prefix {
15155            Some(ref prefix) => format!("{} {}", prefix, key),
15156            None => key,
15157        };
15158        req_builder = req_builder.header("Authorization", value);
15159    };
15160    req_builder = req_builder.json(&p_body_application_request);
15161
15162    let req = req_builder.build()?;
15163    let resp = configuration.client.execute(req).await?;
15164
15165    let status = resp.status();
15166    let content_type = resp
15167        .headers()
15168        .get("content-type")
15169        .and_then(|v| v.to_str().ok())
15170        .unwrap_or("application/octet-stream");
15171    let content_type = super::ContentType::from(content_type);
15172
15173    if !status.is_client_error() && !status.is_server_error() {
15174        let content = resp.text().await?;
15175        match content_type {
15176            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15177            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
15178            ContentType::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`")))),
15179        }
15180    } else {
15181        let content = resp.text().await?;
15182        let entity: Option<UpdateApplicationRoleWithIdError> = serde_json::from_str(&content).ok();
15183        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15184    }
15185}
15186
15187/// Updates the application with the given Id. OR Reactivates the application with the given Id.
15188pub 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>> {
15189    // add a prefix to parameters to efficiently prevent name collisions
15190    let p_path_application_id = application_id;
15191    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15192    let p_query_reactivate = reactivate;
15193    let p_body_application_request = application_request;
15194
15195    let uri_str = format!("{}/api/application/{applicationId}", configuration.base_path, applicationId=crate::apis::urlencode(p_path_application_id));
15196    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15197
15198    if let Some(ref param_value) = p_query_reactivate {
15199        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
15200    }
15201    if let Some(ref user_agent) = configuration.user_agent {
15202        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15203    }
15204    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15205        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15206    }
15207    if let Some(ref apikey) = configuration.api_key {
15208        let key = apikey.key.clone();
15209        let value = match apikey.prefix {
15210            Some(ref prefix) => format!("{} {}", prefix, key),
15211            None => key,
15212        };
15213        req_builder = req_builder.header("Authorization", value);
15214    };
15215    req_builder = req_builder.json(&p_body_application_request);
15216
15217    let req = req_builder.build()?;
15218    let resp = configuration.client.execute(req).await?;
15219
15220    let status = resp.status();
15221    let content_type = resp
15222        .headers()
15223        .get("content-type")
15224        .and_then(|v| v.to_str().ok())
15225        .unwrap_or("application/octet-stream");
15226    let content_type = super::ContentType::from(content_type);
15227
15228    if !status.is_client_error() && !status.is_server_error() {
15229        let content = resp.text().await?;
15230        match content_type {
15231            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15232            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationResponse`"))),
15233            ContentType::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`")))),
15234        }
15235    } else {
15236        let content = resp.text().await?;
15237        let entity: Option<UpdateApplicationWithIdError> = serde_json::from_str(&content).ok();
15238        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15239    }
15240}
15241
15242/// Updates the connector with the given Id.
15243pub async fn update_connector_with_id(configuration: &configuration::Configuration, connector_id: &str, connector_request: Option<models::ConnectorRequest>) -> Result<models::ConnectorResponse, Error<UpdateConnectorWithIdError>> {
15244    // add a prefix to parameters to efficiently prevent name collisions
15245    let p_path_connector_id = connector_id;
15246    let p_body_connector_request = connector_request;
15247
15248    let uri_str = format!("{}/api/connector/{connectorId}", configuration.base_path, connectorId=crate::apis::urlencode(p_path_connector_id));
15249    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15250
15251    if let Some(ref user_agent) = configuration.user_agent {
15252        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15253    }
15254    if let Some(ref apikey) = configuration.api_key {
15255        let key = apikey.key.clone();
15256        let value = match apikey.prefix {
15257            Some(ref prefix) => format!("{} {}", prefix, key),
15258            None => key,
15259        };
15260        req_builder = req_builder.header("Authorization", value);
15261    };
15262    req_builder = req_builder.json(&p_body_connector_request);
15263
15264    let req = req_builder.build()?;
15265    let resp = configuration.client.execute(req).await?;
15266
15267    let status = resp.status();
15268    let content_type = resp
15269        .headers()
15270        .get("content-type")
15271        .and_then(|v| v.to_str().ok())
15272        .unwrap_or("application/octet-stream");
15273    let content_type = super::ContentType::from(content_type);
15274
15275    if !status.is_client_error() && !status.is_server_error() {
15276        let content = resp.text().await?;
15277        match content_type {
15278            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15279            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConnectorResponse`"))),
15280            ContentType::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`")))),
15281        }
15282    } else {
15283        let content = resp.text().await?;
15284        let entity: Option<UpdateConnectorWithIdError> = serde_json::from_str(&content).ok();
15285        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15286    }
15287}
15288
15289/// Updates the consent with the given Id.
15290pub 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>> {
15291    // add a prefix to parameters to efficiently prevent name collisions
15292    let p_path_consent_id = consent_id;
15293    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15294    let p_body_consent_request = consent_request;
15295
15296    let uri_str = format!("{}/api/consent/{consentId}", configuration.base_path, consentId=crate::apis::urlencode(p_path_consent_id));
15297    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15298
15299    if let Some(ref user_agent) = configuration.user_agent {
15300        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15301    }
15302    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15303        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15304    }
15305    if let Some(ref apikey) = configuration.api_key {
15306        let key = apikey.key.clone();
15307        let value = match apikey.prefix {
15308            Some(ref prefix) => format!("{} {}", prefix, key),
15309            None => key,
15310        };
15311        req_builder = req_builder.header("Authorization", value);
15312    };
15313    req_builder = req_builder.json(&p_body_consent_request);
15314
15315    let req = req_builder.build()?;
15316    let resp = configuration.client.execute(req).await?;
15317
15318    let status = resp.status();
15319    let content_type = resp
15320        .headers()
15321        .get("content-type")
15322        .and_then(|v| v.to_str().ok())
15323        .unwrap_or("application/octet-stream");
15324    let content_type = super::ContentType::from(content_type);
15325
15326    if !status.is_client_error() && !status.is_server_error() {
15327        let content = resp.text().await?;
15328        match content_type {
15329            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15330            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConsentResponse`"))),
15331            ContentType::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`")))),
15332        }
15333    } else {
15334        let content = resp.text().await?;
15335        let entity: Option<UpdateConsentWithIdError> = serde_json::from_str(&content).ok();
15336        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15337    }
15338}
15339
15340/// Updates the email template with the given Id.
15341pub 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>> {
15342    // add a prefix to parameters to efficiently prevent name collisions
15343    let p_path_email_template_id = email_template_id;
15344    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15345    let p_body_email_template_request = email_template_request;
15346
15347    let uri_str = format!("{}/api/email/template/{emailTemplateId}", configuration.base_path, emailTemplateId=crate::apis::urlencode(p_path_email_template_id));
15348    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15349
15350    if let Some(ref user_agent) = configuration.user_agent {
15351        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15352    }
15353    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15354        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15355    }
15356    if let Some(ref apikey) = configuration.api_key {
15357        let key = apikey.key.clone();
15358        let value = match apikey.prefix {
15359            Some(ref prefix) => format!("{} {}", prefix, key),
15360            None => key,
15361        };
15362        req_builder = req_builder.header("Authorization", value);
15363    };
15364    req_builder = req_builder.json(&p_body_email_template_request);
15365
15366    let req = req_builder.build()?;
15367    let resp = configuration.client.execute(req).await?;
15368
15369    let status = resp.status();
15370    let content_type = resp
15371        .headers()
15372        .get("content-type")
15373        .and_then(|v| v.to_str().ok())
15374        .unwrap_or("application/octet-stream");
15375    let content_type = super::ContentType::from(content_type);
15376
15377    if !status.is_client_error() && !status.is_server_error() {
15378        let content = resp.text().await?;
15379        match content_type {
15380            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15381            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EmailTemplateResponse`"))),
15382            ContentType::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`")))),
15383        }
15384    } else {
15385        let content = resp.text().await?;
15386        let entity: Option<UpdateEmailTemplateWithIdError> = serde_json::from_str(&content).ok();
15387        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15388    }
15389}
15390
15391/// Updates the permission with the given Id for the entity type.
15392pub 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>> {
15393    // add a prefix to parameters to efficiently prevent name collisions
15394    let p_path_entity_type_id = entity_type_id;
15395    let p_path_permission_id = permission_id;
15396    let p_body_entity_type_request = entity_type_request;
15397
15398    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));
15399    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15400
15401    if let Some(ref user_agent) = configuration.user_agent {
15402        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15403    }
15404    if let Some(ref apikey) = configuration.api_key {
15405        let key = apikey.key.clone();
15406        let value = match apikey.prefix {
15407            Some(ref prefix) => format!("{} {}", prefix, key),
15408            None => key,
15409        };
15410        req_builder = req_builder.header("Authorization", value);
15411    };
15412    req_builder = req_builder.json(&p_body_entity_type_request);
15413
15414    let req = req_builder.build()?;
15415    let resp = configuration.client.execute(req).await?;
15416
15417    let status = resp.status();
15418    let content_type = resp
15419        .headers()
15420        .get("content-type")
15421        .and_then(|v| v.to_str().ok())
15422        .unwrap_or("application/octet-stream");
15423    let content_type = super::ContentType::from(content_type);
15424
15425    if !status.is_client_error() && !status.is_server_error() {
15426        let content = resp.text().await?;
15427        match content_type {
15428            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15429            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
15430            ContentType::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`")))),
15431        }
15432    } else {
15433        let content = resp.text().await?;
15434        let entity: Option<UpdateEntityTypePermissionWithIdError> = serde_json::from_str(&content).ok();
15435        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15436    }
15437}
15438
15439/// Updates the Entity Type with the given Id.
15440pub 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>> {
15441    // add a prefix to parameters to efficiently prevent name collisions
15442    let p_path_entity_type_id = entity_type_id;
15443    let p_body_entity_type_request = entity_type_request;
15444
15445    let uri_str = format!("{}/api/entity/type/{entityTypeId}", configuration.base_path, entityTypeId=crate::apis::urlencode(p_path_entity_type_id));
15446    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15447
15448    if let Some(ref user_agent) = configuration.user_agent {
15449        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15450    }
15451    if let Some(ref apikey) = configuration.api_key {
15452        let key = apikey.key.clone();
15453        let value = match apikey.prefix {
15454            Some(ref prefix) => format!("{} {}", prefix, key),
15455            None => key,
15456        };
15457        req_builder = req_builder.header("Authorization", value);
15458    };
15459    req_builder = req_builder.json(&p_body_entity_type_request);
15460
15461    let req = req_builder.build()?;
15462    let resp = configuration.client.execute(req).await?;
15463
15464    let status = resp.status();
15465    let content_type = resp
15466        .headers()
15467        .get("content-type")
15468        .and_then(|v| v.to_str().ok())
15469        .unwrap_or("application/octet-stream");
15470    let content_type = super::ContentType::from(content_type);
15471
15472    if !status.is_client_error() && !status.is_server_error() {
15473        let content = resp.text().await?;
15474        match content_type {
15475            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15476            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityTypeResponse`"))),
15477            ContentType::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`")))),
15478        }
15479    } else {
15480        let content = resp.text().await?;
15481        let entity: Option<UpdateEntityTypeWithIdError> = serde_json::from_str(&content).ok();
15482        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15483    }
15484}
15485
15486/// Updates the Entity with the given Id.
15487pub 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>> {
15488    // add a prefix to parameters to efficiently prevent name collisions
15489    let p_path_entity_id = entity_id;
15490    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15491    let p_body_entity_request = entity_request;
15492
15493    let uri_str = format!("{}/api/entity/{entityId}", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
15494    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15495
15496    if let Some(ref user_agent) = configuration.user_agent {
15497        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15498    }
15499    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15500        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15501    }
15502    if let Some(ref apikey) = configuration.api_key {
15503        let key = apikey.key.clone();
15504        let value = match apikey.prefix {
15505            Some(ref prefix) => format!("{} {}", prefix, key),
15506            None => key,
15507        };
15508        req_builder = req_builder.header("Authorization", value);
15509    };
15510    req_builder = req_builder.json(&p_body_entity_request);
15511
15512    let req = req_builder.build()?;
15513    let resp = configuration.client.execute(req).await?;
15514
15515    let status = resp.status();
15516    let content_type = resp
15517        .headers()
15518        .get("content-type")
15519        .and_then(|v| v.to_str().ok())
15520        .unwrap_or("application/octet-stream");
15521    let content_type = super::ContentType::from(content_type);
15522
15523    if !status.is_client_error() && !status.is_server_error() {
15524        let content = resp.text().await?;
15525        match content_type {
15526            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15527            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EntityResponse`"))),
15528            ContentType::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`")))),
15529        }
15530    } else {
15531        let content = resp.text().await?;
15532        let entity: Option<UpdateEntityWithIdError> = serde_json::from_str(&content).ok();
15533        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15534    }
15535}
15536
15537/// Updates the form field with the given Id.
15538pub async fn update_form_field_with_id(configuration: &configuration::Configuration, field_id: &str, form_field_request: Option<models::FormFieldRequest>) -> Result<models::FormFieldResponse, Error<UpdateFormFieldWithIdError>> {
15539    // add a prefix to parameters to efficiently prevent name collisions
15540    let p_path_field_id = field_id;
15541    let p_body_form_field_request = form_field_request;
15542
15543    let uri_str = format!("{}/api/form/field/{fieldId}", configuration.base_path, fieldId=crate::apis::urlencode(p_path_field_id));
15544    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15545
15546    if let Some(ref user_agent) = configuration.user_agent {
15547        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15548    }
15549    if let Some(ref apikey) = configuration.api_key {
15550        let key = apikey.key.clone();
15551        let value = match apikey.prefix {
15552            Some(ref prefix) => format!("{} {}", prefix, key),
15553            None => key,
15554        };
15555        req_builder = req_builder.header("Authorization", value);
15556    };
15557    req_builder = req_builder.json(&p_body_form_field_request);
15558
15559    let req = req_builder.build()?;
15560    let resp = configuration.client.execute(req).await?;
15561
15562    let status = resp.status();
15563    let content_type = resp
15564        .headers()
15565        .get("content-type")
15566        .and_then(|v| v.to_str().ok())
15567        .unwrap_or("application/octet-stream");
15568    let content_type = super::ContentType::from(content_type);
15569
15570    if !status.is_client_error() && !status.is_server_error() {
15571        let content = resp.text().await?;
15572        match content_type {
15573            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15574            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormFieldResponse`"))),
15575            ContentType::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`")))),
15576        }
15577    } else {
15578        let content = resp.text().await?;
15579        let entity: Option<UpdateFormFieldWithIdError> = serde_json::from_str(&content).ok();
15580        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15581    }
15582}
15583
15584/// Updates the form with the given Id.
15585pub async fn update_form_with_id(configuration: &configuration::Configuration, form_id: &str, form_request: Option<models::FormRequest>) -> Result<models::FormResponse, Error<UpdateFormWithIdError>> {
15586    // add a prefix to parameters to efficiently prevent name collisions
15587    let p_path_form_id = form_id;
15588    let p_body_form_request = form_request;
15589
15590    let uri_str = format!("{}/api/form/{formId}", configuration.base_path, formId=crate::apis::urlencode(p_path_form_id));
15591    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15592
15593    if let Some(ref user_agent) = configuration.user_agent {
15594        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15595    }
15596    if let Some(ref apikey) = configuration.api_key {
15597        let key = apikey.key.clone();
15598        let value = match apikey.prefix {
15599            Some(ref prefix) => format!("{} {}", prefix, key),
15600            None => key,
15601        };
15602        req_builder = req_builder.header("Authorization", value);
15603    };
15604    req_builder = req_builder.json(&p_body_form_request);
15605
15606    let req = req_builder.build()?;
15607    let resp = configuration.client.execute(req).await?;
15608
15609    let status = resp.status();
15610    let content_type = resp
15611        .headers()
15612        .get("content-type")
15613        .and_then(|v| v.to_str().ok())
15614        .unwrap_or("application/octet-stream");
15615    let content_type = super::ContentType::from(content_type);
15616
15617    if !status.is_client_error() && !status.is_server_error() {
15618        let content = resp.text().await?;
15619        match content_type {
15620            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15621            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FormResponse`"))),
15622            ContentType::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`")))),
15623        }
15624    } else {
15625        let content = resp.text().await?;
15626        let entity: Option<UpdateFormWithIdError> = serde_json::from_str(&content).ok();
15627        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15628    }
15629}
15630
15631/// Creates a member in a group.
15632pub async fn update_group_members_with_id(configuration: &configuration::Configuration, member_request: Option<models::MemberRequest>) -> Result<models::MemberResponse, Error<UpdateGroupMembersWithIdError>> {
15633    // add a prefix to parameters to efficiently prevent name collisions
15634    let p_body_member_request = member_request;
15635
15636    let uri_str = format!("{}/api/group/member", configuration.base_path);
15637    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15638
15639    if let Some(ref user_agent) = configuration.user_agent {
15640        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15641    }
15642    if let Some(ref apikey) = configuration.api_key {
15643        let key = apikey.key.clone();
15644        let value = match apikey.prefix {
15645            Some(ref prefix) => format!("{} {}", prefix, key),
15646            None => key,
15647        };
15648        req_builder = req_builder.header("Authorization", value);
15649    };
15650    req_builder = req_builder.json(&p_body_member_request);
15651
15652    let req = req_builder.build()?;
15653    let resp = configuration.client.execute(req).await?;
15654
15655    let status = resp.status();
15656    let content_type = resp
15657        .headers()
15658        .get("content-type")
15659        .and_then(|v| v.to_str().ok())
15660        .unwrap_or("application/octet-stream");
15661    let content_type = super::ContentType::from(content_type);
15662
15663    if !status.is_client_error() && !status.is_server_error() {
15664        let content = resp.text().await?;
15665        match content_type {
15666            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15667            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MemberResponse`"))),
15668            ContentType::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`")))),
15669        }
15670    } else {
15671        let content = resp.text().await?;
15672        let entity: Option<UpdateGroupMembersWithIdError> = serde_json::from_str(&content).ok();
15673        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15674    }
15675}
15676
15677/// Updates the group with the given Id.
15678pub 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>> {
15679    // add a prefix to parameters to efficiently prevent name collisions
15680    let p_path_group_id = group_id;
15681    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
15682    let p_body_group_request = group_request;
15683
15684    let uri_str = format!("{}/api/group/{groupId}", configuration.base_path, groupId=crate::apis::urlencode(p_path_group_id));
15685    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15686
15687    if let Some(ref user_agent) = configuration.user_agent {
15688        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15689    }
15690    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
15691        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
15692    }
15693    if let Some(ref apikey) = configuration.api_key {
15694        let key = apikey.key.clone();
15695        let value = match apikey.prefix {
15696            Some(ref prefix) => format!("{} {}", prefix, key),
15697            None => key,
15698        };
15699        req_builder = req_builder.header("Authorization", value);
15700    };
15701    req_builder = req_builder.json(&p_body_group_request);
15702
15703    let req = req_builder.build()?;
15704    let resp = configuration.client.execute(req).await?;
15705
15706    let status = resp.status();
15707    let content_type = resp
15708        .headers()
15709        .get("content-type")
15710        .and_then(|v| v.to_str().ok())
15711        .unwrap_or("application/octet-stream");
15712    let content_type = super::ContentType::from(content_type);
15713
15714    if !status.is_client_error() && !status.is_server_error() {
15715        let content = resp.text().await?;
15716        match content_type {
15717            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15718            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupResponse`"))),
15719            ContentType::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`")))),
15720        }
15721    } else {
15722        let content = resp.text().await?;
15723        let entity: Option<UpdateGroupWithIdError> = serde_json::from_str(&content).ok();
15724        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15725    }
15726}
15727
15728/// Updates the identity provider with the given Id.
15729pub 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>> {
15730    // add a prefix to parameters to efficiently prevent name collisions
15731    let p_path_identity_provider_id = identity_provider_id;
15732    let p_body_identity_provider_request = identity_provider_request;
15733
15734    let uri_str = format!("{}/api/identity-provider/{identityProviderId}", configuration.base_path, identityProviderId=crate::apis::urlencode(p_path_identity_provider_id));
15735    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15736
15737    if let Some(ref user_agent) = configuration.user_agent {
15738        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15739    }
15740    if let Some(ref apikey) = configuration.api_key {
15741        let key = apikey.key.clone();
15742        let value = match apikey.prefix {
15743            Some(ref prefix) => format!("{} {}", prefix, key),
15744            None => key,
15745        };
15746        req_builder = req_builder.header("Authorization", value);
15747    };
15748    req_builder = req_builder.json(&p_body_identity_provider_request);
15749
15750    let req = req_builder.build()?;
15751    let resp = configuration.client.execute(req).await?;
15752
15753    let status = resp.status();
15754    let content_type = resp
15755        .headers()
15756        .get("content-type")
15757        .and_then(|v| v.to_str().ok())
15758        .unwrap_or("application/octet-stream");
15759    let content_type = super::ContentType::from(content_type);
15760
15761    if !status.is_client_error() && !status.is_server_error() {
15762        let content = resp.text().await?;
15763        match content_type {
15764            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15765            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentityProviderResponse`"))),
15766            ContentType::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`")))),
15767        }
15768    } else {
15769        let content = resp.text().await?;
15770        let entity: Option<UpdateIdentityProviderWithIdError> = serde_json::from_str(&content).ok();
15771        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15772    }
15773}
15774
15775/// Updates the available integrations.
15776pub async fn update_integrations_with_id(configuration: &configuration::Configuration, integration_request: Option<models::IntegrationRequest>) -> Result<models::IntegrationResponse, Error<UpdateIntegrationsWithIdError>> {
15777    // add a prefix to parameters to efficiently prevent name collisions
15778    let p_body_integration_request = integration_request;
15779
15780    let uri_str = format!("{}/api/integration", configuration.base_path);
15781    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15782
15783    if let Some(ref user_agent) = configuration.user_agent {
15784        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15785    }
15786    if let Some(ref apikey) = configuration.api_key {
15787        let key = apikey.key.clone();
15788        let value = match apikey.prefix {
15789            Some(ref prefix) => format!("{} {}", prefix, key),
15790            None => key,
15791        };
15792        req_builder = req_builder.header("Authorization", value);
15793    };
15794    req_builder = req_builder.json(&p_body_integration_request);
15795
15796    let req = req_builder.build()?;
15797    let resp = configuration.client.execute(req).await?;
15798
15799    let status = resp.status();
15800    let content_type = resp
15801        .headers()
15802        .get("content-type")
15803        .and_then(|v| v.to_str().ok())
15804        .unwrap_or("application/octet-stream");
15805    let content_type = super::ContentType::from(content_type);
15806
15807    if !status.is_client_error() && !status.is_server_error() {
15808        let content = resp.text().await?;
15809        match content_type {
15810            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15811            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationResponse`"))),
15812            ContentType::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`")))),
15813        }
15814    } else {
15815        let content = resp.text().await?;
15816        let entity: Option<UpdateIntegrationsWithIdError> = serde_json::from_str(&content).ok();
15817        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15818    }
15819}
15820
15821/// Updates the IP Access Control List with the given Id.
15822pub 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>> {
15823    // add a prefix to parameters to efficiently prevent name collisions
15824    let p_path_access_control_list_id = access_control_list_id;
15825    let p_body_ip_access_control_list_request = ip_access_control_list_request;
15826
15827    let uri_str = format!("{}/api/ip-acl/{accessControlListId}", configuration.base_path, accessControlListId=crate::apis::urlencode(p_path_access_control_list_id));
15828    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15829
15830    if let Some(ref user_agent) = configuration.user_agent {
15831        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15832    }
15833    if let Some(ref apikey) = configuration.api_key {
15834        let key = apikey.key.clone();
15835        let value = match apikey.prefix {
15836            Some(ref prefix) => format!("{} {}", prefix, key),
15837            None => key,
15838        };
15839        req_builder = req_builder.header("Authorization", value);
15840    };
15841    req_builder = req_builder.json(&p_body_ip_access_control_list_request);
15842
15843    let req = req_builder.build()?;
15844    let resp = configuration.client.execute(req).await?;
15845
15846    let status = resp.status();
15847    let content_type = resp
15848        .headers()
15849        .get("content-type")
15850        .and_then(|v| v.to_str().ok())
15851        .unwrap_or("application/octet-stream");
15852    let content_type = super::ContentType::from(content_type);
15853
15854    if !status.is_client_error() && !status.is_server_error() {
15855        let content = resp.text().await?;
15856        match content_type {
15857            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15858            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IpAccessControlListResponse`"))),
15859            ContentType::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`")))),
15860        }
15861    } else {
15862        let content = resp.text().await?;
15863        let entity: Option<UpdateIpAccessControlListWithIdError> = serde_json::from_str(&content).ok();
15864        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15865    }
15866}
15867
15868/// Updates the key with the given Id.
15869pub async fn update_key_with_id(configuration: &configuration::Configuration, key_id: &str, key_request: Option<models::KeyRequest>) -> Result<models::KeyResponse, Error<UpdateKeyWithIdError>> {
15870    // add a prefix to parameters to efficiently prevent name collisions
15871    let p_path_key_id = key_id;
15872    let p_body_key_request = key_request;
15873
15874    let uri_str = format!("{}/api/key/{keyId}", configuration.base_path, keyId=crate::apis::urlencode(p_path_key_id));
15875    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15876
15877    if let Some(ref user_agent) = configuration.user_agent {
15878        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15879    }
15880    if let Some(ref apikey) = configuration.api_key {
15881        let key = apikey.key.clone();
15882        let value = match apikey.prefix {
15883            Some(ref prefix) => format!("{} {}", prefix, key),
15884            None => key,
15885        };
15886        req_builder = req_builder.header("Authorization", value);
15887    };
15888    req_builder = req_builder.json(&p_body_key_request);
15889
15890    let req = req_builder.build()?;
15891    let resp = configuration.client.execute(req).await?;
15892
15893    let status = resp.status();
15894    let content_type = resp
15895        .headers()
15896        .get("content-type")
15897        .and_then(|v| v.to_str().ok())
15898        .unwrap_or("application/octet-stream");
15899    let content_type = super::ContentType::from(content_type);
15900
15901    if !status.is_client_error() && !status.is_server_error() {
15902        let content = resp.text().await?;
15903        match content_type {
15904            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15905            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyResponse`"))),
15906            ContentType::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`")))),
15907        }
15908    } else {
15909        let content = resp.text().await?;
15910        let entity: Option<UpdateKeyWithIdError> = serde_json::from_str(&content).ok();
15911        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15912    }
15913}
15914
15915/// Updates the lambda with the given Id.
15916pub async fn update_lambda_with_id(configuration: &configuration::Configuration, lambda_id: &str, lambda_request: Option<models::LambdaRequest>) -> Result<models::LambdaResponse, Error<UpdateLambdaWithIdError>> {
15917    // add a prefix to parameters to efficiently prevent name collisions
15918    let p_path_lambda_id = lambda_id;
15919    let p_body_lambda_request = lambda_request;
15920
15921    let uri_str = format!("{}/api/lambda/{lambdaId}", configuration.base_path, lambdaId=crate::apis::urlencode(p_path_lambda_id));
15922    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15923
15924    if let Some(ref user_agent) = configuration.user_agent {
15925        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15926    }
15927    if let Some(ref apikey) = configuration.api_key {
15928        let key = apikey.key.clone();
15929        let value = match apikey.prefix {
15930            Some(ref prefix) => format!("{} {}", prefix, key),
15931            None => key,
15932        };
15933        req_builder = req_builder.header("Authorization", value);
15934    };
15935    req_builder = req_builder.json(&p_body_lambda_request);
15936
15937    let req = req_builder.build()?;
15938    let resp = configuration.client.execute(req).await?;
15939
15940    let status = resp.status();
15941    let content_type = resp
15942        .headers()
15943        .get("content-type")
15944        .and_then(|v| v.to_str().ok())
15945        .unwrap_or("application/octet-stream");
15946    let content_type = super::ContentType::from(content_type);
15947
15948    if !status.is_client_error() && !status.is_server_error() {
15949        let content = resp.text().await?;
15950        match content_type {
15951            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15952            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LambdaResponse`"))),
15953            ContentType::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`")))),
15954        }
15955    } else {
15956        let content = resp.text().await?;
15957        let entity: Option<UpdateLambdaWithIdError> = serde_json::from_str(&content).ok();
15958        Err(Error::ResponseError(ResponseContent { status, content, entity }))
15959    }
15960}
15961
15962/// Updates the message template with the given Id.
15963pub 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>> {
15964    // add a prefix to parameters to efficiently prevent name collisions
15965    let p_path_message_template_id = message_template_id;
15966    let p_body_message_template_request = message_template_request;
15967
15968    let uri_str = format!("{}/api/message/template/{messageTemplateId}", configuration.base_path, messageTemplateId=crate::apis::urlencode(p_path_message_template_id));
15969    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
15970
15971    if let Some(ref user_agent) = configuration.user_agent {
15972        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
15973    }
15974    if let Some(ref apikey) = configuration.api_key {
15975        let key = apikey.key.clone();
15976        let value = match apikey.prefix {
15977            Some(ref prefix) => format!("{} {}", prefix, key),
15978            None => key,
15979        };
15980        req_builder = req_builder.header("Authorization", value);
15981    };
15982    req_builder = req_builder.json(&p_body_message_template_request);
15983
15984    let req = req_builder.build()?;
15985    let resp = configuration.client.execute(req).await?;
15986
15987    let status = resp.status();
15988    let content_type = resp
15989        .headers()
15990        .get("content-type")
15991        .and_then(|v| v.to_str().ok())
15992        .unwrap_or("application/octet-stream");
15993    let content_type = super::ContentType::from(content_type);
15994
15995    if !status.is_client_error() && !status.is_server_error() {
15996        let content = resp.text().await?;
15997        match content_type {
15998            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
15999            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessageTemplateResponse`"))),
16000            ContentType::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`")))),
16001        }
16002    } else {
16003        let content = resp.text().await?;
16004        let entity: Option<UpdateMessageTemplateWithIdError> = serde_json::from_str(&content).ok();
16005        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16006    }
16007}
16008
16009/// Updates the messenger with the given Id.
16010pub async fn update_messenger_with_id(configuration: &configuration::Configuration, messenger_id: &str, messenger_request: Option<models::MessengerRequest>) -> Result<models::MessengerResponse, Error<UpdateMessengerWithIdError>> {
16011    // add a prefix to parameters to efficiently prevent name collisions
16012    let p_path_messenger_id = messenger_id;
16013    let p_body_messenger_request = messenger_request;
16014
16015    let uri_str = format!("{}/api/messenger/{messengerId}", configuration.base_path, messengerId=crate::apis::urlencode(p_path_messenger_id));
16016    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16017
16018    if let Some(ref user_agent) = configuration.user_agent {
16019        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16020    }
16021    if let Some(ref apikey) = configuration.api_key {
16022        let key = apikey.key.clone();
16023        let value = match apikey.prefix {
16024            Some(ref prefix) => format!("{} {}", prefix, key),
16025            None => key,
16026        };
16027        req_builder = req_builder.header("Authorization", value);
16028    };
16029    req_builder = req_builder.json(&p_body_messenger_request);
16030
16031    let req = req_builder.build()?;
16032    let resp = configuration.client.execute(req).await?;
16033
16034    let status = resp.status();
16035    let content_type = resp
16036        .headers()
16037        .get("content-type")
16038        .and_then(|v| v.to_str().ok())
16039        .unwrap_or("application/octet-stream");
16040    let content_type = super::ContentType::from(content_type);
16041
16042    if !status.is_client_error() && !status.is_server_error() {
16043        let content = resp.text().await?;
16044        match content_type {
16045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16046            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MessengerResponse`"))),
16047            ContentType::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`")))),
16048        }
16049    } else {
16050        let content = resp.text().await?;
16051        let entity: Option<UpdateMessengerWithIdError> = serde_json::from_str(&content).ok();
16052        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16053    }
16054}
16055
16056/// Updates the OAuth scope with the given Id for the application.
16057pub 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>> {
16058    // add a prefix to parameters to efficiently prevent name collisions
16059    let p_path_application_id = application_id;
16060    let p_path_scope_id = scope_id;
16061    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16062    let p_body_application_o_auth_scope_request = application_o_auth_scope_request;
16063
16064    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));
16065    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16066
16067    if let Some(ref user_agent) = configuration.user_agent {
16068        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16069    }
16070    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16071        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16072    }
16073    if let Some(ref apikey) = configuration.api_key {
16074        let key = apikey.key.clone();
16075        let value = match apikey.prefix {
16076            Some(ref prefix) => format!("{} {}", prefix, key),
16077            None => key,
16078        };
16079        req_builder = req_builder.header("Authorization", value);
16080    };
16081    req_builder = req_builder.json(&p_body_application_o_auth_scope_request);
16082
16083    let req = req_builder.build()?;
16084    let resp = configuration.client.execute(req).await?;
16085
16086    let status = resp.status();
16087    let content_type = resp
16088        .headers()
16089        .get("content-type")
16090        .and_then(|v| v.to_str().ok())
16091        .unwrap_or("application/octet-stream");
16092    let content_type = super::ContentType::from(content_type);
16093
16094    if !status.is_client_error() && !status.is_server_error() {
16095        let content = resp.text().await?;
16096        match content_type {
16097            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16098            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApplicationOAuthScopeResponse`"))),
16099            ContentType::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`")))),
16100        }
16101    } else {
16102        let content = resp.text().await?;
16103        let entity: Option<UpdateOAuthScopeWithIdError> = serde_json::from_str(&content).ok();
16104        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16105    }
16106}
16107
16108/// Updates the registration for the user with the given Id and the application defined in the request.
16109pub 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>> {
16110    // add a prefix to parameters to efficiently prevent name collisions
16111    let p_path_user_id = user_id;
16112    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16113    let p_body_registration_request = registration_request;
16114
16115    let uri_str = format!("{}/api/user/registration/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
16116    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16117
16118    if let Some(ref user_agent) = configuration.user_agent {
16119        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16120    }
16121    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16122        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16123    }
16124    if let Some(ref apikey) = configuration.api_key {
16125        let key = apikey.key.clone();
16126        let value = match apikey.prefix {
16127            Some(ref prefix) => format!("{} {}", prefix, key),
16128            None => key,
16129        };
16130        req_builder = req_builder.header("Authorization", value);
16131    };
16132    req_builder = req_builder.json(&p_body_registration_request);
16133
16134    let req = req_builder.build()?;
16135    let resp = configuration.client.execute(req).await?;
16136
16137    let status = resp.status();
16138    let content_type = resp
16139        .headers()
16140        .get("content-type")
16141        .and_then(|v| v.to_str().ok())
16142        .unwrap_or("application/octet-stream");
16143    let content_type = super::ContentType::from(content_type);
16144
16145    if !status.is_client_error() && !status.is_server_error() {
16146        let content = resp.text().await?;
16147        match content_type {
16148            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16149            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationResponse`"))),
16150            ContentType::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`")))),
16151        }
16152    } else {
16153        let content = resp.text().await?;
16154        let entity: Option<UpdateRegistrationWithIdError> = serde_json::from_str(&content).ok();
16155        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16156    }
16157}
16158
16159/// Updates the system configuration.
16160pub async fn update_system_configuration_with_id(configuration: &configuration::Configuration, system_configuration_request: Option<models::SystemConfigurationRequest>) -> Result<models::SystemConfigurationResponse, Error<UpdateSystemConfigurationWithIdError>> {
16161    // add a prefix to parameters to efficiently prevent name collisions
16162    let p_body_system_configuration_request = system_configuration_request;
16163
16164    let uri_str = format!("{}/api/system-configuration", configuration.base_path);
16165    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16166
16167    if let Some(ref user_agent) = configuration.user_agent {
16168        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16169    }
16170    if let Some(ref apikey) = configuration.api_key {
16171        let key = apikey.key.clone();
16172        let value = match apikey.prefix {
16173            Some(ref prefix) => format!("{} {}", prefix, key),
16174            None => key,
16175        };
16176        req_builder = req_builder.header("Authorization", value);
16177    };
16178    req_builder = req_builder.json(&p_body_system_configuration_request);
16179
16180    let req = req_builder.build()?;
16181    let resp = configuration.client.execute(req).await?;
16182
16183    let status = resp.status();
16184    let content_type = resp
16185        .headers()
16186        .get("content-type")
16187        .and_then(|v| v.to_str().ok())
16188        .unwrap_or("application/octet-stream");
16189    let content_type = super::ContentType::from(content_type);
16190
16191    if !status.is_client_error() && !status.is_server_error() {
16192        let content = resp.text().await?;
16193        match content_type {
16194            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16195            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SystemConfigurationResponse`"))),
16196            ContentType::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`")))),
16197        }
16198    } else {
16199        let content = resp.text().await?;
16200        let entity: Option<UpdateSystemConfigurationWithIdError> = serde_json::from_str(&content).ok();
16201        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16202    }
16203}
16204
16205/// Updates the tenant with the given Id.
16206pub 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>> {
16207    // add a prefix to parameters to efficiently prevent name collisions
16208    let p_path_tenant_id = tenant_id;
16209    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16210    let p_body_tenant_request = tenant_request;
16211
16212    let uri_str = format!("{}/api/tenant/{tenantId}", configuration.base_path, tenantId=crate::apis::urlencode(p_path_tenant_id));
16213    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16214
16215    if let Some(ref user_agent) = configuration.user_agent {
16216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16217    }
16218    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16219        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16220    }
16221    if let Some(ref apikey) = configuration.api_key {
16222        let key = apikey.key.clone();
16223        let value = match apikey.prefix {
16224            Some(ref prefix) => format!("{} {}", prefix, key),
16225            None => key,
16226        };
16227        req_builder = req_builder.header("Authorization", value);
16228    };
16229    req_builder = req_builder.json(&p_body_tenant_request);
16230
16231    let req = req_builder.build()?;
16232    let resp = configuration.client.execute(req).await?;
16233
16234    let status = resp.status();
16235    let content_type = resp
16236        .headers()
16237        .get("content-type")
16238        .and_then(|v| v.to_str().ok())
16239        .unwrap_or("application/octet-stream");
16240    let content_type = super::ContentType::from(content_type);
16241
16242    if !status.is_client_error() && !status.is_server_error() {
16243        let content = resp.text().await?;
16244        match content_type {
16245            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16246            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TenantResponse`"))),
16247            ContentType::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`")))),
16248        }
16249    } else {
16250        let content = resp.text().await?;
16251        let entity: Option<UpdateTenantWithIdError> = serde_json::from_str(&content).ok();
16252        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16253    }
16254}
16255
16256/// Updates the theme with the given Id.
16257pub async fn update_theme_with_id(configuration: &configuration::Configuration, theme_id: &str, theme_request: Option<models::ThemeRequest>) -> Result<models::ThemeResponse, Error<UpdateThemeWithIdError>> {
16258    // add a prefix to parameters to efficiently prevent name collisions
16259    let p_path_theme_id = theme_id;
16260    let p_body_theme_request = theme_request;
16261
16262    let uri_str = format!("{}/api/theme/{themeId}", configuration.base_path, themeId=crate::apis::urlencode(p_path_theme_id));
16263    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16264
16265    if let Some(ref user_agent) = configuration.user_agent {
16266        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16267    }
16268    if let Some(ref apikey) = configuration.api_key {
16269        let key = apikey.key.clone();
16270        let value = match apikey.prefix {
16271            Some(ref prefix) => format!("{} {}", prefix, key),
16272            None => key,
16273        };
16274        req_builder = req_builder.header("Authorization", value);
16275    };
16276    req_builder = req_builder.json(&p_body_theme_request);
16277
16278    let req = req_builder.build()?;
16279    let resp = configuration.client.execute(req).await?;
16280
16281    let status = resp.status();
16282    let content_type = resp
16283        .headers()
16284        .get("content-type")
16285        .and_then(|v| v.to_str().ok())
16286        .unwrap_or("application/octet-stream");
16287    let content_type = super::ContentType::from(content_type);
16288
16289    if !status.is_client_error() && !status.is_server_error() {
16290        let content = resp.text().await?;
16291        match content_type {
16292            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16293            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ThemeResponse`"))),
16294            ContentType::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`")))),
16295        }
16296    } else {
16297        let content = resp.text().await?;
16298        let entity: Option<UpdateThemeWithIdError> = serde_json::from_str(&content).ok();
16299        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16300    }
16301}
16302
16303/// Updates the user action reason with the given Id.
16304pub 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>> {
16305    // add a prefix to parameters to efficiently prevent name collisions
16306    let p_path_user_action_reason_id = user_action_reason_id;
16307    let p_body_user_action_reason_request = user_action_reason_request;
16308
16309    let uri_str = format!("{}/api/user-action-reason/{userActionReasonId}", configuration.base_path, userActionReasonId=crate::apis::urlencode(p_path_user_action_reason_id));
16310    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16311
16312    if let Some(ref user_agent) = configuration.user_agent {
16313        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16314    }
16315    if let Some(ref apikey) = configuration.api_key {
16316        let key = apikey.key.clone();
16317        let value = match apikey.prefix {
16318            Some(ref prefix) => format!("{} {}", prefix, key),
16319            None => key,
16320        };
16321        req_builder = req_builder.header("Authorization", value);
16322    };
16323    req_builder = req_builder.json(&p_body_user_action_reason_request);
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::UserActionReasonResponse`"))),
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::UserActionReasonResponse`")))),
16342        }
16343    } else {
16344        let content = resp.text().await?;
16345        let entity: Option<UpdateUserActionReasonWithIdError> = serde_json::from_str(&content).ok();
16346        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16347    }
16348}
16349
16350/// Updates the user action with the given Id. OR Reactivates the user action with the given Id.
16351pub 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>> {
16352    // add a prefix to parameters to efficiently prevent name collisions
16353    let p_path_user_action_id = user_action_id;
16354    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16355    let p_query_reactivate = reactivate;
16356    let p_body_user_action_request = user_action_request;
16357
16358    let uri_str = format!("{}/api/user-action/{userActionId}", configuration.base_path, userActionId=crate::apis::urlencode(p_path_user_action_id));
16359    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16360
16361    if let Some(ref param_value) = p_query_reactivate {
16362        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
16363    }
16364    if let Some(ref user_agent) = configuration.user_agent {
16365        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16366    }
16367    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16368        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16369    }
16370    if let Some(ref apikey) = configuration.api_key {
16371        let key = apikey.key.clone();
16372        let value = match apikey.prefix {
16373            Some(ref prefix) => format!("{} {}", prefix, key),
16374            None => key,
16375        };
16376        req_builder = req_builder.header("Authorization", value);
16377    };
16378    req_builder = req_builder.json(&p_body_user_action_request);
16379
16380    let req = req_builder.build()?;
16381    let resp = configuration.client.execute(req).await?;
16382
16383    let status = resp.status();
16384    let content_type = resp
16385        .headers()
16386        .get("content-type")
16387        .and_then(|v| v.to_str().ok())
16388        .unwrap_or("application/octet-stream");
16389    let content_type = super::ContentType::from(content_type);
16390
16391    if !status.is_client_error() && !status.is_server_error() {
16392        let content = resp.text().await?;
16393        match content_type {
16394            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16395            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserActionResponse`"))),
16396            ContentType::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`")))),
16397        }
16398    } else {
16399        let content = resp.text().await?;
16400        let entity: Option<UpdateUserActionWithIdError> = serde_json::from_str(&content).ok();
16401        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16402    }
16403}
16404
16405/// Updates a single User consent by Id.
16406pub 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>> {
16407    // add a prefix to parameters to efficiently prevent name collisions
16408    let p_path_user_consent_id = user_consent_id;
16409    let p_body_user_consent_request = user_consent_request;
16410
16411    let uri_str = format!("{}/api/user/consent/{userConsentId}", configuration.base_path, userConsentId=crate::apis::urlencode(p_path_user_consent_id));
16412    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16413
16414    if let Some(ref user_agent) = configuration.user_agent {
16415        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16416    }
16417    if let Some(ref apikey) = configuration.api_key {
16418        let key = apikey.key.clone();
16419        let value = match apikey.prefix {
16420            Some(ref prefix) => format!("{} {}", prefix, key),
16421            None => key,
16422        };
16423        req_builder = req_builder.header("Authorization", value);
16424    };
16425    req_builder = req_builder.json(&p_body_user_consent_request);
16426
16427    let req = req_builder.build()?;
16428    let resp = configuration.client.execute(req).await?;
16429
16430    let status = resp.status();
16431    let content_type = resp
16432        .headers()
16433        .get("content-type")
16434        .and_then(|v| v.to_str().ok())
16435        .unwrap_or("application/octet-stream");
16436    let content_type = super::ContentType::from(content_type);
16437
16438    if !status.is_client_error() && !status.is_server_error() {
16439        let content = resp.text().await?;
16440        match content_type {
16441            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16442            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserConsentResponse`"))),
16443            ContentType::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`")))),
16444        }
16445    } else {
16446        let content = resp.text().await?;
16447        let entity: Option<UpdateUserConsentWithIdError> = serde_json::from_str(&content).ok();
16448        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16449    }
16450}
16451
16452/// Updates a family with a given Id. OR Adds a user to an existing family. The family Id must be specified.
16453pub 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>> {
16454    // add a prefix to parameters to efficiently prevent name collisions
16455    let p_path_family_id = family_id;
16456    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16457    let p_body_family_request = family_request;
16458
16459    let uri_str = format!("{}/api/user/family/{familyId}", configuration.base_path, familyId=crate::apis::urlencode(p_path_family_id));
16460    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16461
16462    if let Some(ref user_agent) = configuration.user_agent {
16463        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16464    }
16465    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16466        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16467    }
16468    if let Some(ref apikey) = configuration.api_key {
16469        let key = apikey.key.clone();
16470        let value = match apikey.prefix {
16471            Some(ref prefix) => format!("{} {}", prefix, key),
16472            None => key,
16473        };
16474        req_builder = req_builder.header("Authorization", value);
16475    };
16476    req_builder = req_builder.json(&p_body_family_request);
16477
16478    let req = req_builder.build()?;
16479    let resp = configuration.client.execute(req).await?;
16480
16481    let status = resp.status();
16482    let content_type = resp
16483        .headers()
16484        .get("content-type")
16485        .and_then(|v| v.to_str().ok())
16486        .unwrap_or("application/octet-stream");
16487    let content_type = super::ContentType::from(content_type);
16488
16489    if !status.is_client_error() && !status.is_server_error() {
16490        let content = resp.text().await?;
16491        match content_type {
16492            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16493            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FamilyResponse`"))),
16494            ContentType::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`")))),
16495        }
16496    } else {
16497        let content = resp.text().await?;
16498        let entity: Option<UpdateUserFamilyWithIdError> = serde_json::from_str(&content).ok();
16499        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16500    }
16501}
16502
16503/// 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.
16504pub 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>> {
16505    // add a prefix to parameters to efficiently prevent name collisions
16506    let p_query_application_id = application_id;
16507    let p_query_email = email;
16508    let p_query_send_verify_email = send_verify_email;
16509
16510    let uri_str = format!("{}/api/user/verify-email", configuration.base_path);
16511    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16512
16513    if let Some(ref param_value) = p_query_application_id {
16514        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
16515    }
16516    if let Some(ref param_value) = p_query_email {
16517        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
16518    }
16519    if let Some(ref param_value) = p_query_send_verify_email {
16520        req_builder = req_builder.query(&[("sendVerifyEmail", &param_value.to_string())]);
16521    }
16522    if let Some(ref user_agent) = configuration.user_agent {
16523        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16524    }
16525    if let Some(ref apikey) = configuration.api_key {
16526        let key = apikey.key.clone();
16527        let value = match apikey.prefix {
16528            Some(ref prefix) => format!("{} {}", prefix, key),
16529            None => key,
16530        };
16531        req_builder = req_builder.header("Authorization", value);
16532    };
16533
16534    let req = req_builder.build()?;
16535    let resp = configuration.client.execute(req).await?;
16536
16537    let status = resp.status();
16538    let content_type = resp
16539        .headers()
16540        .get("content-type")
16541        .and_then(|v| v.to_str().ok())
16542        .unwrap_or("application/octet-stream");
16543    let content_type = super::ContentType::from(content_type);
16544
16545    if !status.is_client_error() && !status.is_server_error() {
16546        let content = resp.text().await?;
16547        match content_type {
16548            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16549            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyEmailResponse`"))),
16550            ContentType::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`")))),
16551        }
16552    } else {
16553        let content = resp.text().await?;
16554        let entity: Option<UpdateUserVerifyEmailError> = serde_json::from_str(&content).ok();
16555        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16556    }
16557}
16558
16559/// 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.
16560pub 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>> {
16561    // add a prefix to parameters to efficiently prevent name collisions
16562    let p_query_email = email;
16563    let p_query_application_id = application_id;
16564    let p_query_send_verify_password_email = send_verify_password_email;
16565
16566    let uri_str = format!("{}/api/user/verify-registration", configuration.base_path);
16567    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16568
16569    if let Some(ref param_value) = p_query_email {
16570        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
16571    }
16572    if let Some(ref param_value) = p_query_application_id {
16573        req_builder = req_builder.query(&[("applicationId", &param_value.to_string())]);
16574    }
16575    if let Some(ref param_value) = p_query_send_verify_password_email {
16576        req_builder = req_builder.query(&[("sendVerifyPasswordEmail", &param_value.to_string())]);
16577    }
16578    if let Some(ref user_agent) = configuration.user_agent {
16579        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16580    }
16581    if let Some(ref apikey) = configuration.api_key {
16582        let key = apikey.key.clone();
16583        let value = match apikey.prefix {
16584            Some(ref prefix) => format!("{} {}", prefix, key),
16585            None => key,
16586        };
16587        req_builder = req_builder.header("Authorization", value);
16588    };
16589
16590    let req = req_builder.build()?;
16591    let resp = configuration.client.execute(req).await?;
16592
16593    let status = resp.status();
16594    let content_type = resp
16595        .headers()
16596        .get("content-type")
16597        .and_then(|v| v.to_str().ok())
16598        .unwrap_or("application/octet-stream");
16599    let content_type = super::ContentType::from(content_type);
16600
16601    if !status.is_client_error() && !status.is_server_error() {
16602        let content = resp.text().await?;
16603        match content_type {
16604            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16605            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VerifyRegistrationResponse`"))),
16606            ContentType::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`")))),
16607        }
16608    } else {
16609        let content = resp.text().await?;
16610        let entity: Option<UpdateUserVerifyRegistrationError> = serde_json::from_str(&content).ok();
16611        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16612    }
16613}
16614
16615/// Updates the user with the given Id. OR Reactivates the user with the given Id.
16616pub 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>> {
16617    // add a prefix to parameters to efficiently prevent name collisions
16618    let p_path_user_id = user_id;
16619    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16620    let p_query_reactivate = reactivate;
16621    let p_body_user_request = user_request;
16622
16623    let uri_str = format!("{}/api/user/{userId}", configuration.base_path, userId=crate::apis::urlencode(p_path_user_id));
16624    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16625
16626    if let Some(ref param_value) = p_query_reactivate {
16627        req_builder = req_builder.query(&[("reactivate", &param_value.to_string())]);
16628    }
16629    if let Some(ref user_agent) = configuration.user_agent {
16630        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16631    }
16632    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16633        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16634    }
16635    if let Some(ref apikey) = configuration.api_key {
16636        let key = apikey.key.clone();
16637        let value = match apikey.prefix {
16638            Some(ref prefix) => format!("{} {}", prefix, key),
16639            None => key,
16640        };
16641        req_builder = req_builder.header("Authorization", value);
16642    };
16643    req_builder = req_builder.json(&p_body_user_request);
16644
16645    let req = req_builder.build()?;
16646    let resp = configuration.client.execute(req).await?;
16647
16648    let status = resp.status();
16649    let content_type = resp
16650        .headers()
16651        .get("content-type")
16652        .and_then(|v| v.to_str().ok())
16653        .unwrap_or("application/octet-stream");
16654    let content_type = super::ContentType::from(content_type);
16655
16656    if !status.is_client_error() && !status.is_server_error() {
16657        let content = resp.text().await?;
16658        match content_type {
16659            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16660            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserResponse`"))),
16661            ContentType::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`")))),
16662        }
16663    } else {
16664        let content = resp.text().await?;
16665        let entity: Option<UpdateUserWithIdError> = serde_json::from_str(&content).ok();
16666        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16667    }
16668}
16669
16670/// Updates the webhook with the given Id.
16671pub async fn update_webhook_with_id(configuration: &configuration::Configuration, webhook_id: &str, webhook_request: Option<models::WebhookRequest>) -> Result<models::WebhookResponse, Error<UpdateWebhookWithIdError>> {
16672    // add a prefix to parameters to efficiently prevent name collisions
16673    let p_path_webhook_id = webhook_id;
16674    let p_body_webhook_request = webhook_request;
16675
16676    let uri_str = format!("{}/api/webhook/{webhookId}", configuration.base_path, webhookId=crate::apis::urlencode(p_path_webhook_id));
16677    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
16678
16679    if let Some(ref user_agent) = configuration.user_agent {
16680        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16681    }
16682    if let Some(ref apikey) = configuration.api_key {
16683        let key = apikey.key.clone();
16684        let value = match apikey.prefix {
16685            Some(ref prefix) => format!("{} {}", prefix, key),
16686            None => key,
16687        };
16688        req_builder = req_builder.header("Authorization", value);
16689    };
16690    req_builder = req_builder.json(&p_body_webhook_request);
16691
16692    let req = req_builder.build()?;
16693    let resp = configuration.client.execute(req).await?;
16694
16695    let status = resp.status();
16696    let content_type = resp
16697        .headers()
16698        .get("content-type")
16699        .and_then(|v| v.to_str().ok())
16700        .unwrap_or("application/octet-stream");
16701    let content_type = super::ContentType::from(content_type);
16702
16703    if !status.is_client_error() && !status.is_server_error() {
16704        let content = resp.text().await?;
16705        match content_type {
16706            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16707            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebhookResponse`"))),
16708            ContentType::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`")))),
16709        }
16710    } else {
16711        let content = resp.text().await?;
16712        let entity: Option<UpdateWebhookWithIdError> = serde_json::from_str(&content).ok();
16713        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16714    }
16715}
16716
16717/// Creates or updates an Entity Grant. This is when a User/Entity is granted permissions to an Entity.
16718pub 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>> {
16719    // add a prefix to parameters to efficiently prevent name collisions
16720    let p_path_entity_id = entity_id;
16721    let p_header_x_fusion_auth_tenant_id = x_fusion_auth_tenant_id;
16722    let p_body_entity_grant_request = entity_grant_request;
16723
16724    let uri_str = format!("{}/api/entity/{entityId}/grant", configuration.base_path, entityId=crate::apis::urlencode(p_path_entity_id));
16725    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16726
16727    if let Some(ref user_agent) = configuration.user_agent {
16728        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16729    }
16730    if let Some(param_value) = p_header_x_fusion_auth_tenant_id {
16731        req_builder = req_builder.header("X-FusionAuth-TenantId", param_value.to_string());
16732    }
16733    if let Some(ref apikey) = configuration.api_key {
16734        let key = apikey.key.clone();
16735        let value = match apikey.prefix {
16736            Some(ref prefix) => format!("{} {}", prefix, key),
16737            None => key,
16738        };
16739        req_builder = req_builder.header("Authorization", value);
16740    };
16741    req_builder = req_builder.json(&p_body_entity_grant_request);
16742
16743    let req = req_builder.build()?;
16744    let resp = configuration.client.execute(req).await?;
16745
16746    let status = resp.status();
16747
16748    if !status.is_client_error() && !status.is_server_error() {
16749        Ok(())
16750    } else {
16751        let content = resp.text().await?;
16752        let entity: Option<UpsertEntityGrantWithIdError> = serde_json::from_str(&content).ok();
16753        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16754    }
16755}
16756
16757/// 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.
16758pub async fn validate_jwt_with_id(configuration: &configuration::Configuration, ) -> Result<models::ValidateResponse, Error<ValidateJwtWithIdError>> {
16759
16760    let uri_str = format!("{}/api/jwt/validate", configuration.base_path);
16761    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
16762
16763    if let Some(ref user_agent) = configuration.user_agent {
16764        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16765    }
16766    if let Some(ref token) = configuration.bearer_access_token {
16767        req_builder = req_builder.bearer_auth(token.to_owned());
16768    };
16769
16770    let req = req_builder.build()?;
16771    let resp = configuration.client.execute(req).await?;
16772
16773    let status = resp.status();
16774    let content_type = resp
16775        .headers()
16776        .get("content-type")
16777        .and_then(|v| v.to_str().ok())
16778        .unwrap_or("application/octet-stream");
16779    let content_type = super::ContentType::from(content_type);
16780
16781    if !status.is_client_error() && !status.is_server_error() {
16782        let content = resp.text().await?;
16783        match content_type {
16784            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16785            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ValidateResponse`"))),
16786            ContentType::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`")))),
16787        }
16788    } else {
16789        let content = resp.text().await?;
16790        let entity: Option<ValidateJwtWithIdError> = serde_json::from_str(&content).ok();
16791        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16792    }
16793}
16794
16795/// 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.
16796pub async fn vend_jwt_with_id(configuration: &configuration::Configuration, jwt_vend_request: Option<models::JwtVendRequest>) -> Result<models::JwtVendResponse, Error<VendJwtWithIdError>> {
16797    // add a prefix to parameters to efficiently prevent name collisions
16798    let p_body_jwt_vend_request = jwt_vend_request;
16799
16800    let uri_str = format!("{}/api/jwt/vend", configuration.base_path);
16801    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16802
16803    if let Some(ref user_agent) = configuration.user_agent {
16804        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16805    }
16806    if let Some(ref apikey) = configuration.api_key {
16807        let key = apikey.key.clone();
16808        let value = match apikey.prefix {
16809            Some(ref prefix) => format!("{} {}", prefix, key),
16810            None => key,
16811        };
16812        req_builder = req_builder.header("Authorization", value);
16813    };
16814    req_builder = req_builder.json(&p_body_jwt_vend_request);
16815
16816    let req = req_builder.build()?;
16817    let resp = configuration.client.execute(req).await?;
16818
16819    let status = resp.status();
16820    let content_type = resp
16821        .headers()
16822        .get("content-type")
16823        .and_then(|v| v.to_str().ok())
16824        .unwrap_or("application/octet-stream");
16825    let content_type = super::ContentType::from(content_type);
16826
16827    if !status.is_client_error() && !status.is_server_error() {
16828        let content = resp.text().await?;
16829        match content_type {
16830            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
16831            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JwtVendResponse`"))),
16832            ContentType::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`")))),
16833        }
16834    } else {
16835        let content = resp.text().await?;
16836        let entity: Option<VendJwtWithIdError> = serde_json::from_str(&content).ok();
16837        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16838    }
16839}
16840
16841/// Administratively verify a user identity.
16842pub async fn verify_identity_with_id(configuration: &configuration::Configuration, verify_request: Option<models::VerifyRequest>) -> Result<(), Error<VerifyIdentityWithIdError>> {
16843    // add a prefix to parameters to efficiently prevent name collisions
16844    let p_body_verify_request = verify_request;
16845
16846    let uri_str = format!("{}/api/identity/verify", configuration.base_path);
16847    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16848
16849    if let Some(ref user_agent) = configuration.user_agent {
16850        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16851    }
16852    if let Some(ref apikey) = configuration.api_key {
16853        let key = apikey.key.clone();
16854        let value = match apikey.prefix {
16855            Some(ref prefix) => format!("{} {}", prefix, key),
16856            None => key,
16857        };
16858        req_builder = req_builder.header("Authorization", value);
16859    };
16860    req_builder = req_builder.json(&p_body_verify_request);
16861
16862    let req = req_builder.build()?;
16863    let resp = configuration.client.execute(req).await?;
16864
16865    let status = resp.status();
16866
16867    if !status.is_client_error() && !status.is_server_error() {
16868        Ok(())
16869    } else {
16870        let content = resp.text().await?;
16871        let entity: Option<VerifyIdentityWithIdError> = serde_json::from_str(&content).ok();
16872        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16873    }
16874}
16875
16876/// 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.
16877pub async fn verify_user_registration_with_id(configuration: &configuration::Configuration, verify_registration_request: Option<models::VerifyRegistrationRequest>) -> Result<(), Error<VerifyUserRegistrationWithIdError>> {
16878    // add a prefix to parameters to efficiently prevent name collisions
16879    let p_body_verify_registration_request = verify_registration_request;
16880
16881    let uri_str = format!("{}/api/user/verify-registration", configuration.base_path);
16882    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
16883
16884    if let Some(ref user_agent) = configuration.user_agent {
16885        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
16886    }
16887    if let Some(ref apikey) = configuration.api_key {
16888        let key = apikey.key.clone();
16889        let value = match apikey.prefix {
16890            Some(ref prefix) => format!("{} {}", prefix, key),
16891            None => key,
16892        };
16893        req_builder = req_builder.header("Authorization", value);
16894    };
16895    req_builder = req_builder.json(&p_body_verify_registration_request);
16896
16897    let req = req_builder.build()?;
16898    let resp = configuration.client.execute(req).await?;
16899
16900    let status = resp.status();
16901
16902    if !status.is_client_error() && !status.is_server_error() {
16903        Ok(())
16904    } else {
16905        let content = resp.text().await?;
16906        let entity: Option<VerifyUserRegistrationWithIdError> = serde_json::from_str(&content).ok();
16907        Err(Error::ResponseError(ResponseContent { status, content, entity }))
16908    }
16909}
16910