Skip to main content

authentik_client/apis/
providers_api.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.10.4
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16/// struct for typed errors of method [`providers_all_destroy`]
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum ProvidersAllDestroyError {
20    Status400(models::ValidationError),
21    Status403(models::GenericError),
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`providers_all_list`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ProvidersAllListError {
29    Status400(models::ValidationError),
30    Status403(models::GenericError),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`providers_all_retrieve`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum ProvidersAllRetrieveError {
38    Status400(models::ValidationError),
39    Status403(models::GenericError),
40    UnknownValue(serde_json::Value),
41}
42
43/// struct for typed errors of method [`providers_all_types_list`]
44#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(untagged)]
46pub enum ProvidersAllTypesListError {
47    Status400(models::ValidationError),
48    Status403(models::GenericError),
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`providers_all_used_by_list`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum ProvidersAllUsedByListError {
56    Status400(models::ValidationError),
57    Status403(models::GenericError),
58    UnknownValue(serde_json::Value),
59}
60
61/// struct for typed errors of method [`providers_google_workspace_create`]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum ProvidersGoogleWorkspaceCreateError {
65    Status400(models::ValidationError),
66    Status403(models::GenericError),
67    UnknownValue(serde_json::Value),
68}
69
70/// struct for typed errors of method [`providers_google_workspace_destroy`]
71#[derive(Debug, Clone, Serialize, Deserialize)]
72#[serde(untagged)]
73pub enum ProvidersGoogleWorkspaceDestroyError {
74    Status400(models::ValidationError),
75    Status403(models::GenericError),
76    UnknownValue(serde_json::Value),
77}
78
79/// struct for typed errors of method [`providers_google_workspace_groups_create`]
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum ProvidersGoogleWorkspaceGroupsCreateError {
83    Status400(models::ValidationError),
84    Status403(models::GenericError),
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`providers_google_workspace_groups_destroy`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ProvidersGoogleWorkspaceGroupsDestroyError {
92    Status400(models::ValidationError),
93    Status403(models::GenericError),
94    UnknownValue(serde_json::Value),
95}
96
97/// struct for typed errors of method [`providers_google_workspace_groups_list`]
98#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum ProvidersGoogleWorkspaceGroupsListError {
101    Status400(models::ValidationError),
102    Status403(models::GenericError),
103    UnknownValue(serde_json::Value),
104}
105
106/// struct for typed errors of method [`providers_google_workspace_groups_retrieve`]
107#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum ProvidersGoogleWorkspaceGroupsRetrieveError {
110    Status400(models::ValidationError),
111    Status403(models::GenericError),
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`providers_google_workspace_groups_used_by_list`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum ProvidersGoogleWorkspaceGroupsUsedByListError {
119    Status400(models::ValidationError),
120    Status403(models::GenericError),
121    UnknownValue(serde_json::Value),
122}
123
124/// struct for typed errors of method [`providers_google_workspace_list`]
125#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum ProvidersGoogleWorkspaceListError {
128    Status400(models::ValidationError),
129    Status403(models::GenericError),
130    UnknownValue(serde_json::Value),
131}
132
133/// struct for typed errors of method [`providers_google_workspace_partial_update`]
134#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum ProvidersGoogleWorkspacePartialUpdateError {
137    Status400(models::ValidationError),
138    Status403(models::GenericError),
139    UnknownValue(serde_json::Value),
140}
141
142/// struct for typed errors of method [`providers_google_workspace_retrieve`]
143#[derive(Debug, Clone, Serialize, Deserialize)]
144#[serde(untagged)]
145pub enum ProvidersGoogleWorkspaceRetrieveError {
146    Status400(models::ValidationError),
147    Status403(models::GenericError),
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`providers_google_workspace_sync_object_create`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum ProvidersGoogleWorkspaceSyncObjectCreateError {
155    Status400(models::ValidationError),
156    Status403(models::GenericError),
157    UnknownValue(serde_json::Value),
158}
159
160/// struct for typed errors of method [`providers_google_workspace_sync_status_retrieve`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum ProvidersGoogleWorkspaceSyncStatusRetrieveError {
164    Status400(models::ValidationError),
165    Status403(models::GenericError),
166    UnknownValue(serde_json::Value),
167}
168
169/// struct for typed errors of method [`providers_google_workspace_update`]
170#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(untagged)]
172pub enum ProvidersGoogleWorkspaceUpdateError {
173    Status400(models::ValidationError),
174    Status403(models::GenericError),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`providers_google_workspace_used_by_list`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum ProvidersGoogleWorkspaceUsedByListError {
182    Status400(models::ValidationError),
183    Status403(models::GenericError),
184    UnknownValue(serde_json::Value),
185}
186
187/// struct for typed errors of method [`providers_google_workspace_users_create`]
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum ProvidersGoogleWorkspaceUsersCreateError {
191    Status400(models::ValidationError),
192    Status403(models::GenericError),
193    UnknownValue(serde_json::Value),
194}
195
196/// struct for typed errors of method [`providers_google_workspace_users_destroy`]
197#[derive(Debug, Clone, Serialize, Deserialize)]
198#[serde(untagged)]
199pub enum ProvidersGoogleWorkspaceUsersDestroyError {
200    Status400(models::ValidationError),
201    Status403(models::GenericError),
202    UnknownValue(serde_json::Value),
203}
204
205/// struct for typed errors of method [`providers_google_workspace_users_list`]
206#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum ProvidersGoogleWorkspaceUsersListError {
209    Status400(models::ValidationError),
210    Status403(models::GenericError),
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`providers_google_workspace_users_retrieve`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum ProvidersGoogleWorkspaceUsersRetrieveError {
218    Status400(models::ValidationError),
219    Status403(models::GenericError),
220    UnknownValue(serde_json::Value),
221}
222
223/// struct for typed errors of method [`providers_google_workspace_users_used_by_list`]
224#[derive(Debug, Clone, Serialize, Deserialize)]
225#[serde(untagged)]
226pub enum ProvidersGoogleWorkspaceUsersUsedByListError {
227    Status400(models::ValidationError),
228    Status403(models::GenericError),
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed errors of method [`providers_ldap_create`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum ProvidersLdapCreateError {
236    Status400(models::ValidationError),
237    Status403(models::GenericError),
238    UnknownValue(serde_json::Value),
239}
240
241/// struct for typed errors of method [`providers_ldap_destroy`]
242#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum ProvidersLdapDestroyError {
245    Status400(models::ValidationError),
246    Status403(models::GenericError),
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`providers_ldap_list`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum ProvidersLdapListError {
254    Status400(models::ValidationError),
255    Status403(models::GenericError),
256    UnknownValue(serde_json::Value),
257}
258
259/// struct for typed errors of method [`providers_ldap_partial_update`]
260#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum ProvidersLdapPartialUpdateError {
263    Status400(models::ValidationError),
264    Status403(models::GenericError),
265    UnknownValue(serde_json::Value),
266}
267
268/// struct for typed errors of method [`providers_ldap_retrieve`]
269#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum ProvidersLdapRetrieveError {
272    Status400(models::ValidationError),
273    Status403(models::GenericError),
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`providers_ldap_update`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum ProvidersLdapUpdateError {
281    Status400(models::ValidationError),
282    Status403(models::GenericError),
283    UnknownValue(serde_json::Value),
284}
285
286/// struct for typed errors of method [`providers_ldap_used_by_list`]
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum ProvidersLdapUsedByListError {
290    Status400(models::ValidationError),
291    Status403(models::GenericError),
292    UnknownValue(serde_json::Value),
293}
294
295/// struct for typed errors of method [`providers_microsoft_entra_create`]
296#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(untagged)]
298pub enum ProvidersMicrosoftEntraCreateError {
299    Status400(models::ValidationError),
300    Status403(models::GenericError),
301    UnknownValue(serde_json::Value),
302}
303
304/// struct for typed errors of method [`providers_microsoft_entra_destroy`]
305#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(untagged)]
307pub enum ProvidersMicrosoftEntraDestroyError {
308    Status400(models::ValidationError),
309    Status403(models::GenericError),
310    UnknownValue(serde_json::Value),
311}
312
313/// struct for typed errors of method [`providers_microsoft_entra_groups_create`]
314#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum ProvidersMicrosoftEntraGroupsCreateError {
317    Status400(models::ValidationError),
318    Status403(models::GenericError),
319    UnknownValue(serde_json::Value),
320}
321
322/// struct for typed errors of method [`providers_microsoft_entra_groups_destroy`]
323#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum ProvidersMicrosoftEntraGroupsDestroyError {
326    Status400(models::ValidationError),
327    Status403(models::GenericError),
328    UnknownValue(serde_json::Value),
329}
330
331/// struct for typed errors of method [`providers_microsoft_entra_groups_list`]
332#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum ProvidersMicrosoftEntraGroupsListError {
335    Status400(models::ValidationError),
336    Status403(models::GenericError),
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`providers_microsoft_entra_groups_retrieve`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum ProvidersMicrosoftEntraGroupsRetrieveError {
344    Status400(models::ValidationError),
345    Status403(models::GenericError),
346    UnknownValue(serde_json::Value),
347}
348
349/// struct for typed errors of method [`providers_microsoft_entra_groups_used_by_list`]
350#[derive(Debug, Clone, Serialize, Deserialize)]
351#[serde(untagged)]
352pub enum ProvidersMicrosoftEntraGroupsUsedByListError {
353    Status400(models::ValidationError),
354    Status403(models::GenericError),
355    UnknownValue(serde_json::Value),
356}
357
358/// struct for typed errors of method [`providers_microsoft_entra_list`]
359#[derive(Debug, Clone, Serialize, Deserialize)]
360#[serde(untagged)]
361pub enum ProvidersMicrosoftEntraListError {
362    Status400(models::ValidationError),
363    Status403(models::GenericError),
364    UnknownValue(serde_json::Value),
365}
366
367/// struct for typed errors of method [`providers_microsoft_entra_partial_update`]
368#[derive(Debug, Clone, Serialize, Deserialize)]
369#[serde(untagged)]
370pub enum ProvidersMicrosoftEntraPartialUpdateError {
371    Status400(models::ValidationError),
372    Status403(models::GenericError),
373    UnknownValue(serde_json::Value),
374}
375
376/// struct for typed errors of method [`providers_microsoft_entra_retrieve`]
377#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(untagged)]
379pub enum ProvidersMicrosoftEntraRetrieveError {
380    Status400(models::ValidationError),
381    Status403(models::GenericError),
382    UnknownValue(serde_json::Value),
383}
384
385/// struct for typed errors of method [`providers_microsoft_entra_sync_object_create`]
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum ProvidersMicrosoftEntraSyncObjectCreateError {
389    Status400(models::ValidationError),
390    Status403(models::GenericError),
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`providers_microsoft_entra_sync_status_retrieve`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum ProvidersMicrosoftEntraSyncStatusRetrieveError {
398    Status400(models::ValidationError),
399    Status403(models::GenericError),
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`providers_microsoft_entra_update`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum ProvidersMicrosoftEntraUpdateError {
407    Status400(models::ValidationError),
408    Status403(models::GenericError),
409    UnknownValue(serde_json::Value),
410}
411
412/// struct for typed errors of method [`providers_microsoft_entra_used_by_list`]
413#[derive(Debug, Clone, Serialize, Deserialize)]
414#[serde(untagged)]
415pub enum ProvidersMicrosoftEntraUsedByListError {
416    Status400(models::ValidationError),
417    Status403(models::GenericError),
418    UnknownValue(serde_json::Value),
419}
420
421/// struct for typed errors of method [`providers_microsoft_entra_users_create`]
422#[derive(Debug, Clone, Serialize, Deserialize)]
423#[serde(untagged)]
424pub enum ProvidersMicrosoftEntraUsersCreateError {
425    Status400(models::ValidationError),
426    Status403(models::GenericError),
427    UnknownValue(serde_json::Value),
428}
429
430/// struct for typed errors of method [`providers_microsoft_entra_users_destroy`]
431#[derive(Debug, Clone, Serialize, Deserialize)]
432#[serde(untagged)]
433pub enum ProvidersMicrosoftEntraUsersDestroyError {
434    Status400(models::ValidationError),
435    Status403(models::GenericError),
436    UnknownValue(serde_json::Value),
437}
438
439/// struct for typed errors of method [`providers_microsoft_entra_users_list`]
440#[derive(Debug, Clone, Serialize, Deserialize)]
441#[serde(untagged)]
442pub enum ProvidersMicrosoftEntraUsersListError {
443    Status400(models::ValidationError),
444    Status403(models::GenericError),
445    UnknownValue(serde_json::Value),
446}
447
448/// struct for typed errors of method [`providers_microsoft_entra_users_retrieve`]
449#[derive(Debug, Clone, Serialize, Deserialize)]
450#[serde(untagged)]
451pub enum ProvidersMicrosoftEntraUsersRetrieveError {
452    Status400(models::ValidationError),
453    Status403(models::GenericError),
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`providers_microsoft_entra_users_used_by_list`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum ProvidersMicrosoftEntraUsersUsedByListError {
461    Status400(models::ValidationError),
462    Status403(models::GenericError),
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`providers_oauth2_create`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum ProvidersOauth2CreateError {
470    Status400(models::ValidationError),
471    Status403(models::GenericError),
472    UnknownValue(serde_json::Value),
473}
474
475/// struct for typed errors of method [`providers_oauth2_destroy`]
476#[derive(Debug, Clone, Serialize, Deserialize)]
477#[serde(untagged)]
478pub enum ProvidersOauth2DestroyError {
479    Status400(models::ValidationError),
480    Status403(models::GenericError),
481    UnknownValue(serde_json::Value),
482}
483
484/// struct for typed errors of method [`providers_oauth2_list`]
485#[derive(Debug, Clone, Serialize, Deserialize)]
486#[serde(untagged)]
487pub enum ProvidersOauth2ListError {
488    Status400(models::ValidationError),
489    Status403(models::GenericError),
490    UnknownValue(serde_json::Value),
491}
492
493/// struct for typed errors of method [`providers_oauth2_partial_update`]
494#[derive(Debug, Clone, Serialize, Deserialize)]
495#[serde(untagged)]
496pub enum ProvidersOauth2PartialUpdateError {
497    Status400(models::ValidationError),
498    Status403(models::GenericError),
499    UnknownValue(serde_json::Value),
500}
501
502/// struct for typed errors of method [`providers_oauth2_preview_user_retrieve`]
503#[derive(Debug, Clone, Serialize, Deserialize)]
504#[serde(untagged)]
505pub enum ProvidersOauth2PreviewUserRetrieveError {
506    Status400(),
507    Status403(models::GenericError),
508    UnknownValue(serde_json::Value),
509}
510
511/// struct for typed errors of method [`providers_oauth2_retrieve`]
512#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum ProvidersOauth2RetrieveError {
515    Status400(models::ValidationError),
516    Status403(models::GenericError),
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`providers_oauth2_setup_urls_retrieve`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum ProvidersOauth2SetupUrlsRetrieveError {
524    Status404(),
525    Status400(models::ValidationError),
526    Status403(models::GenericError),
527    UnknownValue(serde_json::Value),
528}
529
530/// struct for typed errors of method [`providers_oauth2_update`]
531#[derive(Debug, Clone, Serialize, Deserialize)]
532#[serde(untagged)]
533pub enum ProvidersOauth2UpdateError {
534    Status400(models::ValidationError),
535    Status403(models::GenericError),
536    UnknownValue(serde_json::Value),
537}
538
539/// struct for typed errors of method [`providers_oauth2_used_by_list`]
540#[derive(Debug, Clone, Serialize, Deserialize)]
541#[serde(untagged)]
542pub enum ProvidersOauth2UsedByListError {
543    Status400(models::ValidationError),
544    Status403(models::GenericError),
545    UnknownValue(serde_json::Value),
546}
547
548/// struct for typed errors of method [`providers_proxy_create`]
549#[derive(Debug, Clone, Serialize, Deserialize)]
550#[serde(untagged)]
551pub enum ProvidersProxyCreateError {
552    Status400(models::ValidationError),
553    Status403(models::GenericError),
554    UnknownValue(serde_json::Value),
555}
556
557/// struct for typed errors of method [`providers_proxy_destroy`]
558#[derive(Debug, Clone, Serialize, Deserialize)]
559#[serde(untagged)]
560pub enum ProvidersProxyDestroyError {
561    Status400(models::ValidationError),
562    Status403(models::GenericError),
563    UnknownValue(serde_json::Value),
564}
565
566/// struct for typed errors of method [`providers_proxy_list`]
567#[derive(Debug, Clone, Serialize, Deserialize)]
568#[serde(untagged)]
569pub enum ProvidersProxyListError {
570    Status400(models::ValidationError),
571    Status403(models::GenericError),
572    UnknownValue(serde_json::Value),
573}
574
575/// struct for typed errors of method [`providers_proxy_partial_update`]
576#[derive(Debug, Clone, Serialize, Deserialize)]
577#[serde(untagged)]
578pub enum ProvidersProxyPartialUpdateError {
579    Status400(models::ValidationError),
580    Status403(models::GenericError),
581    UnknownValue(serde_json::Value),
582}
583
584/// struct for typed errors of method [`providers_proxy_retrieve`]
585#[derive(Debug, Clone, Serialize, Deserialize)]
586#[serde(untagged)]
587pub enum ProvidersProxyRetrieveError {
588    Status400(models::ValidationError),
589    Status403(models::GenericError),
590    UnknownValue(serde_json::Value),
591}
592
593/// struct for typed errors of method [`providers_proxy_update`]
594#[derive(Debug, Clone, Serialize, Deserialize)]
595#[serde(untagged)]
596pub enum ProvidersProxyUpdateError {
597    Status400(models::ValidationError),
598    Status403(models::GenericError),
599    UnknownValue(serde_json::Value),
600}
601
602/// struct for typed errors of method [`providers_proxy_used_by_list`]
603#[derive(Debug, Clone, Serialize, Deserialize)]
604#[serde(untagged)]
605pub enum ProvidersProxyUsedByListError {
606    Status400(models::ValidationError),
607    Status403(models::GenericError),
608    UnknownValue(serde_json::Value),
609}
610
611/// struct for typed errors of method [`providers_rac_create`]
612#[derive(Debug, Clone, Serialize, Deserialize)]
613#[serde(untagged)]
614pub enum ProvidersRacCreateError {
615    Status400(models::ValidationError),
616    Status403(models::GenericError),
617    UnknownValue(serde_json::Value),
618}
619
620/// struct for typed errors of method [`providers_rac_destroy`]
621#[derive(Debug, Clone, Serialize, Deserialize)]
622#[serde(untagged)]
623pub enum ProvidersRacDestroyError {
624    Status400(models::ValidationError),
625    Status403(models::GenericError),
626    UnknownValue(serde_json::Value),
627}
628
629/// struct for typed errors of method [`providers_rac_list`]
630#[derive(Debug, Clone, Serialize, Deserialize)]
631#[serde(untagged)]
632pub enum ProvidersRacListError {
633    Status400(models::ValidationError),
634    Status403(models::GenericError),
635    UnknownValue(serde_json::Value),
636}
637
638/// struct for typed errors of method [`providers_rac_partial_update`]
639#[derive(Debug, Clone, Serialize, Deserialize)]
640#[serde(untagged)]
641pub enum ProvidersRacPartialUpdateError {
642    Status400(models::ValidationError),
643    Status403(models::GenericError),
644    UnknownValue(serde_json::Value),
645}
646
647/// struct for typed errors of method [`providers_rac_retrieve`]
648#[derive(Debug, Clone, Serialize, Deserialize)]
649#[serde(untagged)]
650pub enum ProvidersRacRetrieveError {
651    Status400(models::ValidationError),
652    Status403(models::GenericError),
653    UnknownValue(serde_json::Value),
654}
655
656/// struct for typed errors of method [`providers_rac_update`]
657#[derive(Debug, Clone, Serialize, Deserialize)]
658#[serde(untagged)]
659pub enum ProvidersRacUpdateError {
660    Status400(models::ValidationError),
661    Status403(models::GenericError),
662    UnknownValue(serde_json::Value),
663}
664
665/// struct for typed errors of method [`providers_rac_used_by_list`]
666#[derive(Debug, Clone, Serialize, Deserialize)]
667#[serde(untagged)]
668pub enum ProvidersRacUsedByListError {
669    Status400(models::ValidationError),
670    Status403(models::GenericError),
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`providers_radius_create`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum ProvidersRadiusCreateError {
678    Status400(models::ValidationError),
679    Status403(models::GenericError),
680    UnknownValue(serde_json::Value),
681}
682
683/// struct for typed errors of method [`providers_radius_destroy`]
684#[derive(Debug, Clone, Serialize, Deserialize)]
685#[serde(untagged)]
686pub enum ProvidersRadiusDestroyError {
687    Status400(models::ValidationError),
688    Status403(models::GenericError),
689    UnknownValue(serde_json::Value),
690}
691
692/// struct for typed errors of method [`providers_radius_list`]
693#[derive(Debug, Clone, Serialize, Deserialize)]
694#[serde(untagged)]
695pub enum ProvidersRadiusListError {
696    Status400(models::ValidationError),
697    Status403(models::GenericError),
698    UnknownValue(serde_json::Value),
699}
700
701/// struct for typed errors of method [`providers_radius_partial_update`]
702#[derive(Debug, Clone, Serialize, Deserialize)]
703#[serde(untagged)]
704pub enum ProvidersRadiusPartialUpdateError {
705    Status400(models::ValidationError),
706    Status403(models::GenericError),
707    UnknownValue(serde_json::Value),
708}
709
710/// struct for typed errors of method [`providers_radius_retrieve`]
711#[derive(Debug, Clone, Serialize, Deserialize)]
712#[serde(untagged)]
713pub enum ProvidersRadiusRetrieveError {
714    Status400(models::ValidationError),
715    Status403(models::GenericError),
716    UnknownValue(serde_json::Value),
717}
718
719/// struct for typed errors of method [`providers_radius_update`]
720#[derive(Debug, Clone, Serialize, Deserialize)]
721#[serde(untagged)]
722pub enum ProvidersRadiusUpdateError {
723    Status400(models::ValidationError),
724    Status403(models::GenericError),
725    UnknownValue(serde_json::Value),
726}
727
728/// struct for typed errors of method [`providers_radius_used_by_list`]
729#[derive(Debug, Clone, Serialize, Deserialize)]
730#[serde(untagged)]
731pub enum ProvidersRadiusUsedByListError {
732    Status400(models::ValidationError),
733    Status403(models::GenericError),
734    UnknownValue(serde_json::Value),
735}
736
737/// struct for typed errors of method [`providers_saml_create`]
738#[derive(Debug, Clone, Serialize, Deserialize)]
739#[serde(untagged)]
740pub enum ProvidersSamlCreateError {
741    Status400(models::ValidationError),
742    Status403(models::GenericError),
743    UnknownValue(serde_json::Value),
744}
745
746/// struct for typed errors of method [`providers_saml_destroy`]
747#[derive(Debug, Clone, Serialize, Deserialize)]
748#[serde(untagged)]
749pub enum ProvidersSamlDestroyError {
750    Status400(models::ValidationError),
751    Status403(models::GenericError),
752    UnknownValue(serde_json::Value),
753}
754
755/// struct for typed errors of method [`providers_saml_import_metadata_create`]
756#[derive(Debug, Clone, Serialize, Deserialize)]
757#[serde(untagged)]
758pub enum ProvidersSamlImportMetadataCreateError {
759    Status400(),
760    Status403(models::GenericError),
761    UnknownValue(serde_json::Value),
762}
763
764/// struct for typed errors of method [`providers_saml_list`]
765#[derive(Debug, Clone, Serialize, Deserialize)]
766#[serde(untagged)]
767pub enum ProvidersSamlListError {
768    Status400(models::ValidationError),
769    Status403(models::GenericError),
770    UnknownValue(serde_json::Value),
771}
772
773/// struct for typed errors of method [`providers_saml_metadata_retrieve`]
774#[derive(Debug, Clone, Serialize, Deserialize)]
775#[serde(untagged)]
776pub enum ProvidersSamlMetadataRetrieveError {
777    Status404(),
778    Status400(models::ValidationError),
779    Status403(models::GenericError),
780    UnknownValue(serde_json::Value),
781}
782
783/// struct for typed errors of method [`providers_saml_partial_update`]
784#[derive(Debug, Clone, Serialize, Deserialize)]
785#[serde(untagged)]
786pub enum ProvidersSamlPartialUpdateError {
787    Status400(models::ValidationError),
788    Status403(models::GenericError),
789    UnknownValue(serde_json::Value),
790}
791
792/// struct for typed errors of method [`providers_saml_preview_user_retrieve`]
793#[derive(Debug, Clone, Serialize, Deserialize)]
794#[serde(untagged)]
795pub enum ProvidersSamlPreviewUserRetrieveError {
796    Status400(),
797    Status403(models::GenericError),
798    UnknownValue(serde_json::Value),
799}
800
801/// struct for typed errors of method [`providers_saml_retrieve`]
802#[derive(Debug, Clone, Serialize, Deserialize)]
803#[serde(untagged)]
804pub enum ProvidersSamlRetrieveError {
805    Status400(models::ValidationError),
806    Status403(models::GenericError),
807    UnknownValue(serde_json::Value),
808}
809
810/// struct for typed errors of method [`providers_saml_update`]
811#[derive(Debug, Clone, Serialize, Deserialize)]
812#[serde(untagged)]
813pub enum ProvidersSamlUpdateError {
814    Status400(models::ValidationError),
815    Status403(models::GenericError),
816    UnknownValue(serde_json::Value),
817}
818
819/// struct for typed errors of method [`providers_saml_used_by_list`]
820#[derive(Debug, Clone, Serialize, Deserialize)]
821#[serde(untagged)]
822pub enum ProvidersSamlUsedByListError {
823    Status400(models::ValidationError),
824    Status403(models::GenericError),
825    UnknownValue(serde_json::Value),
826}
827
828/// struct for typed errors of method [`providers_scim_create`]
829#[derive(Debug, Clone, Serialize, Deserialize)]
830#[serde(untagged)]
831pub enum ProvidersScimCreateError {
832    Status400(models::ValidationError),
833    Status403(models::GenericError),
834    UnknownValue(serde_json::Value),
835}
836
837/// struct for typed errors of method [`providers_scim_destroy`]
838#[derive(Debug, Clone, Serialize, Deserialize)]
839#[serde(untagged)]
840pub enum ProvidersScimDestroyError {
841    Status400(models::ValidationError),
842    Status403(models::GenericError),
843    UnknownValue(serde_json::Value),
844}
845
846/// struct for typed errors of method [`providers_scim_groups_create`]
847#[derive(Debug, Clone, Serialize, Deserialize)]
848#[serde(untagged)]
849pub enum ProvidersScimGroupsCreateError {
850    Status400(models::ValidationError),
851    Status403(models::GenericError),
852    UnknownValue(serde_json::Value),
853}
854
855/// struct for typed errors of method [`providers_scim_groups_destroy`]
856#[derive(Debug, Clone, Serialize, Deserialize)]
857#[serde(untagged)]
858pub enum ProvidersScimGroupsDestroyError {
859    Status400(models::ValidationError),
860    Status403(models::GenericError),
861    UnknownValue(serde_json::Value),
862}
863
864/// struct for typed errors of method [`providers_scim_groups_list`]
865#[derive(Debug, Clone, Serialize, Deserialize)]
866#[serde(untagged)]
867pub enum ProvidersScimGroupsListError {
868    Status400(models::ValidationError),
869    Status403(models::GenericError),
870    UnknownValue(serde_json::Value),
871}
872
873/// struct for typed errors of method [`providers_scim_groups_retrieve`]
874#[derive(Debug, Clone, Serialize, Deserialize)]
875#[serde(untagged)]
876pub enum ProvidersScimGroupsRetrieveError {
877    Status400(models::ValidationError),
878    Status403(models::GenericError),
879    UnknownValue(serde_json::Value),
880}
881
882/// struct for typed errors of method [`providers_scim_groups_used_by_list`]
883#[derive(Debug, Clone, Serialize, Deserialize)]
884#[serde(untagged)]
885pub enum ProvidersScimGroupsUsedByListError {
886    Status400(models::ValidationError),
887    Status403(models::GenericError),
888    UnknownValue(serde_json::Value),
889}
890
891/// struct for typed errors of method [`providers_scim_list`]
892#[derive(Debug, Clone, Serialize, Deserialize)]
893#[serde(untagged)]
894pub enum ProvidersScimListError {
895    Status400(models::ValidationError),
896    Status403(models::GenericError),
897    UnknownValue(serde_json::Value),
898}
899
900/// struct for typed errors of method [`providers_scim_partial_update`]
901#[derive(Debug, Clone, Serialize, Deserialize)]
902#[serde(untagged)]
903pub enum ProvidersScimPartialUpdateError {
904    Status400(models::ValidationError),
905    Status403(models::GenericError),
906    UnknownValue(serde_json::Value),
907}
908
909/// struct for typed errors of method [`providers_scim_retrieve`]
910#[derive(Debug, Clone, Serialize, Deserialize)]
911#[serde(untagged)]
912pub enum ProvidersScimRetrieveError {
913    Status400(models::ValidationError),
914    Status403(models::GenericError),
915    UnknownValue(serde_json::Value),
916}
917
918/// struct for typed errors of method [`providers_scim_sync_object_create`]
919#[derive(Debug, Clone, Serialize, Deserialize)]
920#[serde(untagged)]
921pub enum ProvidersScimSyncObjectCreateError {
922    Status400(models::ValidationError),
923    Status403(models::GenericError),
924    UnknownValue(serde_json::Value),
925}
926
927/// struct for typed errors of method [`providers_scim_sync_status_retrieve`]
928#[derive(Debug, Clone, Serialize, Deserialize)]
929#[serde(untagged)]
930pub enum ProvidersScimSyncStatusRetrieveError {
931    Status400(models::ValidationError),
932    Status403(models::GenericError),
933    UnknownValue(serde_json::Value),
934}
935
936/// struct for typed errors of method [`providers_scim_update`]
937#[derive(Debug, Clone, Serialize, Deserialize)]
938#[serde(untagged)]
939pub enum ProvidersScimUpdateError {
940    Status400(models::ValidationError),
941    Status403(models::GenericError),
942    UnknownValue(serde_json::Value),
943}
944
945/// struct for typed errors of method [`providers_scim_used_by_list`]
946#[derive(Debug, Clone, Serialize, Deserialize)]
947#[serde(untagged)]
948pub enum ProvidersScimUsedByListError {
949    Status400(models::ValidationError),
950    Status403(models::GenericError),
951    UnknownValue(serde_json::Value),
952}
953
954/// struct for typed errors of method [`providers_scim_users_create`]
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(untagged)]
957pub enum ProvidersScimUsersCreateError {
958    Status400(models::ValidationError),
959    Status403(models::GenericError),
960    UnknownValue(serde_json::Value),
961}
962
963/// struct for typed errors of method [`providers_scim_users_destroy`]
964#[derive(Debug, Clone, Serialize, Deserialize)]
965#[serde(untagged)]
966pub enum ProvidersScimUsersDestroyError {
967    Status400(models::ValidationError),
968    Status403(models::GenericError),
969    UnknownValue(serde_json::Value),
970}
971
972/// struct for typed errors of method [`providers_scim_users_list`]
973#[derive(Debug, Clone, Serialize, Deserialize)]
974#[serde(untagged)]
975pub enum ProvidersScimUsersListError {
976    Status400(models::ValidationError),
977    Status403(models::GenericError),
978    UnknownValue(serde_json::Value),
979}
980
981/// struct for typed errors of method [`providers_scim_users_retrieve`]
982#[derive(Debug, Clone, Serialize, Deserialize)]
983#[serde(untagged)]
984pub enum ProvidersScimUsersRetrieveError {
985    Status400(models::ValidationError),
986    Status403(models::GenericError),
987    UnknownValue(serde_json::Value),
988}
989
990/// struct for typed errors of method [`providers_scim_users_used_by_list`]
991#[derive(Debug, Clone, Serialize, Deserialize)]
992#[serde(untagged)]
993pub enum ProvidersScimUsersUsedByListError {
994    Status400(models::ValidationError),
995    Status403(models::GenericError),
996    UnknownValue(serde_json::Value),
997}
998
999/// struct for typed errors of method [`providers_ssf_create`]
1000#[derive(Debug, Clone, Serialize, Deserialize)]
1001#[serde(untagged)]
1002pub enum ProvidersSsfCreateError {
1003    Status400(models::ValidationError),
1004    Status403(models::GenericError),
1005    UnknownValue(serde_json::Value),
1006}
1007
1008/// struct for typed errors of method [`providers_ssf_destroy`]
1009#[derive(Debug, Clone, Serialize, Deserialize)]
1010#[serde(untagged)]
1011pub enum ProvidersSsfDestroyError {
1012    Status400(models::ValidationError),
1013    Status403(models::GenericError),
1014    UnknownValue(serde_json::Value),
1015}
1016
1017/// struct for typed errors of method [`providers_ssf_list`]
1018#[derive(Debug, Clone, Serialize, Deserialize)]
1019#[serde(untagged)]
1020pub enum ProvidersSsfListError {
1021    Status400(models::ValidationError),
1022    Status403(models::GenericError),
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`providers_ssf_partial_update`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum ProvidersSsfPartialUpdateError {
1030    Status400(models::ValidationError),
1031    Status403(models::GenericError),
1032    UnknownValue(serde_json::Value),
1033}
1034
1035/// struct for typed errors of method [`providers_ssf_retrieve`]
1036#[derive(Debug, Clone, Serialize, Deserialize)]
1037#[serde(untagged)]
1038pub enum ProvidersSsfRetrieveError {
1039    Status400(models::ValidationError),
1040    Status403(models::GenericError),
1041    UnknownValue(serde_json::Value),
1042}
1043
1044/// struct for typed errors of method [`providers_ssf_update`]
1045#[derive(Debug, Clone, Serialize, Deserialize)]
1046#[serde(untagged)]
1047pub enum ProvidersSsfUpdateError {
1048    Status400(models::ValidationError),
1049    Status403(models::GenericError),
1050    UnknownValue(serde_json::Value),
1051}
1052
1053/// struct for typed errors of method [`providers_ssf_used_by_list`]
1054#[derive(Debug, Clone, Serialize, Deserialize)]
1055#[serde(untagged)]
1056pub enum ProvidersSsfUsedByListError {
1057    Status400(models::ValidationError),
1058    Status403(models::GenericError),
1059    UnknownValue(serde_json::Value),
1060}
1061
1062/// Provider Viewset
1063pub async fn providers_all_destroy(
1064    configuration: &configuration::Configuration,
1065    id: i32,
1066) -> Result<(), Error<ProvidersAllDestroyError>> {
1067    // add a prefix to parameters to efficiently prevent name collisions
1068    let p_path_id = id;
1069
1070    let uri_str = format!("{}/providers/all/{id}/", configuration.base_path, id = p_path_id);
1071    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1072
1073    if let Some(ref user_agent) = configuration.user_agent {
1074        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1075    }
1076    if let Some(ref token) = configuration.bearer_access_token {
1077        req_builder = req_builder.bearer_auth(token.to_owned());
1078    };
1079
1080    let req = req_builder.build()?;
1081    let resp = configuration.client.execute(req).await?;
1082
1083    let status = resp.status();
1084
1085    if !status.is_client_error() && !status.is_server_error() {
1086        Ok(())
1087    } else {
1088        let content = resp.text().await?;
1089        let entity: Option<ProvidersAllDestroyError> = serde_json::from_str(&content).ok();
1090        Err(Error::ResponseError(ResponseContent {
1091            status,
1092            content,
1093            entity,
1094        }))
1095    }
1096}
1097
1098/// Provider Viewset
1099pub async fn providers_all_list(
1100    configuration: &configuration::Configuration,
1101    application__isnull: Option<bool>,
1102    backchannel: Option<bool>,
1103    ordering: Option<&str>,
1104    page: Option<i32>,
1105    page_size: Option<i32>,
1106    search: Option<&str>,
1107) -> Result<models::PaginatedProviderList, Error<ProvidersAllListError>> {
1108    // add a prefix to parameters to efficiently prevent name collisions
1109    let p_query_application__isnull = application__isnull;
1110    let p_query_backchannel = backchannel;
1111    let p_query_ordering = ordering;
1112    let p_query_page = page;
1113    let p_query_page_size = page_size;
1114    let p_query_search = search;
1115
1116    let uri_str = format!("{}/providers/all/", configuration.base_path);
1117    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1118
1119    if let Some(ref param_value) = p_query_application__isnull {
1120        req_builder = req_builder.query(&[("application__isnull", &param_value.to_string())]);
1121    }
1122    if let Some(ref param_value) = p_query_backchannel {
1123        req_builder = req_builder.query(&[("backchannel", &param_value.to_string())]);
1124    }
1125    if let Some(ref param_value) = p_query_ordering {
1126        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1127    }
1128    if let Some(ref param_value) = p_query_page {
1129        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1130    }
1131    if let Some(ref param_value) = p_query_page_size {
1132        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1133    }
1134    if let Some(ref param_value) = p_query_search {
1135        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1136    }
1137    if let Some(ref user_agent) = configuration.user_agent {
1138        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1139    }
1140    if let Some(ref token) = configuration.bearer_access_token {
1141        req_builder = req_builder.bearer_auth(token.to_owned());
1142    };
1143
1144    let req = req_builder.build()?;
1145    let resp = configuration.client.execute(req).await?;
1146
1147    let status = resp.status();
1148    let content_type = resp
1149        .headers()
1150        .get("content-type")
1151        .and_then(|v| v.to_str().ok())
1152        .unwrap_or("application/octet-stream");
1153    let content_type = super::ContentType::from(content_type);
1154
1155    if !status.is_client_error() && !status.is_server_error() {
1156        let content = resp.text().await?;
1157        match content_type {
1158            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1159            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedProviderList`"))),
1160            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedProviderList`")))),
1161        }
1162    } else {
1163        let content = resp.text().await?;
1164        let entity: Option<ProvidersAllListError> = serde_json::from_str(&content).ok();
1165        Err(Error::ResponseError(ResponseContent {
1166            status,
1167            content,
1168            entity,
1169        }))
1170    }
1171}
1172
1173/// Provider Viewset
1174pub async fn providers_all_retrieve(
1175    configuration: &configuration::Configuration,
1176    id: i32,
1177) -> Result<models::Provider, Error<ProvidersAllRetrieveError>> {
1178    // add a prefix to parameters to efficiently prevent name collisions
1179    let p_path_id = id;
1180
1181    let uri_str = format!("{}/providers/all/{id}/", configuration.base_path, id = p_path_id);
1182    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1183
1184    if let Some(ref user_agent) = configuration.user_agent {
1185        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1186    }
1187    if let Some(ref token) = configuration.bearer_access_token {
1188        req_builder = req_builder.bearer_auth(token.to_owned());
1189    };
1190
1191    let req = req_builder.build()?;
1192    let resp = configuration.client.execute(req).await?;
1193
1194    let status = resp.status();
1195    let content_type = resp
1196        .headers()
1197        .get("content-type")
1198        .and_then(|v| v.to_str().ok())
1199        .unwrap_or("application/octet-stream");
1200    let content_type = super::ContentType::from(content_type);
1201
1202    if !status.is_client_error() && !status.is_server_error() {
1203        let content = resp.text().await?;
1204        match content_type {
1205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1206            ContentType::Text => {
1207                return Err(Error::from(serde_json::Error::custom(
1208                    "Received `text/plain` content type response that cannot be converted to `models::Provider`",
1209                )))
1210            }
1211            ContentType::Unsupported(unknown_type) => {
1212                return Err(Error::from(serde_json::Error::custom(format!(
1213                    "Received `{unknown_type}` content type response that cannot be converted to `models::Provider`"
1214                ))))
1215            }
1216        }
1217    } else {
1218        let content = resp.text().await?;
1219        let entity: Option<ProvidersAllRetrieveError> = serde_json::from_str(&content).ok();
1220        Err(Error::ResponseError(ResponseContent {
1221            status,
1222            content,
1223            entity,
1224        }))
1225    }
1226}
1227
1228/// Get all creatable types
1229pub async fn providers_all_types_list(
1230    configuration: &configuration::Configuration,
1231) -> Result<Vec<models::TypeCreate>, Error<ProvidersAllTypesListError>> {
1232    let uri_str = format!("{}/providers/all/types/", configuration.base_path);
1233    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1234
1235    if let Some(ref user_agent) = configuration.user_agent {
1236        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1237    }
1238    if let Some(ref token) = configuration.bearer_access_token {
1239        req_builder = req_builder.bearer_auth(token.to_owned());
1240    };
1241
1242    let req = req_builder.build()?;
1243    let resp = configuration.client.execute(req).await?;
1244
1245    let status = resp.status();
1246    let content_type = resp
1247        .headers()
1248        .get("content-type")
1249        .and_then(|v| v.to_str().ok())
1250        .unwrap_or("application/octet-stream");
1251    let content_type = super::ContentType::from(content_type);
1252
1253    if !status.is_client_error() && !status.is_server_error() {
1254        let content = resp.text().await?;
1255        match content_type {
1256            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1257            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::TypeCreate&gt;`"))),
1258            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::TypeCreate&gt;`")))),
1259        }
1260    } else {
1261        let content = resp.text().await?;
1262        let entity: Option<ProvidersAllTypesListError> = serde_json::from_str(&content).ok();
1263        Err(Error::ResponseError(ResponseContent {
1264            status,
1265            content,
1266            entity,
1267        }))
1268    }
1269}
1270
1271/// Get a list of all objects that use this object
1272pub async fn providers_all_used_by_list(
1273    configuration: &configuration::Configuration,
1274    id: i32,
1275) -> Result<Vec<models::UsedBy>, Error<ProvidersAllUsedByListError>> {
1276    // add a prefix to parameters to efficiently prevent name collisions
1277    let p_path_id = id;
1278
1279    let uri_str = format!(
1280        "{}/providers/all/{id}/used_by/",
1281        configuration.base_path,
1282        id = p_path_id
1283    );
1284    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1285
1286    if let Some(ref user_agent) = configuration.user_agent {
1287        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1288    }
1289    if let Some(ref token) = configuration.bearer_access_token {
1290        req_builder = req_builder.bearer_auth(token.to_owned());
1291    };
1292
1293    let req = req_builder.build()?;
1294    let resp = configuration.client.execute(req).await?;
1295
1296    let status = resp.status();
1297    let content_type = resp
1298        .headers()
1299        .get("content-type")
1300        .and_then(|v| v.to_str().ok())
1301        .unwrap_or("application/octet-stream");
1302    let content_type = super::ContentType::from(content_type);
1303
1304    if !status.is_client_error() && !status.is_server_error() {
1305        let content = resp.text().await?;
1306        match content_type {
1307            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1308            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
1309            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
1310        }
1311    } else {
1312        let content = resp.text().await?;
1313        let entity: Option<ProvidersAllUsedByListError> = serde_json::from_str(&content).ok();
1314        Err(Error::ResponseError(ResponseContent {
1315            status,
1316            content,
1317            entity,
1318        }))
1319    }
1320}
1321
1322/// GoogleWorkspaceProvider Viewset
1323pub async fn providers_google_workspace_create(
1324    configuration: &configuration::Configuration,
1325    google_workspace_provider_request: models::GoogleWorkspaceProviderRequest,
1326) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspaceCreateError>> {
1327    // add a prefix to parameters to efficiently prevent name collisions
1328    let p_body_google_workspace_provider_request = google_workspace_provider_request;
1329
1330    let uri_str = format!("{}/providers/google_workspace/", configuration.base_path);
1331    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1332
1333    if let Some(ref user_agent) = configuration.user_agent {
1334        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1335    }
1336    if let Some(ref token) = configuration.bearer_access_token {
1337        req_builder = req_builder.bearer_auth(token.to_owned());
1338    };
1339    req_builder = req_builder.json(&p_body_google_workspace_provider_request);
1340
1341    let req = req_builder.build()?;
1342    let resp = configuration.client.execute(req).await?;
1343
1344    let status = resp.status();
1345    let content_type = resp
1346        .headers()
1347        .get("content-type")
1348        .and_then(|v| v.to_str().ok())
1349        .unwrap_or("application/octet-stream");
1350    let content_type = super::ContentType::from(content_type);
1351
1352    if !status.is_client_error() && !status.is_server_error() {
1353        let content = resp.text().await?;
1354        match content_type {
1355            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1356            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProvider`"))),
1357            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProvider`")))),
1358        }
1359    } else {
1360        let content = resp.text().await?;
1361        let entity: Option<ProvidersGoogleWorkspaceCreateError> = serde_json::from_str(&content).ok();
1362        Err(Error::ResponseError(ResponseContent {
1363            status,
1364            content,
1365            entity,
1366        }))
1367    }
1368}
1369
1370/// GoogleWorkspaceProvider Viewset
1371pub async fn providers_google_workspace_destroy(
1372    configuration: &configuration::Configuration,
1373    id: i32,
1374) -> Result<(), Error<ProvidersGoogleWorkspaceDestroyError>> {
1375    // add a prefix to parameters to efficiently prevent name collisions
1376    let p_path_id = id;
1377
1378    let uri_str = format!(
1379        "{}/providers/google_workspace/{id}/",
1380        configuration.base_path,
1381        id = p_path_id
1382    );
1383    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1384
1385    if let Some(ref user_agent) = configuration.user_agent {
1386        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1387    }
1388    if let Some(ref token) = configuration.bearer_access_token {
1389        req_builder = req_builder.bearer_auth(token.to_owned());
1390    };
1391
1392    let req = req_builder.build()?;
1393    let resp = configuration.client.execute(req).await?;
1394
1395    let status = resp.status();
1396
1397    if !status.is_client_error() && !status.is_server_error() {
1398        Ok(())
1399    } else {
1400        let content = resp.text().await?;
1401        let entity: Option<ProvidersGoogleWorkspaceDestroyError> = serde_json::from_str(&content).ok();
1402        Err(Error::ResponseError(ResponseContent {
1403            status,
1404            content,
1405            entity,
1406        }))
1407    }
1408}
1409
1410/// GoogleWorkspaceProviderGroup Viewset
1411pub async fn providers_google_workspace_groups_create(
1412    configuration: &configuration::Configuration,
1413    google_workspace_provider_group_request: models::GoogleWorkspaceProviderGroupRequest,
1414) -> Result<models::GoogleWorkspaceProviderGroup, Error<ProvidersGoogleWorkspaceGroupsCreateError>> {
1415    // add a prefix to parameters to efficiently prevent name collisions
1416    let p_body_google_workspace_provider_group_request = google_workspace_provider_group_request;
1417
1418    let uri_str = format!("{}/providers/google_workspace_groups/", configuration.base_path);
1419    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1420
1421    if let Some(ref user_agent) = configuration.user_agent {
1422        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1423    }
1424    if let Some(ref token) = configuration.bearer_access_token {
1425        req_builder = req_builder.bearer_auth(token.to_owned());
1426    };
1427    req_builder = req_builder.json(&p_body_google_workspace_provider_group_request);
1428
1429    let req = req_builder.build()?;
1430    let resp = configuration.client.execute(req).await?;
1431
1432    let status = resp.status();
1433    let content_type = resp
1434        .headers()
1435        .get("content-type")
1436        .and_then(|v| v.to_str().ok())
1437        .unwrap_or("application/octet-stream");
1438    let content_type = super::ContentType::from(content_type);
1439
1440    if !status.is_client_error() && !status.is_server_error() {
1441        let content = resp.text().await?;
1442        match content_type {
1443            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1444            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderGroup`"))),
1445            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderGroup`")))),
1446        }
1447    } else {
1448        let content = resp.text().await?;
1449        let entity: Option<ProvidersGoogleWorkspaceGroupsCreateError> = serde_json::from_str(&content).ok();
1450        Err(Error::ResponseError(ResponseContent {
1451            status,
1452            content,
1453            entity,
1454        }))
1455    }
1456}
1457
1458/// GoogleWorkspaceProviderGroup Viewset
1459pub async fn providers_google_workspace_groups_destroy(
1460    configuration: &configuration::Configuration,
1461    id: &str,
1462) -> Result<(), Error<ProvidersGoogleWorkspaceGroupsDestroyError>> {
1463    // add a prefix to parameters to efficiently prevent name collisions
1464    let p_path_id = id;
1465
1466    let uri_str = format!(
1467        "{}/providers/google_workspace_groups/{id}/",
1468        configuration.base_path,
1469        id = crate::apis::urlencode(p_path_id)
1470    );
1471    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1472
1473    if let Some(ref user_agent) = configuration.user_agent {
1474        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1475    }
1476    if let Some(ref token) = configuration.bearer_access_token {
1477        req_builder = req_builder.bearer_auth(token.to_owned());
1478    };
1479
1480    let req = req_builder.build()?;
1481    let resp = configuration.client.execute(req).await?;
1482
1483    let status = resp.status();
1484
1485    if !status.is_client_error() && !status.is_server_error() {
1486        Ok(())
1487    } else {
1488        let content = resp.text().await?;
1489        let entity: Option<ProvidersGoogleWorkspaceGroupsDestroyError> = serde_json::from_str(&content).ok();
1490        Err(Error::ResponseError(ResponseContent {
1491            status,
1492            content,
1493            entity,
1494        }))
1495    }
1496}
1497
1498/// GoogleWorkspaceProviderGroup Viewset
1499pub async fn providers_google_workspace_groups_list(
1500    configuration: &configuration::Configuration,
1501    group__group_uuid: Option<&str>,
1502    group__name: Option<&str>,
1503    ordering: Option<&str>,
1504    page: Option<i32>,
1505    page_size: Option<i32>,
1506    provider__id: Option<i32>,
1507    search: Option<&str>,
1508) -> Result<models::PaginatedGoogleWorkspaceProviderGroupList, Error<ProvidersGoogleWorkspaceGroupsListError>> {
1509    // add a prefix to parameters to efficiently prevent name collisions
1510    let p_query_group__group_uuid = group__group_uuid;
1511    let p_query_group__name = group__name;
1512    let p_query_ordering = ordering;
1513    let p_query_page = page;
1514    let p_query_page_size = page_size;
1515    let p_query_provider__id = provider__id;
1516    let p_query_search = search;
1517
1518    let uri_str = format!("{}/providers/google_workspace_groups/", configuration.base_path);
1519    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1520
1521    if let Some(ref param_value) = p_query_group__group_uuid {
1522        req_builder = req_builder.query(&[("group__group_uuid", &param_value.to_string())]);
1523    }
1524    if let Some(ref param_value) = p_query_group__name {
1525        req_builder = req_builder.query(&[("group__name", &param_value.to_string())]);
1526    }
1527    if let Some(ref param_value) = p_query_ordering {
1528        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1529    }
1530    if let Some(ref param_value) = p_query_page {
1531        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1532    }
1533    if let Some(ref param_value) = p_query_page_size {
1534        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1535    }
1536    if let Some(ref param_value) = p_query_provider__id {
1537        req_builder = req_builder.query(&[("provider__id", &param_value.to_string())]);
1538    }
1539    if let Some(ref param_value) = p_query_search {
1540        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1541    }
1542    if let Some(ref user_agent) = configuration.user_agent {
1543        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1544    }
1545    if let Some(ref token) = configuration.bearer_access_token {
1546        req_builder = req_builder.bearer_auth(token.to_owned());
1547    };
1548
1549    let req = req_builder.build()?;
1550    let resp = configuration.client.execute(req).await?;
1551
1552    let status = resp.status();
1553    let content_type = resp
1554        .headers()
1555        .get("content-type")
1556        .and_then(|v| v.to_str().ok())
1557        .unwrap_or("application/octet-stream");
1558    let content_type = super::ContentType::from(content_type);
1559
1560    if !status.is_client_error() && !status.is_server_error() {
1561        let content = resp.text().await?;
1562        match content_type {
1563            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1564            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderGroupList`"))),
1565            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderGroupList`")))),
1566        }
1567    } else {
1568        let content = resp.text().await?;
1569        let entity: Option<ProvidersGoogleWorkspaceGroupsListError> = serde_json::from_str(&content).ok();
1570        Err(Error::ResponseError(ResponseContent {
1571            status,
1572            content,
1573            entity,
1574        }))
1575    }
1576}
1577
1578/// GoogleWorkspaceProviderGroup Viewset
1579pub async fn providers_google_workspace_groups_retrieve(
1580    configuration: &configuration::Configuration,
1581    id: &str,
1582) -> Result<models::GoogleWorkspaceProviderGroup, Error<ProvidersGoogleWorkspaceGroupsRetrieveError>> {
1583    // add a prefix to parameters to efficiently prevent name collisions
1584    let p_path_id = id;
1585
1586    let uri_str = format!(
1587        "{}/providers/google_workspace_groups/{id}/",
1588        configuration.base_path,
1589        id = crate::apis::urlencode(p_path_id)
1590    );
1591    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1592
1593    if let Some(ref user_agent) = configuration.user_agent {
1594        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1595    }
1596    if let Some(ref token) = configuration.bearer_access_token {
1597        req_builder = req_builder.bearer_auth(token.to_owned());
1598    };
1599
1600    let req = req_builder.build()?;
1601    let resp = configuration.client.execute(req).await?;
1602
1603    let status = resp.status();
1604    let content_type = resp
1605        .headers()
1606        .get("content-type")
1607        .and_then(|v| v.to_str().ok())
1608        .unwrap_or("application/octet-stream");
1609    let content_type = super::ContentType::from(content_type);
1610
1611    if !status.is_client_error() && !status.is_server_error() {
1612        let content = resp.text().await?;
1613        match content_type {
1614            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1615            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderGroup`"))),
1616            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderGroup`")))),
1617        }
1618    } else {
1619        let content = resp.text().await?;
1620        let entity: Option<ProvidersGoogleWorkspaceGroupsRetrieveError> = serde_json::from_str(&content).ok();
1621        Err(Error::ResponseError(ResponseContent {
1622            status,
1623            content,
1624            entity,
1625        }))
1626    }
1627}
1628
1629/// Get a list of all objects that use this object
1630pub async fn providers_google_workspace_groups_used_by_list(
1631    configuration: &configuration::Configuration,
1632    id: &str,
1633) -> Result<Vec<models::UsedBy>, Error<ProvidersGoogleWorkspaceGroupsUsedByListError>> {
1634    // add a prefix to parameters to efficiently prevent name collisions
1635    let p_path_id = id;
1636
1637    let uri_str = format!(
1638        "{}/providers/google_workspace_groups/{id}/used_by/",
1639        configuration.base_path,
1640        id = crate::apis::urlencode(p_path_id)
1641    );
1642    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1643
1644    if let Some(ref user_agent) = configuration.user_agent {
1645        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1646    }
1647    if let Some(ref token) = configuration.bearer_access_token {
1648        req_builder = req_builder.bearer_auth(token.to_owned());
1649    };
1650
1651    let req = req_builder.build()?;
1652    let resp = configuration.client.execute(req).await?;
1653
1654    let status = resp.status();
1655    let content_type = resp
1656        .headers()
1657        .get("content-type")
1658        .and_then(|v| v.to_str().ok())
1659        .unwrap_or("application/octet-stream");
1660    let content_type = super::ContentType::from(content_type);
1661
1662    if !status.is_client_error() && !status.is_server_error() {
1663        let content = resp.text().await?;
1664        match content_type {
1665            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1666            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
1667            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
1668        }
1669    } else {
1670        let content = resp.text().await?;
1671        let entity: Option<ProvidersGoogleWorkspaceGroupsUsedByListError> = serde_json::from_str(&content).ok();
1672        Err(Error::ResponseError(ResponseContent {
1673            status,
1674            content,
1675            entity,
1676        }))
1677    }
1678}
1679
1680/// GoogleWorkspaceProvider Viewset
1681pub async fn providers_google_workspace_list(
1682    configuration: &configuration::Configuration,
1683    delegated_subject: Option<&str>,
1684    exclude_users_service_account: Option<bool>,
1685    filter_group: Option<&str>,
1686    name: Option<&str>,
1687    ordering: Option<&str>,
1688    page: Option<i32>,
1689    page_size: Option<i32>,
1690    search: Option<&str>,
1691) -> Result<models::PaginatedGoogleWorkspaceProviderList, Error<ProvidersGoogleWorkspaceListError>> {
1692    // add a prefix to parameters to efficiently prevent name collisions
1693    let p_query_delegated_subject = delegated_subject;
1694    let p_query_exclude_users_service_account = exclude_users_service_account;
1695    let p_query_filter_group = filter_group;
1696    let p_query_name = name;
1697    let p_query_ordering = ordering;
1698    let p_query_page = page;
1699    let p_query_page_size = page_size;
1700    let p_query_search = search;
1701
1702    let uri_str = format!("{}/providers/google_workspace/", configuration.base_path);
1703    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1704
1705    if let Some(ref param_value) = p_query_delegated_subject {
1706        req_builder = req_builder.query(&[("delegated_subject", &param_value.to_string())]);
1707    }
1708    if let Some(ref param_value) = p_query_exclude_users_service_account {
1709        req_builder = req_builder.query(&[("exclude_users_service_account", &param_value.to_string())]);
1710    }
1711    if let Some(ref param_value) = p_query_filter_group {
1712        req_builder = req_builder.query(&[("filter_group", &param_value.to_string())]);
1713    }
1714    if let Some(ref param_value) = p_query_name {
1715        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
1716    }
1717    if let Some(ref param_value) = p_query_ordering {
1718        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1719    }
1720    if let Some(ref param_value) = p_query_page {
1721        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1722    }
1723    if let Some(ref param_value) = p_query_page_size {
1724        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1725    }
1726    if let Some(ref param_value) = p_query_search {
1727        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1728    }
1729    if let Some(ref user_agent) = configuration.user_agent {
1730        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1731    }
1732    if let Some(ref token) = configuration.bearer_access_token {
1733        req_builder = req_builder.bearer_auth(token.to_owned());
1734    };
1735
1736    let req = req_builder.build()?;
1737    let resp = configuration.client.execute(req).await?;
1738
1739    let status = resp.status();
1740    let content_type = resp
1741        .headers()
1742        .get("content-type")
1743        .and_then(|v| v.to_str().ok())
1744        .unwrap_or("application/octet-stream");
1745    let content_type = super::ContentType::from(content_type);
1746
1747    if !status.is_client_error() && !status.is_server_error() {
1748        let content = resp.text().await?;
1749        match content_type {
1750            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1751            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderList`"))),
1752            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderList`")))),
1753        }
1754    } else {
1755        let content = resp.text().await?;
1756        let entity: Option<ProvidersGoogleWorkspaceListError> = serde_json::from_str(&content).ok();
1757        Err(Error::ResponseError(ResponseContent {
1758            status,
1759            content,
1760            entity,
1761        }))
1762    }
1763}
1764
1765/// GoogleWorkspaceProvider Viewset
1766pub async fn providers_google_workspace_partial_update(
1767    configuration: &configuration::Configuration,
1768    id: i32,
1769    patched_google_workspace_provider_request: Option<models::PatchedGoogleWorkspaceProviderRequest>,
1770) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspacePartialUpdateError>> {
1771    // add a prefix to parameters to efficiently prevent name collisions
1772    let p_path_id = id;
1773    let p_body_patched_google_workspace_provider_request = patched_google_workspace_provider_request;
1774
1775    let uri_str = format!(
1776        "{}/providers/google_workspace/{id}/",
1777        configuration.base_path,
1778        id = p_path_id
1779    );
1780    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1781
1782    if let Some(ref user_agent) = configuration.user_agent {
1783        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1784    }
1785    if let Some(ref token) = configuration.bearer_access_token {
1786        req_builder = req_builder.bearer_auth(token.to_owned());
1787    };
1788    req_builder = req_builder.json(&p_body_patched_google_workspace_provider_request);
1789
1790    let req = req_builder.build()?;
1791    let resp = configuration.client.execute(req).await?;
1792
1793    let status = resp.status();
1794    let content_type = resp
1795        .headers()
1796        .get("content-type")
1797        .and_then(|v| v.to_str().ok())
1798        .unwrap_or("application/octet-stream");
1799    let content_type = super::ContentType::from(content_type);
1800
1801    if !status.is_client_error() && !status.is_server_error() {
1802        let content = resp.text().await?;
1803        match content_type {
1804            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1805            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProvider`"))),
1806            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProvider`")))),
1807        }
1808    } else {
1809        let content = resp.text().await?;
1810        let entity: Option<ProvidersGoogleWorkspacePartialUpdateError> = serde_json::from_str(&content).ok();
1811        Err(Error::ResponseError(ResponseContent {
1812            status,
1813            content,
1814            entity,
1815        }))
1816    }
1817}
1818
1819/// GoogleWorkspaceProvider Viewset
1820pub async fn providers_google_workspace_retrieve(
1821    configuration: &configuration::Configuration,
1822    id: i32,
1823) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspaceRetrieveError>> {
1824    // add a prefix to parameters to efficiently prevent name collisions
1825    let p_path_id = id;
1826
1827    let uri_str = format!(
1828        "{}/providers/google_workspace/{id}/",
1829        configuration.base_path,
1830        id = p_path_id
1831    );
1832    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1833
1834    if let Some(ref user_agent) = configuration.user_agent {
1835        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1836    }
1837    if let Some(ref token) = configuration.bearer_access_token {
1838        req_builder = req_builder.bearer_auth(token.to_owned());
1839    };
1840
1841    let req = req_builder.build()?;
1842    let resp = configuration.client.execute(req).await?;
1843
1844    let status = resp.status();
1845    let content_type = resp
1846        .headers()
1847        .get("content-type")
1848        .and_then(|v| v.to_str().ok())
1849        .unwrap_or("application/octet-stream");
1850    let content_type = super::ContentType::from(content_type);
1851
1852    if !status.is_client_error() && !status.is_server_error() {
1853        let content = resp.text().await?;
1854        match content_type {
1855            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1856            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProvider`"))),
1857            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProvider`")))),
1858        }
1859    } else {
1860        let content = resp.text().await?;
1861        let entity: Option<ProvidersGoogleWorkspaceRetrieveError> = serde_json::from_str(&content).ok();
1862        Err(Error::ResponseError(ResponseContent {
1863            status,
1864            content,
1865            entity,
1866        }))
1867    }
1868}
1869
1870/// Sync/Re-sync a single user/group object
1871pub async fn providers_google_workspace_sync_object_create(
1872    configuration: &configuration::Configuration,
1873    id: i32,
1874    sync_object_request: models::SyncObjectRequest,
1875) -> Result<models::SyncObjectResult, Error<ProvidersGoogleWorkspaceSyncObjectCreateError>> {
1876    // add a prefix to parameters to efficiently prevent name collisions
1877    let p_path_id = id;
1878    let p_body_sync_object_request = sync_object_request;
1879
1880    let uri_str = format!(
1881        "{}/providers/google_workspace/{id}/sync/object/",
1882        configuration.base_path,
1883        id = p_path_id
1884    );
1885    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1886
1887    if let Some(ref user_agent) = configuration.user_agent {
1888        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1889    }
1890    if let Some(ref token) = configuration.bearer_access_token {
1891        req_builder = req_builder.bearer_auth(token.to_owned());
1892    };
1893    req_builder = req_builder.json(&p_body_sync_object_request);
1894
1895    let req = req_builder.build()?;
1896    let resp = configuration.client.execute(req).await?;
1897
1898    let status = resp.status();
1899    let content_type = resp
1900        .headers()
1901        .get("content-type")
1902        .and_then(|v| v.to_str().ok())
1903        .unwrap_or("application/octet-stream");
1904    let content_type = super::ContentType::from(content_type);
1905
1906    if !status.is_client_error() && !status.is_server_error() {
1907        let content = resp.text().await?;
1908        match content_type {
1909            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1910            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncObjectResult`"))),
1911            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncObjectResult`")))),
1912        }
1913    } else {
1914        let content = resp.text().await?;
1915        let entity: Option<ProvidersGoogleWorkspaceSyncObjectCreateError> = serde_json::from_str(&content).ok();
1916        Err(Error::ResponseError(ResponseContent {
1917            status,
1918            content,
1919            entity,
1920        }))
1921    }
1922}
1923
1924/// Get provider's sync status
1925pub async fn providers_google_workspace_sync_status_retrieve(
1926    configuration: &configuration::Configuration,
1927    id: i32,
1928) -> Result<models::SyncStatus, Error<ProvidersGoogleWorkspaceSyncStatusRetrieveError>> {
1929    // add a prefix to parameters to efficiently prevent name collisions
1930    let p_path_id = id;
1931
1932    let uri_str = format!(
1933        "{}/providers/google_workspace/{id}/sync/status/",
1934        configuration.base_path,
1935        id = p_path_id
1936    );
1937    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1938
1939    if let Some(ref user_agent) = configuration.user_agent {
1940        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1941    }
1942    if let Some(ref token) = configuration.bearer_access_token {
1943        req_builder = req_builder.bearer_auth(token.to_owned());
1944    };
1945
1946    let req = req_builder.build()?;
1947    let resp = configuration.client.execute(req).await?;
1948
1949    let status = resp.status();
1950    let content_type = resp
1951        .headers()
1952        .get("content-type")
1953        .and_then(|v| v.to_str().ok())
1954        .unwrap_or("application/octet-stream");
1955    let content_type = super::ContentType::from(content_type);
1956
1957    if !status.is_client_error() && !status.is_server_error() {
1958        let content = resp.text().await?;
1959        match content_type {
1960            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1961            ContentType::Text => {
1962                return Err(Error::from(serde_json::Error::custom(
1963                    "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
1964                )))
1965            }
1966            ContentType::Unsupported(unknown_type) => {
1967                return Err(Error::from(serde_json::Error::custom(format!(
1968                    "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
1969                ))))
1970            }
1971        }
1972    } else {
1973        let content = resp.text().await?;
1974        let entity: Option<ProvidersGoogleWorkspaceSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
1975        Err(Error::ResponseError(ResponseContent {
1976            status,
1977            content,
1978            entity,
1979        }))
1980    }
1981}
1982
1983/// GoogleWorkspaceProvider Viewset
1984pub async fn providers_google_workspace_update(
1985    configuration: &configuration::Configuration,
1986    id: i32,
1987    google_workspace_provider_request: models::GoogleWorkspaceProviderRequest,
1988) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspaceUpdateError>> {
1989    // add a prefix to parameters to efficiently prevent name collisions
1990    let p_path_id = id;
1991    let p_body_google_workspace_provider_request = google_workspace_provider_request;
1992
1993    let uri_str = format!(
1994        "{}/providers/google_workspace/{id}/",
1995        configuration.base_path,
1996        id = p_path_id
1997    );
1998    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1999
2000    if let Some(ref user_agent) = configuration.user_agent {
2001        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2002    }
2003    if let Some(ref token) = configuration.bearer_access_token {
2004        req_builder = req_builder.bearer_auth(token.to_owned());
2005    };
2006    req_builder = req_builder.json(&p_body_google_workspace_provider_request);
2007
2008    let req = req_builder.build()?;
2009    let resp = configuration.client.execute(req).await?;
2010
2011    let status = resp.status();
2012    let content_type = resp
2013        .headers()
2014        .get("content-type")
2015        .and_then(|v| v.to_str().ok())
2016        .unwrap_or("application/octet-stream");
2017    let content_type = super::ContentType::from(content_type);
2018
2019    if !status.is_client_error() && !status.is_server_error() {
2020        let content = resp.text().await?;
2021        match content_type {
2022            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2023            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProvider`"))),
2024            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProvider`")))),
2025        }
2026    } else {
2027        let content = resp.text().await?;
2028        let entity: Option<ProvidersGoogleWorkspaceUpdateError> = serde_json::from_str(&content).ok();
2029        Err(Error::ResponseError(ResponseContent {
2030            status,
2031            content,
2032            entity,
2033        }))
2034    }
2035}
2036
2037/// Get a list of all objects that use this object
2038pub async fn providers_google_workspace_used_by_list(
2039    configuration: &configuration::Configuration,
2040    id: i32,
2041) -> Result<Vec<models::UsedBy>, Error<ProvidersGoogleWorkspaceUsedByListError>> {
2042    // add a prefix to parameters to efficiently prevent name collisions
2043    let p_path_id = id;
2044
2045    let uri_str = format!(
2046        "{}/providers/google_workspace/{id}/used_by/",
2047        configuration.base_path,
2048        id = p_path_id
2049    );
2050    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2051
2052    if let Some(ref user_agent) = configuration.user_agent {
2053        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2054    }
2055    if let Some(ref token) = configuration.bearer_access_token {
2056        req_builder = req_builder.bearer_auth(token.to_owned());
2057    };
2058
2059    let req = req_builder.build()?;
2060    let resp = configuration.client.execute(req).await?;
2061
2062    let status = resp.status();
2063    let content_type = resp
2064        .headers()
2065        .get("content-type")
2066        .and_then(|v| v.to_str().ok())
2067        .unwrap_or("application/octet-stream");
2068    let content_type = super::ContentType::from(content_type);
2069
2070    if !status.is_client_error() && !status.is_server_error() {
2071        let content = resp.text().await?;
2072        match content_type {
2073            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2074            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
2075            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
2076        }
2077    } else {
2078        let content = resp.text().await?;
2079        let entity: Option<ProvidersGoogleWorkspaceUsedByListError> = serde_json::from_str(&content).ok();
2080        Err(Error::ResponseError(ResponseContent {
2081            status,
2082            content,
2083            entity,
2084        }))
2085    }
2086}
2087
2088/// GoogleWorkspaceProviderUser Viewset
2089pub async fn providers_google_workspace_users_create(
2090    configuration: &configuration::Configuration,
2091    google_workspace_provider_user_request: models::GoogleWorkspaceProviderUserRequest,
2092) -> Result<models::GoogleWorkspaceProviderUser, Error<ProvidersGoogleWorkspaceUsersCreateError>> {
2093    // add a prefix to parameters to efficiently prevent name collisions
2094    let p_body_google_workspace_provider_user_request = google_workspace_provider_user_request;
2095
2096    let uri_str = format!("{}/providers/google_workspace_users/", configuration.base_path);
2097    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2098
2099    if let Some(ref user_agent) = configuration.user_agent {
2100        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2101    }
2102    if let Some(ref token) = configuration.bearer_access_token {
2103        req_builder = req_builder.bearer_auth(token.to_owned());
2104    };
2105    req_builder = req_builder.json(&p_body_google_workspace_provider_user_request);
2106
2107    let req = req_builder.build()?;
2108    let resp = configuration.client.execute(req).await?;
2109
2110    let status = resp.status();
2111    let content_type = resp
2112        .headers()
2113        .get("content-type")
2114        .and_then(|v| v.to_str().ok())
2115        .unwrap_or("application/octet-stream");
2116    let content_type = super::ContentType::from(content_type);
2117
2118    if !status.is_client_error() && !status.is_server_error() {
2119        let content = resp.text().await?;
2120        match content_type {
2121            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2122            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderUser`"))),
2123            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderUser`")))),
2124        }
2125    } else {
2126        let content = resp.text().await?;
2127        let entity: Option<ProvidersGoogleWorkspaceUsersCreateError> = serde_json::from_str(&content).ok();
2128        Err(Error::ResponseError(ResponseContent {
2129            status,
2130            content,
2131            entity,
2132        }))
2133    }
2134}
2135
2136/// GoogleWorkspaceProviderUser Viewset
2137pub async fn providers_google_workspace_users_destroy(
2138    configuration: &configuration::Configuration,
2139    id: &str,
2140) -> Result<(), Error<ProvidersGoogleWorkspaceUsersDestroyError>> {
2141    // add a prefix to parameters to efficiently prevent name collisions
2142    let p_path_id = id;
2143
2144    let uri_str = format!(
2145        "{}/providers/google_workspace_users/{id}/",
2146        configuration.base_path,
2147        id = crate::apis::urlencode(p_path_id)
2148    );
2149    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2150
2151    if let Some(ref user_agent) = configuration.user_agent {
2152        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2153    }
2154    if let Some(ref token) = configuration.bearer_access_token {
2155        req_builder = req_builder.bearer_auth(token.to_owned());
2156    };
2157
2158    let req = req_builder.build()?;
2159    let resp = configuration.client.execute(req).await?;
2160
2161    let status = resp.status();
2162
2163    if !status.is_client_error() && !status.is_server_error() {
2164        Ok(())
2165    } else {
2166        let content = resp.text().await?;
2167        let entity: Option<ProvidersGoogleWorkspaceUsersDestroyError> = serde_json::from_str(&content).ok();
2168        Err(Error::ResponseError(ResponseContent {
2169            status,
2170            content,
2171            entity,
2172        }))
2173    }
2174}
2175
2176/// GoogleWorkspaceProviderUser Viewset
2177pub async fn providers_google_workspace_users_list(
2178    configuration: &configuration::Configuration,
2179    ordering: Option<&str>,
2180    page: Option<i32>,
2181    page_size: Option<i32>,
2182    provider__id: Option<i32>,
2183    search: Option<&str>,
2184    user__id: Option<i32>,
2185    user__username: Option<&str>,
2186) -> Result<models::PaginatedGoogleWorkspaceProviderUserList, Error<ProvidersGoogleWorkspaceUsersListError>> {
2187    // add a prefix to parameters to efficiently prevent name collisions
2188    let p_query_ordering = ordering;
2189    let p_query_page = page;
2190    let p_query_page_size = page_size;
2191    let p_query_provider__id = provider__id;
2192    let p_query_search = search;
2193    let p_query_user__id = user__id;
2194    let p_query_user__username = user__username;
2195
2196    let uri_str = format!("{}/providers/google_workspace_users/", configuration.base_path);
2197    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2198
2199    if let Some(ref param_value) = p_query_ordering {
2200        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2201    }
2202    if let Some(ref param_value) = p_query_page {
2203        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2204    }
2205    if let Some(ref param_value) = p_query_page_size {
2206        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2207    }
2208    if let Some(ref param_value) = p_query_provider__id {
2209        req_builder = req_builder.query(&[("provider__id", &param_value.to_string())]);
2210    }
2211    if let Some(ref param_value) = p_query_search {
2212        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2213    }
2214    if let Some(ref param_value) = p_query_user__id {
2215        req_builder = req_builder.query(&[("user__id", &param_value.to_string())]);
2216    }
2217    if let Some(ref param_value) = p_query_user__username {
2218        req_builder = req_builder.query(&[("user__username", &param_value.to_string())]);
2219    }
2220    if let Some(ref user_agent) = configuration.user_agent {
2221        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2222    }
2223    if let Some(ref token) = configuration.bearer_access_token {
2224        req_builder = req_builder.bearer_auth(token.to_owned());
2225    };
2226
2227    let req = req_builder.build()?;
2228    let resp = configuration.client.execute(req).await?;
2229
2230    let status = resp.status();
2231    let content_type = resp
2232        .headers()
2233        .get("content-type")
2234        .and_then(|v| v.to_str().ok())
2235        .unwrap_or("application/octet-stream");
2236    let content_type = super::ContentType::from(content_type);
2237
2238    if !status.is_client_error() && !status.is_server_error() {
2239        let content = resp.text().await?;
2240        match content_type {
2241            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2242            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderUserList`"))),
2243            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderUserList`")))),
2244        }
2245    } else {
2246        let content = resp.text().await?;
2247        let entity: Option<ProvidersGoogleWorkspaceUsersListError> = serde_json::from_str(&content).ok();
2248        Err(Error::ResponseError(ResponseContent {
2249            status,
2250            content,
2251            entity,
2252        }))
2253    }
2254}
2255
2256/// GoogleWorkspaceProviderUser Viewset
2257pub async fn providers_google_workspace_users_retrieve(
2258    configuration: &configuration::Configuration,
2259    id: &str,
2260) -> Result<models::GoogleWorkspaceProviderUser, Error<ProvidersGoogleWorkspaceUsersRetrieveError>> {
2261    // add a prefix to parameters to efficiently prevent name collisions
2262    let p_path_id = id;
2263
2264    let uri_str = format!(
2265        "{}/providers/google_workspace_users/{id}/",
2266        configuration.base_path,
2267        id = crate::apis::urlencode(p_path_id)
2268    );
2269    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2270
2271    if let Some(ref user_agent) = configuration.user_agent {
2272        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2273    }
2274    if let Some(ref token) = configuration.bearer_access_token {
2275        req_builder = req_builder.bearer_auth(token.to_owned());
2276    };
2277
2278    let req = req_builder.build()?;
2279    let resp = configuration.client.execute(req).await?;
2280
2281    let status = resp.status();
2282    let content_type = resp
2283        .headers()
2284        .get("content-type")
2285        .and_then(|v| v.to_str().ok())
2286        .unwrap_or("application/octet-stream");
2287    let content_type = super::ContentType::from(content_type);
2288
2289    if !status.is_client_error() && !status.is_server_error() {
2290        let content = resp.text().await?;
2291        match content_type {
2292            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2293            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderUser`"))),
2294            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderUser`")))),
2295        }
2296    } else {
2297        let content = resp.text().await?;
2298        let entity: Option<ProvidersGoogleWorkspaceUsersRetrieveError> = serde_json::from_str(&content).ok();
2299        Err(Error::ResponseError(ResponseContent {
2300            status,
2301            content,
2302            entity,
2303        }))
2304    }
2305}
2306
2307/// Get a list of all objects that use this object
2308pub async fn providers_google_workspace_users_used_by_list(
2309    configuration: &configuration::Configuration,
2310    id: &str,
2311) -> Result<Vec<models::UsedBy>, Error<ProvidersGoogleWorkspaceUsersUsedByListError>> {
2312    // add a prefix to parameters to efficiently prevent name collisions
2313    let p_path_id = id;
2314
2315    let uri_str = format!(
2316        "{}/providers/google_workspace_users/{id}/used_by/",
2317        configuration.base_path,
2318        id = crate::apis::urlencode(p_path_id)
2319    );
2320    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2321
2322    if let Some(ref user_agent) = configuration.user_agent {
2323        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2324    }
2325    if let Some(ref token) = configuration.bearer_access_token {
2326        req_builder = req_builder.bearer_auth(token.to_owned());
2327    };
2328
2329    let req = req_builder.build()?;
2330    let resp = configuration.client.execute(req).await?;
2331
2332    let status = resp.status();
2333    let content_type = resp
2334        .headers()
2335        .get("content-type")
2336        .and_then(|v| v.to_str().ok())
2337        .unwrap_or("application/octet-stream");
2338    let content_type = super::ContentType::from(content_type);
2339
2340    if !status.is_client_error() && !status.is_server_error() {
2341        let content = resp.text().await?;
2342        match content_type {
2343            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2344            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
2345            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
2346        }
2347    } else {
2348        let content = resp.text().await?;
2349        let entity: Option<ProvidersGoogleWorkspaceUsersUsedByListError> = serde_json::from_str(&content).ok();
2350        Err(Error::ResponseError(ResponseContent {
2351            status,
2352            content,
2353            entity,
2354        }))
2355    }
2356}
2357
2358/// LDAPProvider Viewset
2359pub async fn providers_ldap_create(
2360    configuration: &configuration::Configuration,
2361    ldap_provider_request: models::LdapProviderRequest,
2362) -> Result<models::LdapProvider, Error<ProvidersLdapCreateError>> {
2363    // add a prefix to parameters to efficiently prevent name collisions
2364    let p_body_ldap_provider_request = ldap_provider_request;
2365
2366    let uri_str = format!("{}/providers/ldap/", configuration.base_path);
2367    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2368
2369    if let Some(ref user_agent) = configuration.user_agent {
2370        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2371    }
2372    if let Some(ref token) = configuration.bearer_access_token {
2373        req_builder = req_builder.bearer_auth(token.to_owned());
2374    };
2375    req_builder = req_builder.json(&p_body_ldap_provider_request);
2376
2377    let req = req_builder.build()?;
2378    let resp = configuration.client.execute(req).await?;
2379
2380    let status = resp.status();
2381    let content_type = resp
2382        .headers()
2383        .get("content-type")
2384        .and_then(|v| v.to_str().ok())
2385        .unwrap_or("application/octet-stream");
2386    let content_type = super::ContentType::from(content_type);
2387
2388    if !status.is_client_error() && !status.is_server_error() {
2389        let content = resp.text().await?;
2390        match content_type {
2391            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2392            ContentType::Text => {
2393                return Err(Error::from(serde_json::Error::custom(
2394                    "Received `text/plain` content type response that cannot be converted to `models::LdapProvider`",
2395                )))
2396            }
2397            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
2398                "Received `{unknown_type}` content type response that cannot be converted to `models::LdapProvider`"
2399            )))),
2400        }
2401    } else {
2402        let content = resp.text().await?;
2403        let entity: Option<ProvidersLdapCreateError> = serde_json::from_str(&content).ok();
2404        Err(Error::ResponseError(ResponseContent {
2405            status,
2406            content,
2407            entity,
2408        }))
2409    }
2410}
2411
2412/// LDAPProvider Viewset
2413pub async fn providers_ldap_destroy(
2414    configuration: &configuration::Configuration,
2415    id: i32,
2416) -> Result<(), Error<ProvidersLdapDestroyError>> {
2417    // add a prefix to parameters to efficiently prevent name collisions
2418    let p_path_id = id;
2419
2420    let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
2421    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2422
2423    if let Some(ref user_agent) = configuration.user_agent {
2424        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2425    }
2426    if let Some(ref token) = configuration.bearer_access_token {
2427        req_builder = req_builder.bearer_auth(token.to_owned());
2428    };
2429
2430    let req = req_builder.build()?;
2431    let resp = configuration.client.execute(req).await?;
2432
2433    let status = resp.status();
2434
2435    if !status.is_client_error() && !status.is_server_error() {
2436        Ok(())
2437    } else {
2438        let content = resp.text().await?;
2439        let entity: Option<ProvidersLdapDestroyError> = serde_json::from_str(&content).ok();
2440        Err(Error::ResponseError(ResponseContent {
2441            status,
2442            content,
2443            entity,
2444        }))
2445    }
2446}
2447
2448/// LDAPProvider Viewset
2449pub async fn providers_ldap_list(
2450    configuration: &configuration::Configuration,
2451    application__isnull: Option<bool>,
2452    authorization_flow__slug__iexact: Option<&str>,
2453    base_dn__iexact: Option<&str>,
2454    certificate__kp_uuid__iexact: Option<&str>,
2455    certificate__name__iexact: Option<&str>,
2456    gid_start_number__iexact: Option<i32>,
2457    name__iexact: Option<&str>,
2458    ordering: Option<&str>,
2459    page: Option<i32>,
2460    page_size: Option<i32>,
2461    search: Option<&str>,
2462    tls_server_name__iexact: Option<&str>,
2463    uid_start_number__iexact: Option<i32>,
2464) -> Result<models::PaginatedLdapProviderList, Error<ProvidersLdapListError>> {
2465    // add a prefix to parameters to efficiently prevent name collisions
2466    let p_query_application__isnull = application__isnull;
2467    let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact;
2468    let p_query_base_dn__iexact = base_dn__iexact;
2469    let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact;
2470    let p_query_certificate__name__iexact = certificate__name__iexact;
2471    let p_query_gid_start_number__iexact = gid_start_number__iexact;
2472    let p_query_name__iexact = name__iexact;
2473    let p_query_ordering = ordering;
2474    let p_query_page = page;
2475    let p_query_page_size = page_size;
2476    let p_query_search = search;
2477    let p_query_tls_server_name__iexact = tls_server_name__iexact;
2478    let p_query_uid_start_number__iexact = uid_start_number__iexact;
2479
2480    let uri_str = format!("{}/providers/ldap/", configuration.base_path);
2481    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2482
2483    if let Some(ref param_value) = p_query_application__isnull {
2484        req_builder = req_builder.query(&[("application__isnull", &param_value.to_string())]);
2485    }
2486    if let Some(ref param_value) = p_query_authorization_flow__slug__iexact {
2487        req_builder = req_builder.query(&[("authorization_flow__slug__iexact", &param_value.to_string())]);
2488    }
2489    if let Some(ref param_value) = p_query_base_dn__iexact {
2490        req_builder = req_builder.query(&[("base_dn__iexact", &param_value.to_string())]);
2491    }
2492    if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact {
2493        req_builder = req_builder.query(&[("certificate__kp_uuid__iexact", &param_value.to_string())]);
2494    }
2495    if let Some(ref param_value) = p_query_certificate__name__iexact {
2496        req_builder = req_builder.query(&[("certificate__name__iexact", &param_value.to_string())]);
2497    }
2498    if let Some(ref param_value) = p_query_gid_start_number__iexact {
2499        req_builder = req_builder.query(&[("gid_start_number__iexact", &param_value.to_string())]);
2500    }
2501    if let Some(ref param_value) = p_query_name__iexact {
2502        req_builder = req_builder.query(&[("name__iexact", &param_value.to_string())]);
2503    }
2504    if let Some(ref param_value) = p_query_ordering {
2505        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2506    }
2507    if let Some(ref param_value) = p_query_page {
2508        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2509    }
2510    if let Some(ref param_value) = p_query_page_size {
2511        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2512    }
2513    if let Some(ref param_value) = p_query_search {
2514        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2515    }
2516    if let Some(ref param_value) = p_query_tls_server_name__iexact {
2517        req_builder = req_builder.query(&[("tls_server_name__iexact", &param_value.to_string())]);
2518    }
2519    if let Some(ref param_value) = p_query_uid_start_number__iexact {
2520        req_builder = req_builder.query(&[("uid_start_number__iexact", &param_value.to_string())]);
2521    }
2522    if let Some(ref user_agent) = configuration.user_agent {
2523        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2524    }
2525    if let Some(ref token) = configuration.bearer_access_token {
2526        req_builder = req_builder.bearer_auth(token.to_owned());
2527    };
2528
2529    let req = req_builder.build()?;
2530    let resp = configuration.client.execute(req).await?;
2531
2532    let status = resp.status();
2533    let content_type = resp
2534        .headers()
2535        .get("content-type")
2536        .and_then(|v| v.to_str().ok())
2537        .unwrap_or("application/octet-stream");
2538    let content_type = super::ContentType::from(content_type);
2539
2540    if !status.is_client_error() && !status.is_server_error() {
2541        let content = resp.text().await?;
2542        match content_type {
2543            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2544            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapProviderList`"))),
2545            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedLdapProviderList`")))),
2546        }
2547    } else {
2548        let content = resp.text().await?;
2549        let entity: Option<ProvidersLdapListError> = serde_json::from_str(&content).ok();
2550        Err(Error::ResponseError(ResponseContent {
2551            status,
2552            content,
2553            entity,
2554        }))
2555    }
2556}
2557
2558/// LDAPProvider Viewset
2559pub async fn providers_ldap_partial_update(
2560    configuration: &configuration::Configuration,
2561    id: i32,
2562    patched_ldap_provider_request: Option<models::PatchedLdapProviderRequest>,
2563) -> Result<models::LdapProvider, Error<ProvidersLdapPartialUpdateError>> {
2564    // add a prefix to parameters to efficiently prevent name collisions
2565    let p_path_id = id;
2566    let p_body_patched_ldap_provider_request = patched_ldap_provider_request;
2567
2568    let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
2569    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2570
2571    if let Some(ref user_agent) = configuration.user_agent {
2572        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2573    }
2574    if let Some(ref token) = configuration.bearer_access_token {
2575        req_builder = req_builder.bearer_auth(token.to_owned());
2576    };
2577    req_builder = req_builder.json(&p_body_patched_ldap_provider_request);
2578
2579    let req = req_builder.build()?;
2580    let resp = configuration.client.execute(req).await?;
2581
2582    let status = resp.status();
2583    let content_type = resp
2584        .headers()
2585        .get("content-type")
2586        .and_then(|v| v.to_str().ok())
2587        .unwrap_or("application/octet-stream");
2588    let content_type = super::ContentType::from(content_type);
2589
2590    if !status.is_client_error() && !status.is_server_error() {
2591        let content = resp.text().await?;
2592        match content_type {
2593            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2594            ContentType::Text => {
2595                return Err(Error::from(serde_json::Error::custom(
2596                    "Received `text/plain` content type response that cannot be converted to `models::LdapProvider`",
2597                )))
2598            }
2599            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
2600                "Received `{unknown_type}` content type response that cannot be converted to `models::LdapProvider`"
2601            )))),
2602        }
2603    } else {
2604        let content = resp.text().await?;
2605        let entity: Option<ProvidersLdapPartialUpdateError> = serde_json::from_str(&content).ok();
2606        Err(Error::ResponseError(ResponseContent {
2607            status,
2608            content,
2609            entity,
2610        }))
2611    }
2612}
2613
2614/// LDAPProvider Viewset
2615pub async fn providers_ldap_retrieve(
2616    configuration: &configuration::Configuration,
2617    id: i32,
2618) -> Result<models::LdapProvider, Error<ProvidersLdapRetrieveError>> {
2619    // add a prefix to parameters to efficiently prevent name collisions
2620    let p_path_id = id;
2621
2622    let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
2623    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2624
2625    if let Some(ref user_agent) = configuration.user_agent {
2626        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2627    }
2628    if let Some(ref token) = configuration.bearer_access_token {
2629        req_builder = req_builder.bearer_auth(token.to_owned());
2630    };
2631
2632    let req = req_builder.build()?;
2633    let resp = configuration.client.execute(req).await?;
2634
2635    let status = resp.status();
2636    let content_type = resp
2637        .headers()
2638        .get("content-type")
2639        .and_then(|v| v.to_str().ok())
2640        .unwrap_or("application/octet-stream");
2641    let content_type = super::ContentType::from(content_type);
2642
2643    if !status.is_client_error() && !status.is_server_error() {
2644        let content = resp.text().await?;
2645        match content_type {
2646            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2647            ContentType::Text => {
2648                return Err(Error::from(serde_json::Error::custom(
2649                    "Received `text/plain` content type response that cannot be converted to `models::LdapProvider`",
2650                )))
2651            }
2652            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
2653                "Received `{unknown_type}` content type response that cannot be converted to `models::LdapProvider`"
2654            )))),
2655        }
2656    } else {
2657        let content = resp.text().await?;
2658        let entity: Option<ProvidersLdapRetrieveError> = serde_json::from_str(&content).ok();
2659        Err(Error::ResponseError(ResponseContent {
2660            status,
2661            content,
2662            entity,
2663        }))
2664    }
2665}
2666
2667/// LDAPProvider Viewset
2668pub async fn providers_ldap_update(
2669    configuration: &configuration::Configuration,
2670    id: i32,
2671    ldap_provider_request: models::LdapProviderRequest,
2672) -> Result<models::LdapProvider, Error<ProvidersLdapUpdateError>> {
2673    // add a prefix to parameters to efficiently prevent name collisions
2674    let p_path_id = id;
2675    let p_body_ldap_provider_request = ldap_provider_request;
2676
2677    let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
2678    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2679
2680    if let Some(ref user_agent) = configuration.user_agent {
2681        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2682    }
2683    if let Some(ref token) = configuration.bearer_access_token {
2684        req_builder = req_builder.bearer_auth(token.to_owned());
2685    };
2686    req_builder = req_builder.json(&p_body_ldap_provider_request);
2687
2688    let req = req_builder.build()?;
2689    let resp = configuration.client.execute(req).await?;
2690
2691    let status = resp.status();
2692    let content_type = resp
2693        .headers()
2694        .get("content-type")
2695        .and_then(|v| v.to_str().ok())
2696        .unwrap_or("application/octet-stream");
2697    let content_type = super::ContentType::from(content_type);
2698
2699    if !status.is_client_error() && !status.is_server_error() {
2700        let content = resp.text().await?;
2701        match content_type {
2702            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2703            ContentType::Text => {
2704                return Err(Error::from(serde_json::Error::custom(
2705                    "Received `text/plain` content type response that cannot be converted to `models::LdapProvider`",
2706                )))
2707            }
2708            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
2709                "Received `{unknown_type}` content type response that cannot be converted to `models::LdapProvider`"
2710            )))),
2711        }
2712    } else {
2713        let content = resp.text().await?;
2714        let entity: Option<ProvidersLdapUpdateError> = serde_json::from_str(&content).ok();
2715        Err(Error::ResponseError(ResponseContent {
2716            status,
2717            content,
2718            entity,
2719        }))
2720    }
2721}
2722
2723/// Get a list of all objects that use this object
2724pub async fn providers_ldap_used_by_list(
2725    configuration: &configuration::Configuration,
2726    id: i32,
2727) -> Result<Vec<models::UsedBy>, Error<ProvidersLdapUsedByListError>> {
2728    // add a prefix to parameters to efficiently prevent name collisions
2729    let p_path_id = id;
2730
2731    let uri_str = format!(
2732        "{}/providers/ldap/{id}/used_by/",
2733        configuration.base_path,
2734        id = p_path_id
2735    );
2736    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2737
2738    if let Some(ref user_agent) = configuration.user_agent {
2739        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2740    }
2741    if let Some(ref token) = configuration.bearer_access_token {
2742        req_builder = req_builder.bearer_auth(token.to_owned());
2743    };
2744
2745    let req = req_builder.build()?;
2746    let resp = configuration.client.execute(req).await?;
2747
2748    let status = resp.status();
2749    let content_type = resp
2750        .headers()
2751        .get("content-type")
2752        .and_then(|v| v.to_str().ok())
2753        .unwrap_or("application/octet-stream");
2754    let content_type = super::ContentType::from(content_type);
2755
2756    if !status.is_client_error() && !status.is_server_error() {
2757        let content = resp.text().await?;
2758        match content_type {
2759            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2760            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
2761            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
2762        }
2763    } else {
2764        let content = resp.text().await?;
2765        let entity: Option<ProvidersLdapUsedByListError> = serde_json::from_str(&content).ok();
2766        Err(Error::ResponseError(ResponseContent {
2767            status,
2768            content,
2769            entity,
2770        }))
2771    }
2772}
2773
2774/// MicrosoftEntraProvider Viewset
2775pub async fn providers_microsoft_entra_create(
2776    configuration: &configuration::Configuration,
2777    microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest,
2778) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraCreateError>> {
2779    // add a prefix to parameters to efficiently prevent name collisions
2780    let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request;
2781
2782    let uri_str = format!("{}/providers/microsoft_entra/", configuration.base_path);
2783    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2784
2785    if let Some(ref user_agent) = configuration.user_agent {
2786        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2787    }
2788    if let Some(ref token) = configuration.bearer_access_token {
2789        req_builder = req_builder.bearer_auth(token.to_owned());
2790    };
2791    req_builder = req_builder.json(&p_body_microsoft_entra_provider_request);
2792
2793    let req = req_builder.build()?;
2794    let resp = configuration.client.execute(req).await?;
2795
2796    let status = resp.status();
2797    let content_type = resp
2798        .headers()
2799        .get("content-type")
2800        .and_then(|v| v.to_str().ok())
2801        .unwrap_or("application/octet-stream");
2802    let content_type = super::ContentType::from(content_type);
2803
2804    if !status.is_client_error() && !status.is_server_error() {
2805        let content = resp.text().await?;
2806        match content_type {
2807            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2808            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProvider`"))),
2809            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProvider`")))),
2810        }
2811    } else {
2812        let content = resp.text().await?;
2813        let entity: Option<ProvidersMicrosoftEntraCreateError> = serde_json::from_str(&content).ok();
2814        Err(Error::ResponseError(ResponseContent {
2815            status,
2816            content,
2817            entity,
2818        }))
2819    }
2820}
2821
2822/// MicrosoftEntraProvider Viewset
2823pub async fn providers_microsoft_entra_destroy(
2824    configuration: &configuration::Configuration,
2825    id: i32,
2826) -> Result<(), Error<ProvidersMicrosoftEntraDestroyError>> {
2827    // add a prefix to parameters to efficiently prevent name collisions
2828    let p_path_id = id;
2829
2830    let uri_str = format!(
2831        "{}/providers/microsoft_entra/{id}/",
2832        configuration.base_path,
2833        id = p_path_id
2834    );
2835    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2836
2837    if let Some(ref user_agent) = configuration.user_agent {
2838        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2839    }
2840    if let Some(ref token) = configuration.bearer_access_token {
2841        req_builder = req_builder.bearer_auth(token.to_owned());
2842    };
2843
2844    let req = req_builder.build()?;
2845    let resp = configuration.client.execute(req).await?;
2846
2847    let status = resp.status();
2848
2849    if !status.is_client_error() && !status.is_server_error() {
2850        Ok(())
2851    } else {
2852        let content = resp.text().await?;
2853        let entity: Option<ProvidersMicrosoftEntraDestroyError> = serde_json::from_str(&content).ok();
2854        Err(Error::ResponseError(ResponseContent {
2855            status,
2856            content,
2857            entity,
2858        }))
2859    }
2860}
2861
2862/// MicrosoftEntraProviderGroup Viewset
2863pub async fn providers_microsoft_entra_groups_create(
2864    configuration: &configuration::Configuration,
2865    microsoft_entra_provider_group_request: models::MicrosoftEntraProviderGroupRequest,
2866) -> Result<models::MicrosoftEntraProviderGroup, Error<ProvidersMicrosoftEntraGroupsCreateError>> {
2867    // add a prefix to parameters to efficiently prevent name collisions
2868    let p_body_microsoft_entra_provider_group_request = microsoft_entra_provider_group_request;
2869
2870    let uri_str = format!("{}/providers/microsoft_entra_groups/", configuration.base_path);
2871    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2872
2873    if let Some(ref user_agent) = configuration.user_agent {
2874        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2875    }
2876    if let Some(ref token) = configuration.bearer_access_token {
2877        req_builder = req_builder.bearer_auth(token.to_owned());
2878    };
2879    req_builder = req_builder.json(&p_body_microsoft_entra_provider_group_request);
2880
2881    let req = req_builder.build()?;
2882    let resp = configuration.client.execute(req).await?;
2883
2884    let status = resp.status();
2885    let content_type = resp
2886        .headers()
2887        .get("content-type")
2888        .and_then(|v| v.to_str().ok())
2889        .unwrap_or("application/octet-stream");
2890    let content_type = super::ContentType::from(content_type);
2891
2892    if !status.is_client_error() && !status.is_server_error() {
2893        let content = resp.text().await?;
2894        match content_type {
2895            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2896            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderGroup`"))),
2897            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderGroup`")))),
2898        }
2899    } else {
2900        let content = resp.text().await?;
2901        let entity: Option<ProvidersMicrosoftEntraGroupsCreateError> = serde_json::from_str(&content).ok();
2902        Err(Error::ResponseError(ResponseContent {
2903            status,
2904            content,
2905            entity,
2906        }))
2907    }
2908}
2909
2910/// MicrosoftEntraProviderGroup Viewset
2911pub async fn providers_microsoft_entra_groups_destroy(
2912    configuration: &configuration::Configuration,
2913    id: &str,
2914) -> Result<(), Error<ProvidersMicrosoftEntraGroupsDestroyError>> {
2915    // add a prefix to parameters to efficiently prevent name collisions
2916    let p_path_id = id;
2917
2918    let uri_str = format!(
2919        "{}/providers/microsoft_entra_groups/{id}/",
2920        configuration.base_path,
2921        id = crate::apis::urlencode(p_path_id)
2922    );
2923    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2924
2925    if let Some(ref user_agent) = configuration.user_agent {
2926        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2927    }
2928    if let Some(ref token) = configuration.bearer_access_token {
2929        req_builder = req_builder.bearer_auth(token.to_owned());
2930    };
2931
2932    let req = req_builder.build()?;
2933    let resp = configuration.client.execute(req).await?;
2934
2935    let status = resp.status();
2936
2937    if !status.is_client_error() && !status.is_server_error() {
2938        Ok(())
2939    } else {
2940        let content = resp.text().await?;
2941        let entity: Option<ProvidersMicrosoftEntraGroupsDestroyError> = serde_json::from_str(&content).ok();
2942        Err(Error::ResponseError(ResponseContent {
2943            status,
2944            content,
2945            entity,
2946        }))
2947    }
2948}
2949
2950/// MicrosoftEntraProviderGroup Viewset
2951pub async fn providers_microsoft_entra_groups_list(
2952    configuration: &configuration::Configuration,
2953    group__group_uuid: Option<&str>,
2954    group__name: Option<&str>,
2955    ordering: Option<&str>,
2956    page: Option<i32>,
2957    page_size: Option<i32>,
2958    provider__id: Option<i32>,
2959    search: Option<&str>,
2960) -> Result<models::PaginatedMicrosoftEntraProviderGroupList, Error<ProvidersMicrosoftEntraGroupsListError>> {
2961    // add a prefix to parameters to efficiently prevent name collisions
2962    let p_query_group__group_uuid = group__group_uuid;
2963    let p_query_group__name = group__name;
2964    let p_query_ordering = ordering;
2965    let p_query_page = page;
2966    let p_query_page_size = page_size;
2967    let p_query_provider__id = provider__id;
2968    let p_query_search = search;
2969
2970    let uri_str = format!("{}/providers/microsoft_entra_groups/", configuration.base_path);
2971    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2972
2973    if let Some(ref param_value) = p_query_group__group_uuid {
2974        req_builder = req_builder.query(&[("group__group_uuid", &param_value.to_string())]);
2975    }
2976    if let Some(ref param_value) = p_query_group__name {
2977        req_builder = req_builder.query(&[("group__name", &param_value.to_string())]);
2978    }
2979    if let Some(ref param_value) = p_query_ordering {
2980        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2981    }
2982    if let Some(ref param_value) = p_query_page {
2983        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2984    }
2985    if let Some(ref param_value) = p_query_page_size {
2986        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2987    }
2988    if let Some(ref param_value) = p_query_provider__id {
2989        req_builder = req_builder.query(&[("provider__id", &param_value.to_string())]);
2990    }
2991    if let Some(ref param_value) = p_query_search {
2992        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2993    }
2994    if let Some(ref user_agent) = configuration.user_agent {
2995        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2996    }
2997    if let Some(ref token) = configuration.bearer_access_token {
2998        req_builder = req_builder.bearer_auth(token.to_owned());
2999    };
3000
3001    let req = req_builder.build()?;
3002    let resp = configuration.client.execute(req).await?;
3003
3004    let status = resp.status();
3005    let content_type = resp
3006        .headers()
3007        .get("content-type")
3008        .and_then(|v| v.to_str().ok())
3009        .unwrap_or("application/octet-stream");
3010    let content_type = super::ContentType::from(content_type);
3011
3012    if !status.is_client_error() && !status.is_server_error() {
3013        let content = resp.text().await?;
3014        match content_type {
3015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3016            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderGroupList`"))),
3017            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderGroupList`")))),
3018        }
3019    } else {
3020        let content = resp.text().await?;
3021        let entity: Option<ProvidersMicrosoftEntraGroupsListError> = serde_json::from_str(&content).ok();
3022        Err(Error::ResponseError(ResponseContent {
3023            status,
3024            content,
3025            entity,
3026        }))
3027    }
3028}
3029
3030/// MicrosoftEntraProviderGroup Viewset
3031pub async fn providers_microsoft_entra_groups_retrieve(
3032    configuration: &configuration::Configuration,
3033    id: &str,
3034) -> Result<models::MicrosoftEntraProviderGroup, Error<ProvidersMicrosoftEntraGroupsRetrieveError>> {
3035    // add a prefix to parameters to efficiently prevent name collisions
3036    let p_path_id = id;
3037
3038    let uri_str = format!(
3039        "{}/providers/microsoft_entra_groups/{id}/",
3040        configuration.base_path,
3041        id = crate::apis::urlencode(p_path_id)
3042    );
3043    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3044
3045    if let Some(ref user_agent) = configuration.user_agent {
3046        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3047    }
3048    if let Some(ref token) = configuration.bearer_access_token {
3049        req_builder = req_builder.bearer_auth(token.to_owned());
3050    };
3051
3052    let req = req_builder.build()?;
3053    let resp = configuration.client.execute(req).await?;
3054
3055    let status = resp.status();
3056    let content_type = resp
3057        .headers()
3058        .get("content-type")
3059        .and_then(|v| v.to_str().ok())
3060        .unwrap_or("application/octet-stream");
3061    let content_type = super::ContentType::from(content_type);
3062
3063    if !status.is_client_error() && !status.is_server_error() {
3064        let content = resp.text().await?;
3065        match content_type {
3066            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3067            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderGroup`"))),
3068            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderGroup`")))),
3069        }
3070    } else {
3071        let content = resp.text().await?;
3072        let entity: Option<ProvidersMicrosoftEntraGroupsRetrieveError> = serde_json::from_str(&content).ok();
3073        Err(Error::ResponseError(ResponseContent {
3074            status,
3075            content,
3076            entity,
3077        }))
3078    }
3079}
3080
3081/// Get a list of all objects that use this object
3082pub async fn providers_microsoft_entra_groups_used_by_list(
3083    configuration: &configuration::Configuration,
3084    id: &str,
3085) -> Result<Vec<models::UsedBy>, Error<ProvidersMicrosoftEntraGroupsUsedByListError>> {
3086    // add a prefix to parameters to efficiently prevent name collisions
3087    let p_path_id = id;
3088
3089    let uri_str = format!(
3090        "{}/providers/microsoft_entra_groups/{id}/used_by/",
3091        configuration.base_path,
3092        id = crate::apis::urlencode(p_path_id)
3093    );
3094    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3095
3096    if let Some(ref user_agent) = configuration.user_agent {
3097        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3098    }
3099    if let Some(ref token) = configuration.bearer_access_token {
3100        req_builder = req_builder.bearer_auth(token.to_owned());
3101    };
3102
3103    let req = req_builder.build()?;
3104    let resp = configuration.client.execute(req).await?;
3105
3106    let status = resp.status();
3107    let content_type = resp
3108        .headers()
3109        .get("content-type")
3110        .and_then(|v| v.to_str().ok())
3111        .unwrap_or("application/octet-stream");
3112    let content_type = super::ContentType::from(content_type);
3113
3114    if !status.is_client_error() && !status.is_server_error() {
3115        let content = resp.text().await?;
3116        match content_type {
3117            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3118            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
3119            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
3120        }
3121    } else {
3122        let content = resp.text().await?;
3123        let entity: Option<ProvidersMicrosoftEntraGroupsUsedByListError> = serde_json::from_str(&content).ok();
3124        Err(Error::ResponseError(ResponseContent {
3125            status,
3126            content,
3127            entity,
3128        }))
3129    }
3130}
3131
3132/// MicrosoftEntraProvider Viewset
3133pub async fn providers_microsoft_entra_list(
3134    configuration: &configuration::Configuration,
3135    exclude_users_service_account: Option<bool>,
3136    filter_group: Option<&str>,
3137    name: Option<&str>,
3138    ordering: Option<&str>,
3139    page: Option<i32>,
3140    page_size: Option<i32>,
3141    search: Option<&str>,
3142) -> Result<models::PaginatedMicrosoftEntraProviderList, Error<ProvidersMicrosoftEntraListError>> {
3143    // add a prefix to parameters to efficiently prevent name collisions
3144    let p_query_exclude_users_service_account = exclude_users_service_account;
3145    let p_query_filter_group = filter_group;
3146    let p_query_name = name;
3147    let p_query_ordering = ordering;
3148    let p_query_page = page;
3149    let p_query_page_size = page_size;
3150    let p_query_search = search;
3151
3152    let uri_str = format!("{}/providers/microsoft_entra/", configuration.base_path);
3153    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3154
3155    if let Some(ref param_value) = p_query_exclude_users_service_account {
3156        req_builder = req_builder.query(&[("exclude_users_service_account", &param_value.to_string())]);
3157    }
3158    if let Some(ref param_value) = p_query_filter_group {
3159        req_builder = req_builder.query(&[("filter_group", &param_value.to_string())]);
3160    }
3161    if let Some(ref param_value) = p_query_name {
3162        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
3163    }
3164    if let Some(ref param_value) = p_query_ordering {
3165        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3166    }
3167    if let Some(ref param_value) = p_query_page {
3168        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3169    }
3170    if let Some(ref param_value) = p_query_page_size {
3171        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3172    }
3173    if let Some(ref param_value) = p_query_search {
3174        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3175    }
3176    if let Some(ref user_agent) = configuration.user_agent {
3177        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3178    }
3179    if let Some(ref token) = configuration.bearer_access_token {
3180        req_builder = req_builder.bearer_auth(token.to_owned());
3181    };
3182
3183    let req = req_builder.build()?;
3184    let resp = configuration.client.execute(req).await?;
3185
3186    let status = resp.status();
3187    let content_type = resp
3188        .headers()
3189        .get("content-type")
3190        .and_then(|v| v.to_str().ok())
3191        .unwrap_or("application/octet-stream");
3192    let content_type = super::ContentType::from(content_type);
3193
3194    if !status.is_client_error() && !status.is_server_error() {
3195        let content = resp.text().await?;
3196        match content_type {
3197            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3198            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderList`"))),
3199            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderList`")))),
3200        }
3201    } else {
3202        let content = resp.text().await?;
3203        let entity: Option<ProvidersMicrosoftEntraListError> = serde_json::from_str(&content).ok();
3204        Err(Error::ResponseError(ResponseContent {
3205            status,
3206            content,
3207            entity,
3208        }))
3209    }
3210}
3211
3212/// MicrosoftEntraProvider Viewset
3213pub async fn providers_microsoft_entra_partial_update(
3214    configuration: &configuration::Configuration,
3215    id: i32,
3216    patched_microsoft_entra_provider_request: Option<models::PatchedMicrosoftEntraProviderRequest>,
3217) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraPartialUpdateError>> {
3218    // add a prefix to parameters to efficiently prevent name collisions
3219    let p_path_id = id;
3220    let p_body_patched_microsoft_entra_provider_request = patched_microsoft_entra_provider_request;
3221
3222    let uri_str = format!(
3223        "{}/providers/microsoft_entra/{id}/",
3224        configuration.base_path,
3225        id = p_path_id
3226    );
3227    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3228
3229    if let Some(ref user_agent) = configuration.user_agent {
3230        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3231    }
3232    if let Some(ref token) = configuration.bearer_access_token {
3233        req_builder = req_builder.bearer_auth(token.to_owned());
3234    };
3235    req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_request);
3236
3237    let req = req_builder.build()?;
3238    let resp = configuration.client.execute(req).await?;
3239
3240    let status = resp.status();
3241    let content_type = resp
3242        .headers()
3243        .get("content-type")
3244        .and_then(|v| v.to_str().ok())
3245        .unwrap_or("application/octet-stream");
3246    let content_type = super::ContentType::from(content_type);
3247
3248    if !status.is_client_error() && !status.is_server_error() {
3249        let content = resp.text().await?;
3250        match content_type {
3251            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3252            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProvider`"))),
3253            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProvider`")))),
3254        }
3255    } else {
3256        let content = resp.text().await?;
3257        let entity: Option<ProvidersMicrosoftEntraPartialUpdateError> = serde_json::from_str(&content).ok();
3258        Err(Error::ResponseError(ResponseContent {
3259            status,
3260            content,
3261            entity,
3262        }))
3263    }
3264}
3265
3266/// MicrosoftEntraProvider Viewset
3267pub async fn providers_microsoft_entra_retrieve(
3268    configuration: &configuration::Configuration,
3269    id: i32,
3270) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraRetrieveError>> {
3271    // add a prefix to parameters to efficiently prevent name collisions
3272    let p_path_id = id;
3273
3274    let uri_str = format!(
3275        "{}/providers/microsoft_entra/{id}/",
3276        configuration.base_path,
3277        id = p_path_id
3278    );
3279    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3280
3281    if let Some(ref user_agent) = configuration.user_agent {
3282        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3283    }
3284    if let Some(ref token) = configuration.bearer_access_token {
3285        req_builder = req_builder.bearer_auth(token.to_owned());
3286    };
3287
3288    let req = req_builder.build()?;
3289    let resp = configuration.client.execute(req).await?;
3290
3291    let status = resp.status();
3292    let content_type = resp
3293        .headers()
3294        .get("content-type")
3295        .and_then(|v| v.to_str().ok())
3296        .unwrap_or("application/octet-stream");
3297    let content_type = super::ContentType::from(content_type);
3298
3299    if !status.is_client_error() && !status.is_server_error() {
3300        let content = resp.text().await?;
3301        match content_type {
3302            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3303            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProvider`"))),
3304            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProvider`")))),
3305        }
3306    } else {
3307        let content = resp.text().await?;
3308        let entity: Option<ProvidersMicrosoftEntraRetrieveError> = serde_json::from_str(&content).ok();
3309        Err(Error::ResponseError(ResponseContent {
3310            status,
3311            content,
3312            entity,
3313        }))
3314    }
3315}
3316
3317/// Sync/Re-sync a single user/group object
3318pub async fn providers_microsoft_entra_sync_object_create(
3319    configuration: &configuration::Configuration,
3320    id: i32,
3321    sync_object_request: models::SyncObjectRequest,
3322) -> Result<models::SyncObjectResult, Error<ProvidersMicrosoftEntraSyncObjectCreateError>> {
3323    // add a prefix to parameters to efficiently prevent name collisions
3324    let p_path_id = id;
3325    let p_body_sync_object_request = sync_object_request;
3326
3327    let uri_str = format!(
3328        "{}/providers/microsoft_entra/{id}/sync/object/",
3329        configuration.base_path,
3330        id = p_path_id
3331    );
3332    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3333
3334    if let Some(ref user_agent) = configuration.user_agent {
3335        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3336    }
3337    if let Some(ref token) = configuration.bearer_access_token {
3338        req_builder = req_builder.bearer_auth(token.to_owned());
3339    };
3340    req_builder = req_builder.json(&p_body_sync_object_request);
3341
3342    let req = req_builder.build()?;
3343    let resp = configuration.client.execute(req).await?;
3344
3345    let status = resp.status();
3346    let content_type = resp
3347        .headers()
3348        .get("content-type")
3349        .and_then(|v| v.to_str().ok())
3350        .unwrap_or("application/octet-stream");
3351    let content_type = super::ContentType::from(content_type);
3352
3353    if !status.is_client_error() && !status.is_server_error() {
3354        let content = resp.text().await?;
3355        match content_type {
3356            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3357            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncObjectResult`"))),
3358            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncObjectResult`")))),
3359        }
3360    } else {
3361        let content = resp.text().await?;
3362        let entity: Option<ProvidersMicrosoftEntraSyncObjectCreateError> = serde_json::from_str(&content).ok();
3363        Err(Error::ResponseError(ResponseContent {
3364            status,
3365            content,
3366            entity,
3367        }))
3368    }
3369}
3370
3371/// Get provider's sync status
3372pub async fn providers_microsoft_entra_sync_status_retrieve(
3373    configuration: &configuration::Configuration,
3374    id: i32,
3375) -> Result<models::SyncStatus, Error<ProvidersMicrosoftEntraSyncStatusRetrieveError>> {
3376    // add a prefix to parameters to efficiently prevent name collisions
3377    let p_path_id = id;
3378
3379    let uri_str = format!(
3380        "{}/providers/microsoft_entra/{id}/sync/status/",
3381        configuration.base_path,
3382        id = p_path_id
3383    );
3384    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3385
3386    if let Some(ref user_agent) = configuration.user_agent {
3387        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3388    }
3389    if let Some(ref token) = configuration.bearer_access_token {
3390        req_builder = req_builder.bearer_auth(token.to_owned());
3391    };
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 => {
3409                return Err(Error::from(serde_json::Error::custom(
3410                    "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
3411                )))
3412            }
3413            ContentType::Unsupported(unknown_type) => {
3414                return Err(Error::from(serde_json::Error::custom(format!(
3415                    "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
3416                ))))
3417            }
3418        }
3419    } else {
3420        let content = resp.text().await?;
3421        let entity: Option<ProvidersMicrosoftEntraSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
3422        Err(Error::ResponseError(ResponseContent {
3423            status,
3424            content,
3425            entity,
3426        }))
3427    }
3428}
3429
3430/// MicrosoftEntraProvider Viewset
3431pub async fn providers_microsoft_entra_update(
3432    configuration: &configuration::Configuration,
3433    id: i32,
3434    microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest,
3435) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraUpdateError>> {
3436    // add a prefix to parameters to efficiently prevent name collisions
3437    let p_path_id = id;
3438    let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request;
3439
3440    let uri_str = format!(
3441        "{}/providers/microsoft_entra/{id}/",
3442        configuration.base_path,
3443        id = p_path_id
3444    );
3445    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3446
3447    if let Some(ref user_agent) = configuration.user_agent {
3448        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3449    }
3450    if let Some(ref token) = configuration.bearer_access_token {
3451        req_builder = req_builder.bearer_auth(token.to_owned());
3452    };
3453    req_builder = req_builder.json(&p_body_microsoft_entra_provider_request);
3454
3455    let req = req_builder.build()?;
3456    let resp = configuration.client.execute(req).await?;
3457
3458    let status = resp.status();
3459    let content_type = resp
3460        .headers()
3461        .get("content-type")
3462        .and_then(|v| v.to_str().ok())
3463        .unwrap_or("application/octet-stream");
3464    let content_type = super::ContentType::from(content_type);
3465
3466    if !status.is_client_error() && !status.is_server_error() {
3467        let content = resp.text().await?;
3468        match content_type {
3469            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3470            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProvider`"))),
3471            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProvider`")))),
3472        }
3473    } else {
3474        let content = resp.text().await?;
3475        let entity: Option<ProvidersMicrosoftEntraUpdateError> = serde_json::from_str(&content).ok();
3476        Err(Error::ResponseError(ResponseContent {
3477            status,
3478            content,
3479            entity,
3480        }))
3481    }
3482}
3483
3484/// Get a list of all objects that use this object
3485pub async fn providers_microsoft_entra_used_by_list(
3486    configuration: &configuration::Configuration,
3487    id: i32,
3488) -> Result<Vec<models::UsedBy>, Error<ProvidersMicrosoftEntraUsedByListError>> {
3489    // add a prefix to parameters to efficiently prevent name collisions
3490    let p_path_id = id;
3491
3492    let uri_str = format!(
3493        "{}/providers/microsoft_entra/{id}/used_by/",
3494        configuration.base_path,
3495        id = p_path_id
3496    );
3497    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3498
3499    if let Some(ref user_agent) = configuration.user_agent {
3500        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3501    }
3502    if let Some(ref token) = configuration.bearer_access_token {
3503        req_builder = req_builder.bearer_auth(token.to_owned());
3504    };
3505
3506    let req = req_builder.build()?;
3507    let resp = configuration.client.execute(req).await?;
3508
3509    let status = resp.status();
3510    let content_type = resp
3511        .headers()
3512        .get("content-type")
3513        .and_then(|v| v.to_str().ok())
3514        .unwrap_or("application/octet-stream");
3515    let content_type = super::ContentType::from(content_type);
3516
3517    if !status.is_client_error() && !status.is_server_error() {
3518        let content = resp.text().await?;
3519        match content_type {
3520            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3521            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
3522            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
3523        }
3524    } else {
3525        let content = resp.text().await?;
3526        let entity: Option<ProvidersMicrosoftEntraUsedByListError> = serde_json::from_str(&content).ok();
3527        Err(Error::ResponseError(ResponseContent {
3528            status,
3529            content,
3530            entity,
3531        }))
3532    }
3533}
3534
3535/// MicrosoftEntraProviderUser Viewset
3536pub async fn providers_microsoft_entra_users_create(
3537    configuration: &configuration::Configuration,
3538    microsoft_entra_provider_user_request: models::MicrosoftEntraProviderUserRequest,
3539) -> Result<models::MicrosoftEntraProviderUser, Error<ProvidersMicrosoftEntraUsersCreateError>> {
3540    // add a prefix to parameters to efficiently prevent name collisions
3541    let p_body_microsoft_entra_provider_user_request = microsoft_entra_provider_user_request;
3542
3543    let uri_str = format!("{}/providers/microsoft_entra_users/", configuration.base_path);
3544    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3545
3546    if let Some(ref user_agent) = configuration.user_agent {
3547        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3548    }
3549    if let Some(ref token) = configuration.bearer_access_token {
3550        req_builder = req_builder.bearer_auth(token.to_owned());
3551    };
3552    req_builder = req_builder.json(&p_body_microsoft_entra_provider_user_request);
3553
3554    let req = req_builder.build()?;
3555    let resp = configuration.client.execute(req).await?;
3556
3557    let status = resp.status();
3558    let content_type = resp
3559        .headers()
3560        .get("content-type")
3561        .and_then(|v| v.to_str().ok())
3562        .unwrap_or("application/octet-stream");
3563    let content_type = super::ContentType::from(content_type);
3564
3565    if !status.is_client_error() && !status.is_server_error() {
3566        let content = resp.text().await?;
3567        match content_type {
3568            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3569            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderUser`"))),
3570            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderUser`")))),
3571        }
3572    } else {
3573        let content = resp.text().await?;
3574        let entity: Option<ProvidersMicrosoftEntraUsersCreateError> = serde_json::from_str(&content).ok();
3575        Err(Error::ResponseError(ResponseContent {
3576            status,
3577            content,
3578            entity,
3579        }))
3580    }
3581}
3582
3583/// MicrosoftEntraProviderUser Viewset
3584pub async fn providers_microsoft_entra_users_destroy(
3585    configuration: &configuration::Configuration,
3586    id: &str,
3587) -> Result<(), Error<ProvidersMicrosoftEntraUsersDestroyError>> {
3588    // add a prefix to parameters to efficiently prevent name collisions
3589    let p_path_id = id;
3590
3591    let uri_str = format!(
3592        "{}/providers/microsoft_entra_users/{id}/",
3593        configuration.base_path,
3594        id = crate::apis::urlencode(p_path_id)
3595    );
3596    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3597
3598    if let Some(ref user_agent) = configuration.user_agent {
3599        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3600    }
3601    if let Some(ref token) = configuration.bearer_access_token {
3602        req_builder = req_builder.bearer_auth(token.to_owned());
3603    };
3604
3605    let req = req_builder.build()?;
3606    let resp = configuration.client.execute(req).await?;
3607
3608    let status = resp.status();
3609
3610    if !status.is_client_error() && !status.is_server_error() {
3611        Ok(())
3612    } else {
3613        let content = resp.text().await?;
3614        let entity: Option<ProvidersMicrosoftEntraUsersDestroyError> = serde_json::from_str(&content).ok();
3615        Err(Error::ResponseError(ResponseContent {
3616            status,
3617            content,
3618            entity,
3619        }))
3620    }
3621}
3622
3623/// MicrosoftEntraProviderUser Viewset
3624pub async fn providers_microsoft_entra_users_list(
3625    configuration: &configuration::Configuration,
3626    ordering: Option<&str>,
3627    page: Option<i32>,
3628    page_size: Option<i32>,
3629    provider__id: Option<i32>,
3630    search: Option<&str>,
3631    user__id: Option<i32>,
3632    user__username: Option<&str>,
3633) -> Result<models::PaginatedMicrosoftEntraProviderUserList, Error<ProvidersMicrosoftEntraUsersListError>> {
3634    // add a prefix to parameters to efficiently prevent name collisions
3635    let p_query_ordering = ordering;
3636    let p_query_page = page;
3637    let p_query_page_size = page_size;
3638    let p_query_provider__id = provider__id;
3639    let p_query_search = search;
3640    let p_query_user__id = user__id;
3641    let p_query_user__username = user__username;
3642
3643    let uri_str = format!("{}/providers/microsoft_entra_users/", configuration.base_path);
3644    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3645
3646    if let Some(ref param_value) = p_query_ordering {
3647        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3648    }
3649    if let Some(ref param_value) = p_query_page {
3650        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3651    }
3652    if let Some(ref param_value) = p_query_page_size {
3653        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3654    }
3655    if let Some(ref param_value) = p_query_provider__id {
3656        req_builder = req_builder.query(&[("provider__id", &param_value.to_string())]);
3657    }
3658    if let Some(ref param_value) = p_query_search {
3659        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3660    }
3661    if let Some(ref param_value) = p_query_user__id {
3662        req_builder = req_builder.query(&[("user__id", &param_value.to_string())]);
3663    }
3664    if let Some(ref param_value) = p_query_user__username {
3665        req_builder = req_builder.query(&[("user__username", &param_value.to_string())]);
3666    }
3667    if let Some(ref user_agent) = configuration.user_agent {
3668        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3669    }
3670    if let Some(ref token) = configuration.bearer_access_token {
3671        req_builder = req_builder.bearer_auth(token.to_owned());
3672    };
3673
3674    let req = req_builder.build()?;
3675    let resp = configuration.client.execute(req).await?;
3676
3677    let status = resp.status();
3678    let content_type = resp
3679        .headers()
3680        .get("content-type")
3681        .and_then(|v| v.to_str().ok())
3682        .unwrap_or("application/octet-stream");
3683    let content_type = super::ContentType::from(content_type);
3684
3685    if !status.is_client_error() && !status.is_server_error() {
3686        let content = resp.text().await?;
3687        match content_type {
3688            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3689            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderUserList`"))),
3690            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderUserList`")))),
3691        }
3692    } else {
3693        let content = resp.text().await?;
3694        let entity: Option<ProvidersMicrosoftEntraUsersListError> = serde_json::from_str(&content).ok();
3695        Err(Error::ResponseError(ResponseContent {
3696            status,
3697            content,
3698            entity,
3699        }))
3700    }
3701}
3702
3703/// MicrosoftEntraProviderUser Viewset
3704pub async fn providers_microsoft_entra_users_retrieve(
3705    configuration: &configuration::Configuration,
3706    id: &str,
3707) -> Result<models::MicrosoftEntraProviderUser, Error<ProvidersMicrosoftEntraUsersRetrieveError>> {
3708    // add a prefix to parameters to efficiently prevent name collisions
3709    let p_path_id = id;
3710
3711    let uri_str = format!(
3712        "{}/providers/microsoft_entra_users/{id}/",
3713        configuration.base_path,
3714        id = crate::apis::urlencode(p_path_id)
3715    );
3716    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3717
3718    if let Some(ref user_agent) = configuration.user_agent {
3719        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3720    }
3721    if let Some(ref token) = configuration.bearer_access_token {
3722        req_builder = req_builder.bearer_auth(token.to_owned());
3723    };
3724
3725    let req = req_builder.build()?;
3726    let resp = configuration.client.execute(req).await?;
3727
3728    let status = resp.status();
3729    let content_type = resp
3730        .headers()
3731        .get("content-type")
3732        .and_then(|v| v.to_str().ok())
3733        .unwrap_or("application/octet-stream");
3734    let content_type = super::ContentType::from(content_type);
3735
3736    if !status.is_client_error() && !status.is_server_error() {
3737        let content = resp.text().await?;
3738        match content_type {
3739            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3740            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderUser`"))),
3741            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderUser`")))),
3742        }
3743    } else {
3744        let content = resp.text().await?;
3745        let entity: Option<ProvidersMicrosoftEntraUsersRetrieveError> = serde_json::from_str(&content).ok();
3746        Err(Error::ResponseError(ResponseContent {
3747            status,
3748            content,
3749            entity,
3750        }))
3751    }
3752}
3753
3754/// Get a list of all objects that use this object
3755pub async fn providers_microsoft_entra_users_used_by_list(
3756    configuration: &configuration::Configuration,
3757    id: &str,
3758) -> Result<Vec<models::UsedBy>, Error<ProvidersMicrosoftEntraUsersUsedByListError>> {
3759    // add a prefix to parameters to efficiently prevent name collisions
3760    let p_path_id = id;
3761
3762    let uri_str = format!(
3763        "{}/providers/microsoft_entra_users/{id}/used_by/",
3764        configuration.base_path,
3765        id = crate::apis::urlencode(p_path_id)
3766    );
3767    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3768
3769    if let Some(ref user_agent) = configuration.user_agent {
3770        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3771    }
3772    if let Some(ref token) = configuration.bearer_access_token {
3773        req_builder = req_builder.bearer_auth(token.to_owned());
3774    };
3775
3776    let req = req_builder.build()?;
3777    let resp = configuration.client.execute(req).await?;
3778
3779    let status = resp.status();
3780    let content_type = resp
3781        .headers()
3782        .get("content-type")
3783        .and_then(|v| v.to_str().ok())
3784        .unwrap_or("application/octet-stream");
3785    let content_type = super::ContentType::from(content_type);
3786
3787    if !status.is_client_error() && !status.is_server_error() {
3788        let content = resp.text().await?;
3789        match content_type {
3790            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3791            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
3792            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
3793        }
3794    } else {
3795        let content = resp.text().await?;
3796        let entity: Option<ProvidersMicrosoftEntraUsersUsedByListError> = serde_json::from_str(&content).ok();
3797        Err(Error::ResponseError(ResponseContent {
3798            status,
3799            content,
3800            entity,
3801        }))
3802    }
3803}
3804
3805/// OAuth2Provider Viewset
3806pub async fn providers_oauth2_create(
3807    configuration: &configuration::Configuration,
3808    o_auth2_provider_request: models::OAuth2ProviderRequest,
3809) -> Result<models::OAuth2Provider, Error<ProvidersOauth2CreateError>> {
3810    // add a prefix to parameters to efficiently prevent name collisions
3811    let p_body_o_auth2_provider_request = o_auth2_provider_request;
3812
3813    let uri_str = format!("{}/providers/oauth2/", configuration.base_path);
3814    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3815
3816    if let Some(ref user_agent) = configuration.user_agent {
3817        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3818    }
3819    if let Some(ref token) = configuration.bearer_access_token {
3820        req_builder = req_builder.bearer_auth(token.to_owned());
3821    };
3822    req_builder = req_builder.json(&p_body_o_auth2_provider_request);
3823
3824    let req = req_builder.build()?;
3825    let resp = configuration.client.execute(req).await?;
3826
3827    let status = resp.status();
3828    let content_type = resp
3829        .headers()
3830        .get("content-type")
3831        .and_then(|v| v.to_str().ok())
3832        .unwrap_or("application/octet-stream");
3833    let content_type = super::ContentType::from(content_type);
3834
3835    if !status.is_client_error() && !status.is_server_error() {
3836        let content = resp.text().await?;
3837        match content_type {
3838            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3839            ContentType::Text => {
3840                return Err(Error::from(serde_json::Error::custom(
3841                    "Received `text/plain` content type response that cannot be converted to `models::OAuth2Provider`",
3842                )))
3843            }
3844            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
3845                "Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Provider`"
3846            )))),
3847        }
3848    } else {
3849        let content = resp.text().await?;
3850        let entity: Option<ProvidersOauth2CreateError> = serde_json::from_str(&content).ok();
3851        Err(Error::ResponseError(ResponseContent {
3852            status,
3853            content,
3854            entity,
3855        }))
3856    }
3857}
3858
3859/// OAuth2Provider Viewset
3860pub async fn providers_oauth2_destroy(
3861    configuration: &configuration::Configuration,
3862    id: i32,
3863) -> Result<(), Error<ProvidersOauth2DestroyError>> {
3864    // add a prefix to parameters to efficiently prevent name collisions
3865    let p_path_id = id;
3866
3867    let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
3868    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3869
3870    if let Some(ref user_agent) = configuration.user_agent {
3871        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3872    }
3873    if let Some(ref token) = configuration.bearer_access_token {
3874        req_builder = req_builder.bearer_auth(token.to_owned());
3875    };
3876
3877    let req = req_builder.build()?;
3878    let resp = configuration.client.execute(req).await?;
3879
3880    let status = resp.status();
3881
3882    if !status.is_client_error() && !status.is_server_error() {
3883        Ok(())
3884    } else {
3885        let content = resp.text().await?;
3886        let entity: Option<ProvidersOauth2DestroyError> = serde_json::from_str(&content).ok();
3887        Err(Error::ResponseError(ResponseContent {
3888            status,
3889            content,
3890            entity,
3891        }))
3892    }
3893}
3894
3895/// OAuth2Provider Viewset
3896pub async fn providers_oauth2_list(
3897    configuration: &configuration::Configuration,
3898    access_code_validity: Option<&str>,
3899    access_token_validity: Option<&str>,
3900    application: Option<&str>,
3901    authorization_flow: Option<&str>,
3902    client_id: Option<&str>,
3903    client_type: Option<&str>,
3904    include_claims_in_id_token: Option<bool>,
3905    issuer_mode: Option<&str>,
3906    name: Option<&str>,
3907    ordering: Option<&str>,
3908    page: Option<i32>,
3909    page_size: Option<i32>,
3910    property_mappings: Option<Vec<uuid::Uuid>>,
3911    refresh_token_validity: Option<&str>,
3912    search: Option<&str>,
3913    signing_key: Option<&str>,
3914    sub_mode: Option<&str>,
3915) -> Result<models::PaginatedOAuth2ProviderList, Error<ProvidersOauth2ListError>> {
3916    // add a prefix to parameters to efficiently prevent name collisions
3917    let p_query_access_code_validity = access_code_validity;
3918    let p_query_access_token_validity = access_token_validity;
3919    let p_query_application = application;
3920    let p_query_authorization_flow = authorization_flow;
3921    let p_query_client_id = client_id;
3922    let p_query_client_type = client_type;
3923    let p_query_include_claims_in_id_token = include_claims_in_id_token;
3924    let p_query_issuer_mode = issuer_mode;
3925    let p_query_name = name;
3926    let p_query_ordering = ordering;
3927    let p_query_page = page;
3928    let p_query_page_size = page_size;
3929    let p_query_property_mappings = property_mappings;
3930    let p_query_refresh_token_validity = refresh_token_validity;
3931    let p_query_search = search;
3932    let p_query_signing_key = signing_key;
3933    let p_query_sub_mode = sub_mode;
3934
3935    let uri_str = format!("{}/providers/oauth2/", configuration.base_path);
3936    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3937
3938    if let Some(ref param_value) = p_query_access_code_validity {
3939        req_builder = req_builder.query(&[("access_code_validity", &param_value.to_string())]);
3940    }
3941    if let Some(ref param_value) = p_query_access_token_validity {
3942        req_builder = req_builder.query(&[("access_token_validity", &param_value.to_string())]);
3943    }
3944    if let Some(ref param_value) = p_query_application {
3945        req_builder = req_builder.query(&[("application", &param_value.to_string())]);
3946    }
3947    if let Some(ref param_value) = p_query_authorization_flow {
3948        req_builder = req_builder.query(&[("authorization_flow", &param_value.to_string())]);
3949    }
3950    if let Some(ref param_value) = p_query_client_id {
3951        req_builder = req_builder.query(&[("client_id", &param_value.to_string())]);
3952    }
3953    if let Some(ref param_value) = p_query_client_type {
3954        req_builder = req_builder.query(&[("client_type", &param_value.to_string())]);
3955    }
3956    if let Some(ref param_value) = p_query_include_claims_in_id_token {
3957        req_builder = req_builder.query(&[("include_claims_in_id_token", &param_value.to_string())]);
3958    }
3959    if let Some(ref param_value) = p_query_issuer_mode {
3960        req_builder = req_builder.query(&[("issuer_mode", &param_value.to_string())]);
3961    }
3962    if let Some(ref param_value) = p_query_name {
3963        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
3964    }
3965    if let Some(ref param_value) = p_query_ordering {
3966        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3967    }
3968    if let Some(ref param_value) = p_query_page {
3969        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3970    }
3971    if let Some(ref param_value) = p_query_page_size {
3972        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3973    }
3974    if let Some(ref param_value) = p_query_property_mappings {
3975        req_builder = match "multi" {
3976            "multi" => req_builder.query(
3977                &param_value
3978                    .into_iter()
3979                    .map(|p| ("property_mappings".to_owned(), p.to_string()))
3980                    .collect::<Vec<(std::string::String, std::string::String)>>(),
3981            ),
3982            _ => req_builder.query(&[(
3983                "property_mappings",
3984                &param_value
3985                    .into_iter()
3986                    .map(|p| p.to_string())
3987                    .collect::<Vec<String>>()
3988                    .join(",")
3989                    .to_string(),
3990            )]),
3991        };
3992    }
3993    if let Some(ref param_value) = p_query_refresh_token_validity {
3994        req_builder = req_builder.query(&[("refresh_token_validity", &param_value.to_string())]);
3995    }
3996    if let Some(ref param_value) = p_query_search {
3997        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3998    }
3999    if let Some(ref param_value) = p_query_signing_key {
4000        req_builder = req_builder.query(&[("signing_key", &param_value.to_string())]);
4001    }
4002    if let Some(ref param_value) = p_query_sub_mode {
4003        req_builder = req_builder.query(&[("sub_mode", &param_value.to_string())]);
4004    }
4005    if let Some(ref user_agent) = configuration.user_agent {
4006        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4007    }
4008    if let Some(ref token) = configuration.bearer_access_token {
4009        req_builder = req_builder.bearer_auth(token.to_owned());
4010    };
4011
4012    let req = req_builder.build()?;
4013    let resp = configuration.client.execute(req).await?;
4014
4015    let status = resp.status();
4016    let content_type = resp
4017        .headers()
4018        .get("content-type")
4019        .and_then(|v| v.to_str().ok())
4020        .unwrap_or("application/octet-stream");
4021    let content_type = super::ContentType::from(content_type);
4022
4023    if !status.is_client_error() && !status.is_server_error() {
4024        let content = resp.text().await?;
4025        match content_type {
4026            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4027            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOAuth2ProviderList`"))),
4028            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedOAuth2ProviderList`")))),
4029        }
4030    } else {
4031        let content = resp.text().await?;
4032        let entity: Option<ProvidersOauth2ListError> = serde_json::from_str(&content).ok();
4033        Err(Error::ResponseError(ResponseContent {
4034            status,
4035            content,
4036            entity,
4037        }))
4038    }
4039}
4040
4041/// OAuth2Provider Viewset
4042pub async fn providers_oauth2_partial_update(
4043    configuration: &configuration::Configuration,
4044    id: i32,
4045    patched_o_auth2_provider_request: Option<models::PatchedOAuth2ProviderRequest>,
4046) -> Result<models::OAuth2Provider, Error<ProvidersOauth2PartialUpdateError>> {
4047    // add a prefix to parameters to efficiently prevent name collisions
4048    let p_path_id = id;
4049    let p_body_patched_o_auth2_provider_request = patched_o_auth2_provider_request;
4050
4051    let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
4052    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4053
4054    if let Some(ref user_agent) = configuration.user_agent {
4055        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4056    }
4057    if let Some(ref token) = configuration.bearer_access_token {
4058        req_builder = req_builder.bearer_auth(token.to_owned());
4059    };
4060    req_builder = req_builder.json(&p_body_patched_o_auth2_provider_request);
4061
4062    let req = req_builder.build()?;
4063    let resp = configuration.client.execute(req).await?;
4064
4065    let status = resp.status();
4066    let content_type = resp
4067        .headers()
4068        .get("content-type")
4069        .and_then(|v| v.to_str().ok())
4070        .unwrap_or("application/octet-stream");
4071    let content_type = super::ContentType::from(content_type);
4072
4073    if !status.is_client_error() && !status.is_server_error() {
4074        let content = resp.text().await?;
4075        match content_type {
4076            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4077            ContentType::Text => {
4078                return Err(Error::from(serde_json::Error::custom(
4079                    "Received `text/plain` content type response that cannot be converted to `models::OAuth2Provider`",
4080                )))
4081            }
4082            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4083                "Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Provider`"
4084            )))),
4085        }
4086    } else {
4087        let content = resp.text().await?;
4088        let entity: Option<ProvidersOauth2PartialUpdateError> = serde_json::from_str(&content).ok();
4089        Err(Error::ResponseError(ResponseContent {
4090            status,
4091            content,
4092            entity,
4093        }))
4094    }
4095}
4096
4097/// Preview user data for provider
4098pub async fn providers_oauth2_preview_user_retrieve(
4099    configuration: &configuration::Configuration,
4100    id: i32,
4101    for_user: Option<i32>,
4102) -> Result<models::PropertyMappingPreview, Error<ProvidersOauth2PreviewUserRetrieveError>> {
4103    // add a prefix to parameters to efficiently prevent name collisions
4104    let p_path_id = id;
4105    let p_query_for_user = for_user;
4106
4107    let uri_str = format!(
4108        "{}/providers/oauth2/{id}/preview_user/",
4109        configuration.base_path,
4110        id = p_path_id
4111    );
4112    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4113
4114    if let Some(ref param_value) = p_query_for_user {
4115        req_builder = req_builder.query(&[("for_user", &param_value.to_string())]);
4116    }
4117    if let Some(ref user_agent) = configuration.user_agent {
4118        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4119    }
4120    if let Some(ref token) = configuration.bearer_access_token {
4121        req_builder = req_builder.bearer_auth(token.to_owned());
4122    };
4123
4124    let req = req_builder.build()?;
4125    let resp = configuration.client.execute(req).await?;
4126
4127    let status = resp.status();
4128    let content_type = resp
4129        .headers()
4130        .get("content-type")
4131        .and_then(|v| v.to_str().ok())
4132        .unwrap_or("application/octet-stream");
4133    let content_type = super::ContentType::from(content_type);
4134
4135    if !status.is_client_error() && !status.is_server_error() {
4136        let content = resp.text().await?;
4137        match content_type {
4138            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4139            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PropertyMappingPreview`"))),
4140            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PropertyMappingPreview`")))),
4141        }
4142    } else {
4143        let content = resp.text().await?;
4144        let entity: Option<ProvidersOauth2PreviewUserRetrieveError> = serde_json::from_str(&content).ok();
4145        Err(Error::ResponseError(ResponseContent {
4146            status,
4147            content,
4148            entity,
4149        }))
4150    }
4151}
4152
4153/// OAuth2Provider Viewset
4154pub async fn providers_oauth2_retrieve(
4155    configuration: &configuration::Configuration,
4156    id: i32,
4157) -> Result<models::OAuth2Provider, Error<ProvidersOauth2RetrieveError>> {
4158    // add a prefix to parameters to efficiently prevent name collisions
4159    let p_path_id = id;
4160
4161    let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
4162    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4163
4164    if let Some(ref user_agent) = configuration.user_agent {
4165        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4166    }
4167    if let Some(ref token) = configuration.bearer_access_token {
4168        req_builder = req_builder.bearer_auth(token.to_owned());
4169    };
4170
4171    let req = req_builder.build()?;
4172    let resp = configuration.client.execute(req).await?;
4173
4174    let status = resp.status();
4175    let content_type = resp
4176        .headers()
4177        .get("content-type")
4178        .and_then(|v| v.to_str().ok())
4179        .unwrap_or("application/octet-stream");
4180    let content_type = super::ContentType::from(content_type);
4181
4182    if !status.is_client_error() && !status.is_server_error() {
4183        let content = resp.text().await?;
4184        match content_type {
4185            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4186            ContentType::Text => {
4187                return Err(Error::from(serde_json::Error::custom(
4188                    "Received `text/plain` content type response that cannot be converted to `models::OAuth2Provider`",
4189                )))
4190            }
4191            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4192                "Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Provider`"
4193            )))),
4194        }
4195    } else {
4196        let content = resp.text().await?;
4197        let entity: Option<ProvidersOauth2RetrieveError> = serde_json::from_str(&content).ok();
4198        Err(Error::ResponseError(ResponseContent {
4199            status,
4200            content,
4201            entity,
4202        }))
4203    }
4204}
4205
4206/// Get Providers setup URLs
4207pub async fn providers_oauth2_setup_urls_retrieve(
4208    configuration: &configuration::Configuration,
4209    id: i32,
4210) -> Result<models::OAuth2ProviderSetupUrls, Error<ProvidersOauth2SetupUrlsRetrieveError>> {
4211    // add a prefix to parameters to efficiently prevent name collisions
4212    let p_path_id = id;
4213
4214    let uri_str = format!(
4215        "{}/providers/oauth2/{id}/setup_urls/",
4216        configuration.base_path,
4217        id = p_path_id
4218    );
4219    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4220
4221    if let Some(ref user_agent) = configuration.user_agent {
4222        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4223    }
4224    if let Some(ref token) = configuration.bearer_access_token {
4225        req_builder = req_builder.bearer_auth(token.to_owned());
4226    };
4227
4228    let req = req_builder.build()?;
4229    let resp = configuration.client.execute(req).await?;
4230
4231    let status = resp.status();
4232    let content_type = resp
4233        .headers()
4234        .get("content-type")
4235        .and_then(|v| v.to_str().ok())
4236        .unwrap_or("application/octet-stream");
4237    let content_type = super::ContentType::from(content_type);
4238
4239    if !status.is_client_error() && !status.is_server_error() {
4240        let content = resp.text().await?;
4241        match content_type {
4242            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4243            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuth2ProviderSetupUrls`"))),
4244            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2ProviderSetupUrls`")))),
4245        }
4246    } else {
4247        let content = resp.text().await?;
4248        let entity: Option<ProvidersOauth2SetupUrlsRetrieveError> = serde_json::from_str(&content).ok();
4249        Err(Error::ResponseError(ResponseContent {
4250            status,
4251            content,
4252            entity,
4253        }))
4254    }
4255}
4256
4257/// OAuth2Provider Viewset
4258pub async fn providers_oauth2_update(
4259    configuration: &configuration::Configuration,
4260    id: i32,
4261    o_auth2_provider_request: models::OAuth2ProviderRequest,
4262) -> Result<models::OAuth2Provider, Error<ProvidersOauth2UpdateError>> {
4263    // add a prefix to parameters to efficiently prevent name collisions
4264    let p_path_id = id;
4265    let p_body_o_auth2_provider_request = o_auth2_provider_request;
4266
4267    let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
4268    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4269
4270    if let Some(ref user_agent) = configuration.user_agent {
4271        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4272    }
4273    if let Some(ref token) = configuration.bearer_access_token {
4274        req_builder = req_builder.bearer_auth(token.to_owned());
4275    };
4276    req_builder = req_builder.json(&p_body_o_auth2_provider_request);
4277
4278    let req = req_builder.build()?;
4279    let resp = configuration.client.execute(req).await?;
4280
4281    let status = resp.status();
4282    let content_type = resp
4283        .headers()
4284        .get("content-type")
4285        .and_then(|v| v.to_str().ok())
4286        .unwrap_or("application/octet-stream");
4287    let content_type = super::ContentType::from(content_type);
4288
4289    if !status.is_client_error() && !status.is_server_error() {
4290        let content = resp.text().await?;
4291        match content_type {
4292            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4293            ContentType::Text => {
4294                return Err(Error::from(serde_json::Error::custom(
4295                    "Received `text/plain` content type response that cannot be converted to `models::OAuth2Provider`",
4296                )))
4297            }
4298            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4299                "Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Provider`"
4300            )))),
4301        }
4302    } else {
4303        let content = resp.text().await?;
4304        let entity: Option<ProvidersOauth2UpdateError> = serde_json::from_str(&content).ok();
4305        Err(Error::ResponseError(ResponseContent {
4306            status,
4307            content,
4308            entity,
4309        }))
4310    }
4311}
4312
4313/// Get a list of all objects that use this object
4314pub async fn providers_oauth2_used_by_list(
4315    configuration: &configuration::Configuration,
4316    id: i32,
4317) -> Result<Vec<models::UsedBy>, Error<ProvidersOauth2UsedByListError>> {
4318    // add a prefix to parameters to efficiently prevent name collisions
4319    let p_path_id = id;
4320
4321    let uri_str = format!(
4322        "{}/providers/oauth2/{id}/used_by/",
4323        configuration.base_path,
4324        id = p_path_id
4325    );
4326    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4327
4328    if let Some(ref user_agent) = configuration.user_agent {
4329        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4330    }
4331    if let Some(ref token) = configuration.bearer_access_token {
4332        req_builder = req_builder.bearer_auth(token.to_owned());
4333    };
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 `Vec&lt;models::UsedBy&gt;`"))),
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 `Vec&lt;models::UsedBy&gt;`")))),
4352        }
4353    } else {
4354        let content = resp.text().await?;
4355        let entity: Option<ProvidersOauth2UsedByListError> = serde_json::from_str(&content).ok();
4356        Err(Error::ResponseError(ResponseContent {
4357            status,
4358            content,
4359            entity,
4360        }))
4361    }
4362}
4363
4364/// ProxyProvider Viewset
4365pub async fn providers_proxy_create(
4366    configuration: &configuration::Configuration,
4367    proxy_provider_request: models::ProxyProviderRequest,
4368) -> Result<models::ProxyProvider, Error<ProvidersProxyCreateError>> {
4369    // add a prefix to parameters to efficiently prevent name collisions
4370    let p_body_proxy_provider_request = proxy_provider_request;
4371
4372    let uri_str = format!("{}/providers/proxy/", configuration.base_path);
4373    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4374
4375    if let Some(ref user_agent) = configuration.user_agent {
4376        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4377    }
4378    if let Some(ref token) = configuration.bearer_access_token {
4379        req_builder = req_builder.bearer_auth(token.to_owned());
4380    };
4381    req_builder = req_builder.json(&p_body_proxy_provider_request);
4382
4383    let req = req_builder.build()?;
4384    let resp = configuration.client.execute(req).await?;
4385
4386    let status = resp.status();
4387    let content_type = resp
4388        .headers()
4389        .get("content-type")
4390        .and_then(|v| v.to_str().ok())
4391        .unwrap_or("application/octet-stream");
4392    let content_type = super::ContentType::from(content_type);
4393
4394    if !status.is_client_error() && !status.is_server_error() {
4395        let content = resp.text().await?;
4396        match content_type {
4397            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4398            ContentType::Text => {
4399                return Err(Error::from(serde_json::Error::custom(
4400                    "Received `text/plain` content type response that cannot be converted to `models::ProxyProvider`",
4401                )))
4402            }
4403            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4404                "Received `{unknown_type}` content type response that cannot be converted to `models::ProxyProvider`"
4405            )))),
4406        }
4407    } else {
4408        let content = resp.text().await?;
4409        let entity: Option<ProvidersProxyCreateError> = serde_json::from_str(&content).ok();
4410        Err(Error::ResponseError(ResponseContent {
4411            status,
4412            content,
4413            entity,
4414        }))
4415    }
4416}
4417
4418/// ProxyProvider Viewset
4419pub async fn providers_proxy_destroy(
4420    configuration: &configuration::Configuration,
4421    id: i32,
4422) -> Result<(), Error<ProvidersProxyDestroyError>> {
4423    // add a prefix to parameters to efficiently prevent name collisions
4424    let p_path_id = id;
4425
4426    let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
4427    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4428
4429    if let Some(ref user_agent) = configuration.user_agent {
4430        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4431    }
4432    if let Some(ref token) = configuration.bearer_access_token {
4433        req_builder = req_builder.bearer_auth(token.to_owned());
4434    };
4435
4436    let req = req_builder.build()?;
4437    let resp = configuration.client.execute(req).await?;
4438
4439    let status = resp.status();
4440
4441    if !status.is_client_error() && !status.is_server_error() {
4442        Ok(())
4443    } else {
4444        let content = resp.text().await?;
4445        let entity: Option<ProvidersProxyDestroyError> = serde_json::from_str(&content).ok();
4446        Err(Error::ResponseError(ResponseContent {
4447            status,
4448            content,
4449            entity,
4450        }))
4451    }
4452}
4453
4454/// ProxyProvider Viewset
4455pub async fn providers_proxy_list(
4456    configuration: &configuration::Configuration,
4457    application__isnull: Option<bool>,
4458    authorization_flow__slug__iexact: Option<&str>,
4459    basic_auth_enabled__iexact: Option<bool>,
4460    basic_auth_password_attribute__iexact: Option<&str>,
4461    basic_auth_user_attribute__iexact: Option<&str>,
4462    certificate__kp_uuid__iexact: Option<&str>,
4463    certificate__name__iexact: Option<&str>,
4464    cookie_domain__iexact: Option<&str>,
4465    external_host__iexact: Option<&str>,
4466    internal_host__iexact: Option<&str>,
4467    internal_host_ssl_validation__iexact: Option<bool>,
4468    mode__iexact: Option<&str>,
4469    name__iexact: Option<&str>,
4470    ordering: Option<&str>,
4471    page: Option<i32>,
4472    page_size: Option<i32>,
4473    property_mappings__iexact: Option<Vec<uuid::Uuid>>,
4474    search: Option<&str>,
4475    skip_path_regex__iexact: Option<&str>,
4476) -> Result<models::PaginatedProxyProviderList, Error<ProvidersProxyListError>> {
4477    // add a prefix to parameters to efficiently prevent name collisions
4478    let p_query_application__isnull = application__isnull;
4479    let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact;
4480    let p_query_basic_auth_enabled__iexact = basic_auth_enabled__iexact;
4481    let p_query_basic_auth_password_attribute__iexact = basic_auth_password_attribute__iexact;
4482    let p_query_basic_auth_user_attribute__iexact = basic_auth_user_attribute__iexact;
4483    let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact;
4484    let p_query_certificate__name__iexact = certificate__name__iexact;
4485    let p_query_cookie_domain__iexact = cookie_domain__iexact;
4486    let p_query_external_host__iexact = external_host__iexact;
4487    let p_query_internal_host__iexact = internal_host__iexact;
4488    let p_query_internal_host_ssl_validation__iexact = internal_host_ssl_validation__iexact;
4489    let p_query_mode__iexact = mode__iexact;
4490    let p_query_name__iexact = name__iexact;
4491    let p_query_ordering = ordering;
4492    let p_query_page = page;
4493    let p_query_page_size = page_size;
4494    let p_query_property_mappings__iexact = property_mappings__iexact;
4495    let p_query_search = search;
4496    let p_query_skip_path_regex__iexact = skip_path_regex__iexact;
4497
4498    let uri_str = format!("{}/providers/proxy/", configuration.base_path);
4499    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4500
4501    if let Some(ref param_value) = p_query_application__isnull {
4502        req_builder = req_builder.query(&[("application__isnull", &param_value.to_string())]);
4503    }
4504    if let Some(ref param_value) = p_query_authorization_flow__slug__iexact {
4505        req_builder = req_builder.query(&[("authorization_flow__slug__iexact", &param_value.to_string())]);
4506    }
4507    if let Some(ref param_value) = p_query_basic_auth_enabled__iexact {
4508        req_builder = req_builder.query(&[("basic_auth_enabled__iexact", &param_value.to_string())]);
4509    }
4510    if let Some(ref param_value) = p_query_basic_auth_password_attribute__iexact {
4511        req_builder = req_builder.query(&[("basic_auth_password_attribute__iexact", &param_value.to_string())]);
4512    }
4513    if let Some(ref param_value) = p_query_basic_auth_user_attribute__iexact {
4514        req_builder = req_builder.query(&[("basic_auth_user_attribute__iexact", &param_value.to_string())]);
4515    }
4516    if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact {
4517        req_builder = req_builder.query(&[("certificate__kp_uuid__iexact", &param_value.to_string())]);
4518    }
4519    if let Some(ref param_value) = p_query_certificate__name__iexact {
4520        req_builder = req_builder.query(&[("certificate__name__iexact", &param_value.to_string())]);
4521    }
4522    if let Some(ref param_value) = p_query_cookie_domain__iexact {
4523        req_builder = req_builder.query(&[("cookie_domain__iexact", &param_value.to_string())]);
4524    }
4525    if let Some(ref param_value) = p_query_external_host__iexact {
4526        req_builder = req_builder.query(&[("external_host__iexact", &param_value.to_string())]);
4527    }
4528    if let Some(ref param_value) = p_query_internal_host__iexact {
4529        req_builder = req_builder.query(&[("internal_host__iexact", &param_value.to_string())]);
4530    }
4531    if let Some(ref param_value) = p_query_internal_host_ssl_validation__iexact {
4532        req_builder = req_builder.query(&[("internal_host_ssl_validation__iexact", &param_value.to_string())]);
4533    }
4534    if let Some(ref param_value) = p_query_mode__iexact {
4535        req_builder = req_builder.query(&[("mode__iexact", &param_value.to_string())]);
4536    }
4537    if let Some(ref param_value) = p_query_name__iexact {
4538        req_builder = req_builder.query(&[("name__iexact", &param_value.to_string())]);
4539    }
4540    if let Some(ref param_value) = p_query_ordering {
4541        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4542    }
4543    if let Some(ref param_value) = p_query_page {
4544        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4545    }
4546    if let Some(ref param_value) = p_query_page_size {
4547        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4548    }
4549    if let Some(ref param_value) = p_query_property_mappings__iexact {
4550        req_builder = match "multi" {
4551            "multi" => req_builder.query(
4552                &param_value
4553                    .into_iter()
4554                    .map(|p| ("property_mappings__iexact".to_owned(), p.to_string()))
4555                    .collect::<Vec<(std::string::String, std::string::String)>>(),
4556            ),
4557            _ => req_builder.query(&[(
4558                "property_mappings__iexact",
4559                &param_value
4560                    .into_iter()
4561                    .map(|p| p.to_string())
4562                    .collect::<Vec<String>>()
4563                    .join(",")
4564                    .to_string(),
4565            )]),
4566        };
4567    }
4568    if let Some(ref param_value) = p_query_search {
4569        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4570    }
4571    if let Some(ref param_value) = p_query_skip_path_regex__iexact {
4572        req_builder = req_builder.query(&[("skip_path_regex__iexact", &param_value.to_string())]);
4573    }
4574    if let Some(ref user_agent) = configuration.user_agent {
4575        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4576    }
4577    if let Some(ref token) = configuration.bearer_access_token {
4578        req_builder = req_builder.bearer_auth(token.to_owned());
4579    };
4580
4581    let req = req_builder.build()?;
4582    let resp = configuration.client.execute(req).await?;
4583
4584    let status = resp.status();
4585    let content_type = resp
4586        .headers()
4587        .get("content-type")
4588        .and_then(|v| v.to_str().ok())
4589        .unwrap_or("application/octet-stream");
4590    let content_type = super::ContentType::from(content_type);
4591
4592    if !status.is_client_error() && !status.is_server_error() {
4593        let content = resp.text().await?;
4594        match content_type {
4595            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4596            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedProxyProviderList`"))),
4597            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedProxyProviderList`")))),
4598        }
4599    } else {
4600        let content = resp.text().await?;
4601        let entity: Option<ProvidersProxyListError> = serde_json::from_str(&content).ok();
4602        Err(Error::ResponseError(ResponseContent {
4603            status,
4604            content,
4605            entity,
4606        }))
4607    }
4608}
4609
4610/// ProxyProvider Viewset
4611pub async fn providers_proxy_partial_update(
4612    configuration: &configuration::Configuration,
4613    id: i32,
4614    patched_proxy_provider_request: Option<models::PatchedProxyProviderRequest>,
4615) -> Result<models::ProxyProvider, Error<ProvidersProxyPartialUpdateError>> {
4616    // add a prefix to parameters to efficiently prevent name collisions
4617    let p_path_id = id;
4618    let p_body_patched_proxy_provider_request = patched_proxy_provider_request;
4619
4620    let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
4621    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4622
4623    if let Some(ref user_agent) = configuration.user_agent {
4624        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4625    }
4626    if let Some(ref token) = configuration.bearer_access_token {
4627        req_builder = req_builder.bearer_auth(token.to_owned());
4628    };
4629    req_builder = req_builder.json(&p_body_patched_proxy_provider_request);
4630
4631    let req = req_builder.build()?;
4632    let resp = configuration.client.execute(req).await?;
4633
4634    let status = resp.status();
4635    let content_type = resp
4636        .headers()
4637        .get("content-type")
4638        .and_then(|v| v.to_str().ok())
4639        .unwrap_or("application/octet-stream");
4640    let content_type = super::ContentType::from(content_type);
4641
4642    if !status.is_client_error() && !status.is_server_error() {
4643        let content = resp.text().await?;
4644        match content_type {
4645            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4646            ContentType::Text => {
4647                return Err(Error::from(serde_json::Error::custom(
4648                    "Received `text/plain` content type response that cannot be converted to `models::ProxyProvider`",
4649                )))
4650            }
4651            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4652                "Received `{unknown_type}` content type response that cannot be converted to `models::ProxyProvider`"
4653            )))),
4654        }
4655    } else {
4656        let content = resp.text().await?;
4657        let entity: Option<ProvidersProxyPartialUpdateError> = serde_json::from_str(&content).ok();
4658        Err(Error::ResponseError(ResponseContent {
4659            status,
4660            content,
4661            entity,
4662        }))
4663    }
4664}
4665
4666/// ProxyProvider Viewset
4667pub async fn providers_proxy_retrieve(
4668    configuration: &configuration::Configuration,
4669    id: i32,
4670) -> Result<models::ProxyProvider, Error<ProvidersProxyRetrieveError>> {
4671    // add a prefix to parameters to efficiently prevent name collisions
4672    let p_path_id = id;
4673
4674    let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
4675    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4676
4677    if let Some(ref user_agent) = configuration.user_agent {
4678        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4679    }
4680    if let Some(ref token) = configuration.bearer_access_token {
4681        req_builder = req_builder.bearer_auth(token.to_owned());
4682    };
4683
4684    let req = req_builder.build()?;
4685    let resp = configuration.client.execute(req).await?;
4686
4687    let status = resp.status();
4688    let content_type = resp
4689        .headers()
4690        .get("content-type")
4691        .and_then(|v| v.to_str().ok())
4692        .unwrap_or("application/octet-stream");
4693    let content_type = super::ContentType::from(content_type);
4694
4695    if !status.is_client_error() && !status.is_server_error() {
4696        let content = resp.text().await?;
4697        match content_type {
4698            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4699            ContentType::Text => {
4700                return Err(Error::from(serde_json::Error::custom(
4701                    "Received `text/plain` content type response that cannot be converted to `models::ProxyProvider`",
4702                )))
4703            }
4704            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4705                "Received `{unknown_type}` content type response that cannot be converted to `models::ProxyProvider`"
4706            )))),
4707        }
4708    } else {
4709        let content = resp.text().await?;
4710        let entity: Option<ProvidersProxyRetrieveError> = serde_json::from_str(&content).ok();
4711        Err(Error::ResponseError(ResponseContent {
4712            status,
4713            content,
4714            entity,
4715        }))
4716    }
4717}
4718
4719/// ProxyProvider Viewset
4720pub async fn providers_proxy_update(
4721    configuration: &configuration::Configuration,
4722    id: i32,
4723    proxy_provider_request: models::ProxyProviderRequest,
4724) -> Result<models::ProxyProvider, Error<ProvidersProxyUpdateError>> {
4725    // add a prefix to parameters to efficiently prevent name collisions
4726    let p_path_id = id;
4727    let p_body_proxy_provider_request = proxy_provider_request;
4728
4729    let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
4730    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4731
4732    if let Some(ref user_agent) = configuration.user_agent {
4733        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4734    }
4735    if let Some(ref token) = configuration.bearer_access_token {
4736        req_builder = req_builder.bearer_auth(token.to_owned());
4737    };
4738    req_builder = req_builder.json(&p_body_proxy_provider_request);
4739
4740    let req = req_builder.build()?;
4741    let resp = configuration.client.execute(req).await?;
4742
4743    let status = resp.status();
4744    let content_type = resp
4745        .headers()
4746        .get("content-type")
4747        .and_then(|v| v.to_str().ok())
4748        .unwrap_or("application/octet-stream");
4749    let content_type = super::ContentType::from(content_type);
4750
4751    if !status.is_client_error() && !status.is_server_error() {
4752        let content = resp.text().await?;
4753        match content_type {
4754            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4755            ContentType::Text => {
4756                return Err(Error::from(serde_json::Error::custom(
4757                    "Received `text/plain` content type response that cannot be converted to `models::ProxyProvider`",
4758                )))
4759            }
4760            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4761                "Received `{unknown_type}` content type response that cannot be converted to `models::ProxyProvider`"
4762            )))),
4763        }
4764    } else {
4765        let content = resp.text().await?;
4766        let entity: Option<ProvidersProxyUpdateError> = serde_json::from_str(&content).ok();
4767        Err(Error::ResponseError(ResponseContent {
4768            status,
4769            content,
4770            entity,
4771        }))
4772    }
4773}
4774
4775/// Get a list of all objects that use this object
4776pub async fn providers_proxy_used_by_list(
4777    configuration: &configuration::Configuration,
4778    id: i32,
4779) -> Result<Vec<models::UsedBy>, Error<ProvidersProxyUsedByListError>> {
4780    // add a prefix to parameters to efficiently prevent name collisions
4781    let p_path_id = id;
4782
4783    let uri_str = format!(
4784        "{}/providers/proxy/{id}/used_by/",
4785        configuration.base_path,
4786        id = p_path_id
4787    );
4788    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4789
4790    if let Some(ref user_agent) = configuration.user_agent {
4791        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4792    }
4793    if let Some(ref token) = configuration.bearer_access_token {
4794        req_builder = req_builder.bearer_auth(token.to_owned());
4795    };
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 `Vec&lt;models::UsedBy&gt;`"))),
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 `Vec&lt;models::UsedBy&gt;`")))),
4814        }
4815    } else {
4816        let content = resp.text().await?;
4817        let entity: Option<ProvidersProxyUsedByListError> = serde_json::from_str(&content).ok();
4818        Err(Error::ResponseError(ResponseContent {
4819            status,
4820            content,
4821            entity,
4822        }))
4823    }
4824}
4825
4826/// RACProvider Viewset
4827pub async fn providers_rac_create(
4828    configuration: &configuration::Configuration,
4829    rac_provider_request: models::RacProviderRequest,
4830) -> Result<models::RacProvider, Error<ProvidersRacCreateError>> {
4831    // add a prefix to parameters to efficiently prevent name collisions
4832    let p_body_rac_provider_request = rac_provider_request;
4833
4834    let uri_str = format!("{}/providers/rac/", configuration.base_path);
4835    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4836
4837    if let Some(ref user_agent) = configuration.user_agent {
4838        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4839    }
4840    if let Some(ref token) = configuration.bearer_access_token {
4841        req_builder = req_builder.bearer_auth(token.to_owned());
4842    };
4843    req_builder = req_builder.json(&p_body_rac_provider_request);
4844
4845    let req = req_builder.build()?;
4846    let resp = configuration.client.execute(req).await?;
4847
4848    let status = resp.status();
4849    let content_type = resp
4850        .headers()
4851        .get("content-type")
4852        .and_then(|v| v.to_str().ok())
4853        .unwrap_or("application/octet-stream");
4854    let content_type = super::ContentType::from(content_type);
4855
4856    if !status.is_client_error() && !status.is_server_error() {
4857        let content = resp.text().await?;
4858        match content_type {
4859            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4860            ContentType::Text => {
4861                return Err(Error::from(serde_json::Error::custom(
4862                    "Received `text/plain` content type response that cannot be converted to `models::RacProvider`",
4863                )))
4864            }
4865            ContentType::Unsupported(unknown_type) => {
4866                return Err(Error::from(serde_json::Error::custom(format!(
4867                    "Received `{unknown_type}` content type response that cannot be converted to `models::RacProvider`"
4868                ))))
4869            }
4870        }
4871    } else {
4872        let content = resp.text().await?;
4873        let entity: Option<ProvidersRacCreateError> = serde_json::from_str(&content).ok();
4874        Err(Error::ResponseError(ResponseContent {
4875            status,
4876            content,
4877            entity,
4878        }))
4879    }
4880}
4881
4882/// RACProvider Viewset
4883pub async fn providers_rac_destroy(
4884    configuration: &configuration::Configuration,
4885    id: i32,
4886) -> Result<(), Error<ProvidersRacDestroyError>> {
4887    // add a prefix to parameters to efficiently prevent name collisions
4888    let p_path_id = id;
4889
4890    let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
4891    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4892
4893    if let Some(ref user_agent) = configuration.user_agent {
4894        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4895    }
4896    if let Some(ref token) = configuration.bearer_access_token {
4897        req_builder = req_builder.bearer_auth(token.to_owned());
4898    };
4899
4900    let req = req_builder.build()?;
4901    let resp = configuration.client.execute(req).await?;
4902
4903    let status = resp.status();
4904
4905    if !status.is_client_error() && !status.is_server_error() {
4906        Ok(())
4907    } else {
4908        let content = resp.text().await?;
4909        let entity: Option<ProvidersRacDestroyError> = serde_json::from_str(&content).ok();
4910        Err(Error::ResponseError(ResponseContent {
4911            status,
4912            content,
4913            entity,
4914        }))
4915    }
4916}
4917
4918/// RACProvider Viewset
4919pub async fn providers_rac_list(
4920    configuration: &configuration::Configuration,
4921    application__isnull: Option<bool>,
4922    name__iexact: Option<&str>,
4923    ordering: Option<&str>,
4924    page: Option<i32>,
4925    page_size: Option<i32>,
4926    search: Option<&str>,
4927) -> Result<models::PaginatedRacProviderList, Error<ProvidersRacListError>> {
4928    // add a prefix to parameters to efficiently prevent name collisions
4929    let p_query_application__isnull = application__isnull;
4930    let p_query_name__iexact = name__iexact;
4931    let p_query_ordering = ordering;
4932    let p_query_page = page;
4933    let p_query_page_size = page_size;
4934    let p_query_search = search;
4935
4936    let uri_str = format!("{}/providers/rac/", configuration.base_path);
4937    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4938
4939    if let Some(ref param_value) = p_query_application__isnull {
4940        req_builder = req_builder.query(&[("application__isnull", &param_value.to_string())]);
4941    }
4942    if let Some(ref param_value) = p_query_name__iexact {
4943        req_builder = req_builder.query(&[("name__iexact", &param_value.to_string())]);
4944    }
4945    if let Some(ref param_value) = p_query_ordering {
4946        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4947    }
4948    if let Some(ref param_value) = p_query_page {
4949        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4950    }
4951    if let Some(ref param_value) = p_query_page_size {
4952        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4953    }
4954    if let Some(ref param_value) = p_query_search {
4955        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4956    }
4957    if let Some(ref user_agent) = configuration.user_agent {
4958        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4959    }
4960    if let Some(ref token) = configuration.bearer_access_token {
4961        req_builder = req_builder.bearer_auth(token.to_owned());
4962    };
4963
4964    let req = req_builder.build()?;
4965    let resp = configuration.client.execute(req).await?;
4966
4967    let status = resp.status();
4968    let content_type = resp
4969        .headers()
4970        .get("content-type")
4971        .and_then(|v| v.to_str().ok())
4972        .unwrap_or("application/octet-stream");
4973    let content_type = super::ContentType::from(content_type);
4974
4975    if !status.is_client_error() && !status.is_server_error() {
4976        let content = resp.text().await?;
4977        match content_type {
4978            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4979            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRacProviderList`"))),
4980            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedRacProviderList`")))),
4981        }
4982    } else {
4983        let content = resp.text().await?;
4984        let entity: Option<ProvidersRacListError> = serde_json::from_str(&content).ok();
4985        Err(Error::ResponseError(ResponseContent {
4986            status,
4987            content,
4988            entity,
4989        }))
4990    }
4991}
4992
4993/// RACProvider Viewset
4994pub async fn providers_rac_partial_update(
4995    configuration: &configuration::Configuration,
4996    id: i32,
4997    patched_rac_provider_request: Option<models::PatchedRacProviderRequest>,
4998) -> Result<models::RacProvider, Error<ProvidersRacPartialUpdateError>> {
4999    // add a prefix to parameters to efficiently prevent name collisions
5000    let p_path_id = id;
5001    let p_body_patched_rac_provider_request = patched_rac_provider_request;
5002
5003    let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
5004    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5005
5006    if let Some(ref user_agent) = configuration.user_agent {
5007        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5008    }
5009    if let Some(ref token) = configuration.bearer_access_token {
5010        req_builder = req_builder.bearer_auth(token.to_owned());
5011    };
5012    req_builder = req_builder.json(&p_body_patched_rac_provider_request);
5013
5014    let req = req_builder.build()?;
5015    let resp = configuration.client.execute(req).await?;
5016
5017    let status = resp.status();
5018    let content_type = resp
5019        .headers()
5020        .get("content-type")
5021        .and_then(|v| v.to_str().ok())
5022        .unwrap_or("application/octet-stream");
5023    let content_type = super::ContentType::from(content_type);
5024
5025    if !status.is_client_error() && !status.is_server_error() {
5026        let content = resp.text().await?;
5027        match content_type {
5028            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5029            ContentType::Text => {
5030                return Err(Error::from(serde_json::Error::custom(
5031                    "Received `text/plain` content type response that cannot be converted to `models::RacProvider`",
5032                )))
5033            }
5034            ContentType::Unsupported(unknown_type) => {
5035                return Err(Error::from(serde_json::Error::custom(format!(
5036                    "Received `{unknown_type}` content type response that cannot be converted to `models::RacProvider`"
5037                ))))
5038            }
5039        }
5040    } else {
5041        let content = resp.text().await?;
5042        let entity: Option<ProvidersRacPartialUpdateError> = serde_json::from_str(&content).ok();
5043        Err(Error::ResponseError(ResponseContent {
5044            status,
5045            content,
5046            entity,
5047        }))
5048    }
5049}
5050
5051/// RACProvider Viewset
5052pub async fn providers_rac_retrieve(
5053    configuration: &configuration::Configuration,
5054    id: i32,
5055) -> Result<models::RacProvider, Error<ProvidersRacRetrieveError>> {
5056    // add a prefix to parameters to efficiently prevent name collisions
5057    let p_path_id = id;
5058
5059    let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
5060    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5061
5062    if let Some(ref user_agent) = configuration.user_agent {
5063        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5064    }
5065    if let Some(ref token) = configuration.bearer_access_token {
5066        req_builder = req_builder.bearer_auth(token.to_owned());
5067    };
5068
5069    let req = req_builder.build()?;
5070    let resp = configuration.client.execute(req).await?;
5071
5072    let status = resp.status();
5073    let content_type = resp
5074        .headers()
5075        .get("content-type")
5076        .and_then(|v| v.to_str().ok())
5077        .unwrap_or("application/octet-stream");
5078    let content_type = super::ContentType::from(content_type);
5079
5080    if !status.is_client_error() && !status.is_server_error() {
5081        let content = resp.text().await?;
5082        match content_type {
5083            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5084            ContentType::Text => {
5085                return Err(Error::from(serde_json::Error::custom(
5086                    "Received `text/plain` content type response that cannot be converted to `models::RacProvider`",
5087                )))
5088            }
5089            ContentType::Unsupported(unknown_type) => {
5090                return Err(Error::from(serde_json::Error::custom(format!(
5091                    "Received `{unknown_type}` content type response that cannot be converted to `models::RacProvider`"
5092                ))))
5093            }
5094        }
5095    } else {
5096        let content = resp.text().await?;
5097        let entity: Option<ProvidersRacRetrieveError> = serde_json::from_str(&content).ok();
5098        Err(Error::ResponseError(ResponseContent {
5099            status,
5100            content,
5101            entity,
5102        }))
5103    }
5104}
5105
5106/// RACProvider Viewset
5107pub async fn providers_rac_update(
5108    configuration: &configuration::Configuration,
5109    id: i32,
5110    rac_provider_request: models::RacProviderRequest,
5111) -> Result<models::RacProvider, Error<ProvidersRacUpdateError>> {
5112    // add a prefix to parameters to efficiently prevent name collisions
5113    let p_path_id = id;
5114    let p_body_rac_provider_request = rac_provider_request;
5115
5116    let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
5117    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5118
5119    if let Some(ref user_agent) = configuration.user_agent {
5120        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5121    }
5122    if let Some(ref token) = configuration.bearer_access_token {
5123        req_builder = req_builder.bearer_auth(token.to_owned());
5124    };
5125    req_builder = req_builder.json(&p_body_rac_provider_request);
5126
5127    let req = req_builder.build()?;
5128    let resp = configuration.client.execute(req).await?;
5129
5130    let status = resp.status();
5131    let content_type = resp
5132        .headers()
5133        .get("content-type")
5134        .and_then(|v| v.to_str().ok())
5135        .unwrap_or("application/octet-stream");
5136    let content_type = super::ContentType::from(content_type);
5137
5138    if !status.is_client_error() && !status.is_server_error() {
5139        let content = resp.text().await?;
5140        match content_type {
5141            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5142            ContentType::Text => {
5143                return Err(Error::from(serde_json::Error::custom(
5144                    "Received `text/plain` content type response that cannot be converted to `models::RacProvider`",
5145                )))
5146            }
5147            ContentType::Unsupported(unknown_type) => {
5148                return Err(Error::from(serde_json::Error::custom(format!(
5149                    "Received `{unknown_type}` content type response that cannot be converted to `models::RacProvider`"
5150                ))))
5151            }
5152        }
5153    } else {
5154        let content = resp.text().await?;
5155        let entity: Option<ProvidersRacUpdateError> = serde_json::from_str(&content).ok();
5156        Err(Error::ResponseError(ResponseContent {
5157            status,
5158            content,
5159            entity,
5160        }))
5161    }
5162}
5163
5164/// Get a list of all objects that use this object
5165pub async fn providers_rac_used_by_list(
5166    configuration: &configuration::Configuration,
5167    id: i32,
5168) -> Result<Vec<models::UsedBy>, Error<ProvidersRacUsedByListError>> {
5169    // add a prefix to parameters to efficiently prevent name collisions
5170    let p_path_id = id;
5171
5172    let uri_str = format!(
5173        "{}/providers/rac/{id}/used_by/",
5174        configuration.base_path,
5175        id = p_path_id
5176    );
5177    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5178
5179    if let Some(ref user_agent) = configuration.user_agent {
5180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5181    }
5182    if let Some(ref token) = configuration.bearer_access_token {
5183        req_builder = req_builder.bearer_auth(token.to_owned());
5184    };
5185
5186    let req = req_builder.build()?;
5187    let resp = configuration.client.execute(req).await?;
5188
5189    let status = resp.status();
5190    let content_type = resp
5191        .headers()
5192        .get("content-type")
5193        .and_then(|v| v.to_str().ok())
5194        .unwrap_or("application/octet-stream");
5195    let content_type = super::ContentType::from(content_type);
5196
5197    if !status.is_client_error() && !status.is_server_error() {
5198        let content = resp.text().await?;
5199        match content_type {
5200            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5201            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
5202            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
5203        }
5204    } else {
5205        let content = resp.text().await?;
5206        let entity: Option<ProvidersRacUsedByListError> = serde_json::from_str(&content).ok();
5207        Err(Error::ResponseError(ResponseContent {
5208            status,
5209            content,
5210            entity,
5211        }))
5212    }
5213}
5214
5215/// RadiusProvider Viewset
5216pub async fn providers_radius_create(
5217    configuration: &configuration::Configuration,
5218    radius_provider_request: models::RadiusProviderRequest,
5219) -> Result<models::RadiusProvider, Error<ProvidersRadiusCreateError>> {
5220    // add a prefix to parameters to efficiently prevent name collisions
5221    let p_body_radius_provider_request = radius_provider_request;
5222
5223    let uri_str = format!("{}/providers/radius/", configuration.base_path);
5224    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5225
5226    if let Some(ref user_agent) = configuration.user_agent {
5227        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5228    }
5229    if let Some(ref token) = configuration.bearer_access_token {
5230        req_builder = req_builder.bearer_auth(token.to_owned());
5231    };
5232    req_builder = req_builder.json(&p_body_radius_provider_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 => {
5250                return Err(Error::from(serde_json::Error::custom(
5251                    "Received `text/plain` content type response that cannot be converted to `models::RadiusProvider`",
5252                )))
5253            }
5254            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5255                "Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProvider`"
5256            )))),
5257        }
5258    } else {
5259        let content = resp.text().await?;
5260        let entity: Option<ProvidersRadiusCreateError> = serde_json::from_str(&content).ok();
5261        Err(Error::ResponseError(ResponseContent {
5262            status,
5263            content,
5264            entity,
5265        }))
5266    }
5267}
5268
5269/// RadiusProvider Viewset
5270pub async fn providers_radius_destroy(
5271    configuration: &configuration::Configuration,
5272    id: i32,
5273) -> Result<(), Error<ProvidersRadiusDestroyError>> {
5274    // add a prefix to parameters to efficiently prevent name collisions
5275    let p_path_id = id;
5276
5277    let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
5278    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5279
5280    if let Some(ref user_agent) = configuration.user_agent {
5281        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5282    }
5283    if let Some(ref token) = configuration.bearer_access_token {
5284        req_builder = req_builder.bearer_auth(token.to_owned());
5285    };
5286
5287    let req = req_builder.build()?;
5288    let resp = configuration.client.execute(req).await?;
5289
5290    let status = resp.status();
5291
5292    if !status.is_client_error() && !status.is_server_error() {
5293        Ok(())
5294    } else {
5295        let content = resp.text().await?;
5296        let entity: Option<ProvidersRadiusDestroyError> = serde_json::from_str(&content).ok();
5297        Err(Error::ResponseError(ResponseContent {
5298            status,
5299            content,
5300            entity,
5301        }))
5302    }
5303}
5304
5305/// RadiusProvider Viewset
5306pub async fn providers_radius_list(
5307    configuration: &configuration::Configuration,
5308    application__isnull: Option<bool>,
5309    authorization_flow__slug__iexact: Option<&str>,
5310    client_networks__iexact: Option<&str>,
5311    name__iexact: Option<&str>,
5312    ordering: Option<&str>,
5313    page: Option<i32>,
5314    page_size: Option<i32>,
5315    search: Option<&str>,
5316) -> Result<models::PaginatedRadiusProviderList, Error<ProvidersRadiusListError>> {
5317    // add a prefix to parameters to efficiently prevent name collisions
5318    let p_query_application__isnull = application__isnull;
5319    let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact;
5320    let p_query_client_networks__iexact = client_networks__iexact;
5321    let p_query_name__iexact = name__iexact;
5322    let p_query_ordering = ordering;
5323    let p_query_page = page;
5324    let p_query_page_size = page_size;
5325    let p_query_search = search;
5326
5327    let uri_str = format!("{}/providers/radius/", configuration.base_path);
5328    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5329
5330    if let Some(ref param_value) = p_query_application__isnull {
5331        req_builder = req_builder.query(&[("application__isnull", &param_value.to_string())]);
5332    }
5333    if let Some(ref param_value) = p_query_authorization_flow__slug__iexact {
5334        req_builder = req_builder.query(&[("authorization_flow__slug__iexact", &param_value.to_string())]);
5335    }
5336    if let Some(ref param_value) = p_query_client_networks__iexact {
5337        req_builder = req_builder.query(&[("client_networks__iexact", &param_value.to_string())]);
5338    }
5339    if let Some(ref param_value) = p_query_name__iexact {
5340        req_builder = req_builder.query(&[("name__iexact", &param_value.to_string())]);
5341    }
5342    if let Some(ref param_value) = p_query_ordering {
5343        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5344    }
5345    if let Some(ref param_value) = p_query_page {
5346        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5347    }
5348    if let Some(ref param_value) = p_query_page_size {
5349        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5350    }
5351    if let Some(ref param_value) = p_query_search {
5352        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5353    }
5354    if let Some(ref user_agent) = configuration.user_agent {
5355        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5356    }
5357    if let Some(ref token) = configuration.bearer_access_token {
5358        req_builder = req_builder.bearer_auth(token.to_owned());
5359    };
5360
5361    let req = req_builder.build()?;
5362    let resp = configuration.client.execute(req).await?;
5363
5364    let status = resp.status();
5365    let content_type = resp
5366        .headers()
5367        .get("content-type")
5368        .and_then(|v| v.to_str().ok())
5369        .unwrap_or("application/octet-stream");
5370    let content_type = super::ContentType::from(content_type);
5371
5372    if !status.is_client_error() && !status.is_server_error() {
5373        let content = resp.text().await?;
5374        match content_type {
5375            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5376            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRadiusProviderList`"))),
5377            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedRadiusProviderList`")))),
5378        }
5379    } else {
5380        let content = resp.text().await?;
5381        let entity: Option<ProvidersRadiusListError> = serde_json::from_str(&content).ok();
5382        Err(Error::ResponseError(ResponseContent {
5383            status,
5384            content,
5385            entity,
5386        }))
5387    }
5388}
5389
5390/// RadiusProvider Viewset
5391pub async fn providers_radius_partial_update(
5392    configuration: &configuration::Configuration,
5393    id: i32,
5394    patched_radius_provider_request: Option<models::PatchedRadiusProviderRequest>,
5395) -> Result<models::RadiusProvider, Error<ProvidersRadiusPartialUpdateError>> {
5396    // add a prefix to parameters to efficiently prevent name collisions
5397    let p_path_id = id;
5398    let p_body_patched_radius_provider_request = patched_radius_provider_request;
5399
5400    let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
5401    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5402
5403    if let Some(ref user_agent) = configuration.user_agent {
5404        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5405    }
5406    if let Some(ref token) = configuration.bearer_access_token {
5407        req_builder = req_builder.bearer_auth(token.to_owned());
5408    };
5409    req_builder = req_builder.json(&p_body_patched_radius_provider_request);
5410
5411    let req = req_builder.build()?;
5412    let resp = configuration.client.execute(req).await?;
5413
5414    let status = resp.status();
5415    let content_type = resp
5416        .headers()
5417        .get("content-type")
5418        .and_then(|v| v.to_str().ok())
5419        .unwrap_or("application/octet-stream");
5420    let content_type = super::ContentType::from(content_type);
5421
5422    if !status.is_client_error() && !status.is_server_error() {
5423        let content = resp.text().await?;
5424        match content_type {
5425            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5426            ContentType::Text => {
5427                return Err(Error::from(serde_json::Error::custom(
5428                    "Received `text/plain` content type response that cannot be converted to `models::RadiusProvider`",
5429                )))
5430            }
5431            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5432                "Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProvider`"
5433            )))),
5434        }
5435    } else {
5436        let content = resp.text().await?;
5437        let entity: Option<ProvidersRadiusPartialUpdateError> = serde_json::from_str(&content).ok();
5438        Err(Error::ResponseError(ResponseContent {
5439            status,
5440            content,
5441            entity,
5442        }))
5443    }
5444}
5445
5446/// RadiusProvider Viewset
5447pub async fn providers_radius_retrieve(
5448    configuration: &configuration::Configuration,
5449    id: i32,
5450) -> Result<models::RadiusProvider, Error<ProvidersRadiusRetrieveError>> {
5451    // add a prefix to parameters to efficiently prevent name collisions
5452    let p_path_id = id;
5453
5454    let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
5455    let mut req_builder = configuration.client.request(reqwest::Method::GET, &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 token) = configuration.bearer_access_token {
5461        req_builder = req_builder.bearer_auth(token.to_owned());
5462    };
5463
5464    let req = req_builder.build()?;
5465    let resp = configuration.client.execute(req).await?;
5466
5467    let status = resp.status();
5468    let content_type = resp
5469        .headers()
5470        .get("content-type")
5471        .and_then(|v| v.to_str().ok())
5472        .unwrap_or("application/octet-stream");
5473    let content_type = super::ContentType::from(content_type);
5474
5475    if !status.is_client_error() && !status.is_server_error() {
5476        let content = resp.text().await?;
5477        match content_type {
5478            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5479            ContentType::Text => {
5480                return Err(Error::from(serde_json::Error::custom(
5481                    "Received `text/plain` content type response that cannot be converted to `models::RadiusProvider`",
5482                )))
5483            }
5484            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5485                "Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProvider`"
5486            )))),
5487        }
5488    } else {
5489        let content = resp.text().await?;
5490        let entity: Option<ProvidersRadiusRetrieveError> = serde_json::from_str(&content).ok();
5491        Err(Error::ResponseError(ResponseContent {
5492            status,
5493            content,
5494            entity,
5495        }))
5496    }
5497}
5498
5499/// RadiusProvider Viewset
5500pub async fn providers_radius_update(
5501    configuration: &configuration::Configuration,
5502    id: i32,
5503    radius_provider_request: models::RadiusProviderRequest,
5504) -> Result<models::RadiusProvider, Error<ProvidersRadiusUpdateError>> {
5505    // add a prefix to parameters to efficiently prevent name collisions
5506    let p_path_id = id;
5507    let p_body_radius_provider_request = radius_provider_request;
5508
5509    let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
5510    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5511
5512    if let Some(ref user_agent) = configuration.user_agent {
5513        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5514    }
5515    if let Some(ref token) = configuration.bearer_access_token {
5516        req_builder = req_builder.bearer_auth(token.to_owned());
5517    };
5518    req_builder = req_builder.json(&p_body_radius_provider_request);
5519
5520    let req = req_builder.build()?;
5521    let resp = configuration.client.execute(req).await?;
5522
5523    let status = resp.status();
5524    let content_type = resp
5525        .headers()
5526        .get("content-type")
5527        .and_then(|v| v.to_str().ok())
5528        .unwrap_or("application/octet-stream");
5529    let content_type = super::ContentType::from(content_type);
5530
5531    if !status.is_client_error() && !status.is_server_error() {
5532        let content = resp.text().await?;
5533        match content_type {
5534            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5535            ContentType::Text => {
5536                return Err(Error::from(serde_json::Error::custom(
5537                    "Received `text/plain` content type response that cannot be converted to `models::RadiusProvider`",
5538                )))
5539            }
5540            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5541                "Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProvider`"
5542            )))),
5543        }
5544    } else {
5545        let content = resp.text().await?;
5546        let entity: Option<ProvidersRadiusUpdateError> = serde_json::from_str(&content).ok();
5547        Err(Error::ResponseError(ResponseContent {
5548            status,
5549            content,
5550            entity,
5551        }))
5552    }
5553}
5554
5555/// Get a list of all objects that use this object
5556pub async fn providers_radius_used_by_list(
5557    configuration: &configuration::Configuration,
5558    id: i32,
5559) -> Result<Vec<models::UsedBy>, Error<ProvidersRadiusUsedByListError>> {
5560    // add a prefix to parameters to efficiently prevent name collisions
5561    let p_path_id = id;
5562
5563    let uri_str = format!(
5564        "{}/providers/radius/{id}/used_by/",
5565        configuration.base_path,
5566        id = p_path_id
5567    );
5568    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5569
5570    if let Some(ref user_agent) = configuration.user_agent {
5571        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5572    }
5573    if let Some(ref token) = configuration.bearer_access_token {
5574        req_builder = req_builder.bearer_auth(token.to_owned());
5575    };
5576
5577    let req = req_builder.build()?;
5578    let resp = configuration.client.execute(req).await?;
5579
5580    let status = resp.status();
5581    let content_type = resp
5582        .headers()
5583        .get("content-type")
5584        .and_then(|v| v.to_str().ok())
5585        .unwrap_or("application/octet-stream");
5586    let content_type = super::ContentType::from(content_type);
5587
5588    if !status.is_client_error() && !status.is_server_error() {
5589        let content = resp.text().await?;
5590        match content_type {
5591            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5592            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
5593            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
5594        }
5595    } else {
5596        let content = resp.text().await?;
5597        let entity: Option<ProvidersRadiusUsedByListError> = serde_json::from_str(&content).ok();
5598        Err(Error::ResponseError(ResponseContent {
5599            status,
5600            content,
5601            entity,
5602        }))
5603    }
5604}
5605
5606/// SAMLProvider Viewset
5607pub async fn providers_saml_create(
5608    configuration: &configuration::Configuration,
5609    saml_provider_request: models::SamlProviderRequest,
5610) -> Result<models::SamlProvider, Error<ProvidersSamlCreateError>> {
5611    // add a prefix to parameters to efficiently prevent name collisions
5612    let p_body_saml_provider_request = saml_provider_request;
5613
5614    let uri_str = format!("{}/providers/saml/", configuration.base_path);
5615    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5616
5617    if let Some(ref user_agent) = configuration.user_agent {
5618        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5619    }
5620    if let Some(ref token) = configuration.bearer_access_token {
5621        req_builder = req_builder.bearer_auth(token.to_owned());
5622    };
5623    req_builder = req_builder.json(&p_body_saml_provider_request);
5624
5625    let req = req_builder.build()?;
5626    let resp = configuration.client.execute(req).await?;
5627
5628    let status = resp.status();
5629    let content_type = resp
5630        .headers()
5631        .get("content-type")
5632        .and_then(|v| v.to_str().ok())
5633        .unwrap_or("application/octet-stream");
5634    let content_type = super::ContentType::from(content_type);
5635
5636    if !status.is_client_error() && !status.is_server_error() {
5637        let content = resp.text().await?;
5638        match content_type {
5639            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5640            ContentType::Text => {
5641                return Err(Error::from(serde_json::Error::custom(
5642                    "Received `text/plain` content type response that cannot be converted to `models::SamlProvider`",
5643                )))
5644            }
5645            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5646                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlProvider`"
5647            )))),
5648        }
5649    } else {
5650        let content = resp.text().await?;
5651        let entity: Option<ProvidersSamlCreateError> = serde_json::from_str(&content).ok();
5652        Err(Error::ResponseError(ResponseContent {
5653            status,
5654            content,
5655            entity,
5656        }))
5657    }
5658}
5659
5660/// SAMLProvider Viewset
5661pub async fn providers_saml_destroy(
5662    configuration: &configuration::Configuration,
5663    id: i32,
5664) -> Result<(), Error<ProvidersSamlDestroyError>> {
5665    // add a prefix to parameters to efficiently prevent name collisions
5666    let p_path_id = id;
5667
5668    let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
5669    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5670
5671    if let Some(ref user_agent) = configuration.user_agent {
5672        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5673    }
5674    if let Some(ref token) = configuration.bearer_access_token {
5675        req_builder = req_builder.bearer_auth(token.to_owned());
5676    };
5677
5678    let req = req_builder.build()?;
5679    let resp = configuration.client.execute(req).await?;
5680
5681    let status = resp.status();
5682
5683    if !status.is_client_error() && !status.is_server_error() {
5684        Ok(())
5685    } else {
5686        let content = resp.text().await?;
5687        let entity: Option<ProvidersSamlDestroyError> = serde_json::from_str(&content).ok();
5688        Err(Error::ResponseError(ResponseContent {
5689            status,
5690            content,
5691            entity,
5692        }))
5693    }
5694}
5695
5696/// Create provider from SAML Metadata
5697pub async fn providers_saml_import_metadata_create(
5698    configuration: &configuration::Configuration,
5699    name: &str,
5700    authorization_flow: &str,
5701    invalidation_flow: &str,
5702    file: std::path::PathBuf,
5703) -> Result<(), Error<ProvidersSamlImportMetadataCreateError>> {
5704    // add a prefix to parameters to efficiently prevent name collisions
5705    let p_form_name = name;
5706    let p_form_authorization_flow = authorization_flow;
5707    let p_form_invalidation_flow = invalidation_flow;
5708    let p_form_file = file;
5709
5710    let uri_str = format!("{}/providers/saml/import_metadata/", configuration.base_path);
5711    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5712
5713    if let Some(ref user_agent) = configuration.user_agent {
5714        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5715    }
5716    if let Some(ref token) = configuration.bearer_access_token {
5717        req_builder = req_builder.bearer_auth(token.to_owned());
5718    };
5719    let mut multipart_form = reqwest::multipart::Form::new();
5720    multipart_form = multipart_form.text("name", p_form_name.to_string());
5721    multipart_form = multipart_form.text("authorization_flow", p_form_authorization_flow.to_string());
5722    multipart_form = multipart_form.text("invalidation_flow", p_form_invalidation_flow.to_string());
5723    // TODO: support file upload for 'file' parameter
5724    req_builder = req_builder.multipart(multipart_form);
5725
5726    let req = req_builder.build()?;
5727    let resp = configuration.client.execute(req).await?;
5728
5729    let status = resp.status();
5730
5731    if !status.is_client_error() && !status.is_server_error() {
5732        Ok(())
5733    } else {
5734        let content = resp.text().await?;
5735        let entity: Option<ProvidersSamlImportMetadataCreateError> = serde_json::from_str(&content).ok();
5736        Err(Error::ResponseError(ResponseContent {
5737            status,
5738            content,
5739            entity,
5740        }))
5741    }
5742}
5743
5744/// SAMLProvider Viewset
5745pub async fn providers_saml_list(
5746    configuration: &configuration::Configuration,
5747    acs_url: Option<&str>,
5748    assertion_valid_not_before: Option<&str>,
5749    assertion_valid_not_on_or_after: Option<&str>,
5750    audience: Option<&str>,
5751    authentication_flow: Option<&str>,
5752    authn_context_class_ref_mapping: Option<&str>,
5753    authorization_flow: Option<&str>,
5754    backchannel_application: Option<&str>,
5755    default_name_id_policy: Option<&str>,
5756    default_relay_state: Option<&str>,
5757    digest_algorithm: Option<&str>,
5758    encryption_kp: Option<&str>,
5759    invalidation_flow: Option<&str>,
5760    is_backchannel: Option<bool>,
5761    issuer: Option<&str>,
5762    logout_method: Option<&str>,
5763    name: Option<&str>,
5764    name_id_mapping: Option<&str>,
5765    ordering: Option<&str>,
5766    page: Option<i32>,
5767    page_size: Option<i32>,
5768    property_mappings: Option<Vec<uuid::Uuid>>,
5769    search: Option<&str>,
5770    session_valid_not_on_or_after: Option<&str>,
5771    sign_assertion: Option<bool>,
5772    sign_logout_request: Option<bool>,
5773    sign_response: Option<bool>,
5774    signature_algorithm: Option<&str>,
5775    signing_kp: Option<&str>,
5776    sls_binding: Option<&str>,
5777    sls_url: Option<&str>,
5778    sp_binding: Option<&str>,
5779    verification_kp: Option<&str>,
5780) -> Result<models::PaginatedSamlProviderList, Error<ProvidersSamlListError>> {
5781    // add a prefix to parameters to efficiently prevent name collisions
5782    let p_query_acs_url = acs_url;
5783    let p_query_assertion_valid_not_before = assertion_valid_not_before;
5784    let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after;
5785    let p_query_audience = audience;
5786    let p_query_authentication_flow = authentication_flow;
5787    let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping;
5788    let p_query_authorization_flow = authorization_flow;
5789    let p_query_backchannel_application = backchannel_application;
5790    let p_query_default_name_id_policy = default_name_id_policy;
5791    let p_query_default_relay_state = default_relay_state;
5792    let p_query_digest_algorithm = digest_algorithm;
5793    let p_query_encryption_kp = encryption_kp;
5794    let p_query_invalidation_flow = invalidation_flow;
5795    let p_query_is_backchannel = is_backchannel;
5796    let p_query_issuer = issuer;
5797    let p_query_logout_method = logout_method;
5798    let p_query_name = name;
5799    let p_query_name_id_mapping = name_id_mapping;
5800    let p_query_ordering = ordering;
5801    let p_query_page = page;
5802    let p_query_page_size = page_size;
5803    let p_query_property_mappings = property_mappings;
5804    let p_query_search = search;
5805    let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after;
5806    let p_query_sign_assertion = sign_assertion;
5807    let p_query_sign_logout_request = sign_logout_request;
5808    let p_query_sign_response = sign_response;
5809    let p_query_signature_algorithm = signature_algorithm;
5810    let p_query_signing_kp = signing_kp;
5811    let p_query_sls_binding = sls_binding;
5812    let p_query_sls_url = sls_url;
5813    let p_query_sp_binding = sp_binding;
5814    let p_query_verification_kp = verification_kp;
5815
5816    let uri_str = format!("{}/providers/saml/", configuration.base_path);
5817    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5818
5819    if let Some(ref param_value) = p_query_acs_url {
5820        req_builder = req_builder.query(&[("acs_url", &param_value.to_string())]);
5821    }
5822    if let Some(ref param_value) = p_query_assertion_valid_not_before {
5823        req_builder = req_builder.query(&[("assertion_valid_not_before", &param_value.to_string())]);
5824    }
5825    if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after {
5826        req_builder = req_builder.query(&[("assertion_valid_not_on_or_after", &param_value.to_string())]);
5827    }
5828    if let Some(ref param_value) = p_query_audience {
5829        req_builder = req_builder.query(&[("audience", &param_value.to_string())]);
5830    }
5831    if let Some(ref param_value) = p_query_authentication_flow {
5832        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
5833    }
5834    if let Some(ref param_value) = p_query_authn_context_class_ref_mapping {
5835        req_builder = req_builder.query(&[("authn_context_class_ref_mapping", &param_value.to_string())]);
5836    }
5837    if let Some(ref param_value) = p_query_authorization_flow {
5838        req_builder = req_builder.query(&[("authorization_flow", &param_value.to_string())]);
5839    }
5840    if let Some(ref param_value) = p_query_backchannel_application {
5841        req_builder = req_builder.query(&[("backchannel_application", &param_value.to_string())]);
5842    }
5843    if let Some(ref param_value) = p_query_default_name_id_policy {
5844        req_builder = req_builder.query(&[("default_name_id_policy", &param_value.to_string())]);
5845    }
5846    if let Some(ref param_value) = p_query_default_relay_state {
5847        req_builder = req_builder.query(&[("default_relay_state", &param_value.to_string())]);
5848    }
5849    if let Some(ref param_value) = p_query_digest_algorithm {
5850        req_builder = req_builder.query(&[("digest_algorithm", &param_value.to_string())]);
5851    }
5852    if let Some(ref param_value) = p_query_encryption_kp {
5853        req_builder = req_builder.query(&[("encryption_kp", &param_value.to_string())]);
5854    }
5855    if let Some(ref param_value) = p_query_invalidation_flow {
5856        req_builder = req_builder.query(&[("invalidation_flow", &param_value.to_string())]);
5857    }
5858    if let Some(ref param_value) = p_query_is_backchannel {
5859        req_builder = req_builder.query(&[("is_backchannel", &param_value.to_string())]);
5860    }
5861    if let Some(ref param_value) = p_query_issuer {
5862        req_builder = req_builder.query(&[("issuer", &param_value.to_string())]);
5863    }
5864    if let Some(ref param_value) = p_query_logout_method {
5865        req_builder = req_builder.query(&[("logout_method", &param_value.to_string())]);
5866    }
5867    if let Some(ref param_value) = p_query_name {
5868        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5869    }
5870    if let Some(ref param_value) = p_query_name_id_mapping {
5871        req_builder = req_builder.query(&[("name_id_mapping", &param_value.to_string())]);
5872    }
5873    if let Some(ref param_value) = p_query_ordering {
5874        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5875    }
5876    if let Some(ref param_value) = p_query_page {
5877        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5878    }
5879    if let Some(ref param_value) = p_query_page_size {
5880        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5881    }
5882    if let Some(ref param_value) = p_query_property_mappings {
5883        req_builder = match "multi" {
5884            "multi" => req_builder.query(
5885                &param_value
5886                    .into_iter()
5887                    .map(|p| ("property_mappings".to_owned(), p.to_string()))
5888                    .collect::<Vec<(std::string::String, std::string::String)>>(),
5889            ),
5890            _ => req_builder.query(&[(
5891                "property_mappings",
5892                &param_value
5893                    .into_iter()
5894                    .map(|p| p.to_string())
5895                    .collect::<Vec<String>>()
5896                    .join(",")
5897                    .to_string(),
5898            )]),
5899        };
5900    }
5901    if let Some(ref param_value) = p_query_search {
5902        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5903    }
5904    if let Some(ref param_value) = p_query_session_valid_not_on_or_after {
5905        req_builder = req_builder.query(&[("session_valid_not_on_or_after", &param_value.to_string())]);
5906    }
5907    if let Some(ref param_value) = p_query_sign_assertion {
5908        req_builder = req_builder.query(&[("sign_assertion", &param_value.to_string())]);
5909    }
5910    if let Some(ref param_value) = p_query_sign_logout_request {
5911        req_builder = req_builder.query(&[("sign_logout_request", &param_value.to_string())]);
5912    }
5913    if let Some(ref param_value) = p_query_sign_response {
5914        req_builder = req_builder.query(&[("sign_response", &param_value.to_string())]);
5915    }
5916    if let Some(ref param_value) = p_query_signature_algorithm {
5917        req_builder = req_builder.query(&[("signature_algorithm", &param_value.to_string())]);
5918    }
5919    if let Some(ref param_value) = p_query_signing_kp {
5920        req_builder = req_builder.query(&[("signing_kp", &param_value.to_string())]);
5921    }
5922    if let Some(ref param_value) = p_query_sls_binding {
5923        req_builder = req_builder.query(&[("sls_binding", &param_value.to_string())]);
5924    }
5925    if let Some(ref param_value) = p_query_sls_url {
5926        req_builder = req_builder.query(&[("sls_url", &param_value.to_string())]);
5927    }
5928    if let Some(ref param_value) = p_query_sp_binding {
5929        req_builder = req_builder.query(&[("sp_binding", &param_value.to_string())]);
5930    }
5931    if let Some(ref param_value) = p_query_verification_kp {
5932        req_builder = req_builder.query(&[("verification_kp", &param_value.to_string())]);
5933    }
5934    if let Some(ref user_agent) = configuration.user_agent {
5935        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5936    }
5937    if let Some(ref token) = configuration.bearer_access_token {
5938        req_builder = req_builder.bearer_auth(token.to_owned());
5939    };
5940
5941    let req = req_builder.build()?;
5942    let resp = configuration.client.execute(req).await?;
5943
5944    let status = resp.status();
5945    let content_type = resp
5946        .headers()
5947        .get("content-type")
5948        .and_then(|v| v.to_str().ok())
5949        .unwrap_or("application/octet-stream");
5950    let content_type = super::ContentType::from(content_type);
5951
5952    if !status.is_client_error() && !status.is_server_error() {
5953        let content = resp.text().await?;
5954        match content_type {
5955            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5956            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlProviderList`"))),
5957            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSamlProviderList`")))),
5958        }
5959    } else {
5960        let content = resp.text().await?;
5961        let entity: Option<ProvidersSamlListError> = serde_json::from_str(&content).ok();
5962        Err(Error::ResponseError(ResponseContent {
5963            status,
5964            content,
5965            entity,
5966        }))
5967    }
5968}
5969
5970/// Return metadata as XML string
5971pub async fn providers_saml_metadata_retrieve(
5972    configuration: &configuration::Configuration,
5973    id: i32,
5974    download: Option<bool>,
5975    force_binding: Option<&str>,
5976) -> Result<models::SamlMetadata, Error<ProvidersSamlMetadataRetrieveError>> {
5977    // add a prefix to parameters to efficiently prevent name collisions
5978    let p_path_id = id;
5979    let p_query_download = download;
5980    let p_query_force_binding = force_binding;
5981
5982    let uri_str = format!(
5983        "{}/providers/saml/{id}/metadata/",
5984        configuration.base_path,
5985        id = p_path_id
5986    );
5987    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5988
5989    if let Some(ref param_value) = p_query_download {
5990        req_builder = req_builder.query(&[("download", &param_value.to_string())]);
5991    }
5992    if let Some(ref param_value) = p_query_force_binding {
5993        req_builder = req_builder.query(&[("force_binding", &param_value.to_string())]);
5994    }
5995    if let Some(ref user_agent) = configuration.user_agent {
5996        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5997    }
5998    if let Some(ref token) = configuration.bearer_access_token {
5999        req_builder = req_builder.bearer_auth(token.to_owned());
6000    };
6001
6002    let req = req_builder.build()?;
6003    let resp = configuration.client.execute(req).await?;
6004
6005    let status = resp.status();
6006    let content_type = resp
6007        .headers()
6008        .get("content-type")
6009        .and_then(|v| v.to_str().ok())
6010        .unwrap_or("application/octet-stream");
6011    let content_type = super::ContentType::from(content_type);
6012
6013    if !status.is_client_error() && !status.is_server_error() {
6014        let content = resp.text().await?;
6015        match content_type {
6016            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6017            ContentType::Text => {
6018                return Err(Error::from(serde_json::Error::custom(
6019                    "Received `text/plain` content type response that cannot be converted to `models::SamlMetadata`",
6020                )))
6021            }
6022            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6023                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlMetadata`"
6024            )))),
6025        }
6026    } else {
6027        let content = resp.text().await?;
6028        let entity: Option<ProvidersSamlMetadataRetrieveError> = serde_json::from_str(&content).ok();
6029        Err(Error::ResponseError(ResponseContent {
6030            status,
6031            content,
6032            entity,
6033        }))
6034    }
6035}
6036
6037/// SAMLProvider Viewset
6038pub async fn providers_saml_partial_update(
6039    configuration: &configuration::Configuration,
6040    id: i32,
6041    patched_saml_provider_request: Option<models::PatchedSamlProviderRequest>,
6042) -> Result<models::SamlProvider, Error<ProvidersSamlPartialUpdateError>> {
6043    // add a prefix to parameters to efficiently prevent name collisions
6044    let p_path_id = id;
6045    let p_body_patched_saml_provider_request = patched_saml_provider_request;
6046
6047    let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
6048    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6049
6050    if let Some(ref user_agent) = configuration.user_agent {
6051        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6052    }
6053    if let Some(ref token) = configuration.bearer_access_token {
6054        req_builder = req_builder.bearer_auth(token.to_owned());
6055    };
6056    req_builder = req_builder.json(&p_body_patched_saml_provider_request);
6057
6058    let req = req_builder.build()?;
6059    let resp = configuration.client.execute(req).await?;
6060
6061    let status = resp.status();
6062    let content_type = resp
6063        .headers()
6064        .get("content-type")
6065        .and_then(|v| v.to_str().ok())
6066        .unwrap_or("application/octet-stream");
6067    let content_type = super::ContentType::from(content_type);
6068
6069    if !status.is_client_error() && !status.is_server_error() {
6070        let content = resp.text().await?;
6071        match content_type {
6072            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6073            ContentType::Text => {
6074                return Err(Error::from(serde_json::Error::custom(
6075                    "Received `text/plain` content type response that cannot be converted to `models::SamlProvider`",
6076                )))
6077            }
6078            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6079                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlProvider`"
6080            )))),
6081        }
6082    } else {
6083        let content = resp.text().await?;
6084        let entity: Option<ProvidersSamlPartialUpdateError> = serde_json::from_str(&content).ok();
6085        Err(Error::ResponseError(ResponseContent {
6086            status,
6087            content,
6088            entity,
6089        }))
6090    }
6091}
6092
6093/// Preview user data for provider
6094pub async fn providers_saml_preview_user_retrieve(
6095    configuration: &configuration::Configuration,
6096    id: i32,
6097    for_user: Option<i32>,
6098) -> Result<models::PropertyMappingPreview, Error<ProvidersSamlPreviewUserRetrieveError>> {
6099    // add a prefix to parameters to efficiently prevent name collisions
6100    let p_path_id = id;
6101    let p_query_for_user = for_user;
6102
6103    let uri_str = format!(
6104        "{}/providers/saml/{id}/preview_user/",
6105        configuration.base_path,
6106        id = p_path_id
6107    );
6108    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6109
6110    if let Some(ref param_value) = p_query_for_user {
6111        req_builder = req_builder.query(&[("for_user", &param_value.to_string())]);
6112    }
6113    if let Some(ref user_agent) = configuration.user_agent {
6114        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6115    }
6116    if let Some(ref token) = configuration.bearer_access_token {
6117        req_builder = req_builder.bearer_auth(token.to_owned());
6118    };
6119
6120    let req = req_builder.build()?;
6121    let resp = configuration.client.execute(req).await?;
6122
6123    let status = resp.status();
6124    let content_type = resp
6125        .headers()
6126        .get("content-type")
6127        .and_then(|v| v.to_str().ok())
6128        .unwrap_or("application/octet-stream");
6129    let content_type = super::ContentType::from(content_type);
6130
6131    if !status.is_client_error() && !status.is_server_error() {
6132        let content = resp.text().await?;
6133        match content_type {
6134            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6135            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PropertyMappingPreview`"))),
6136            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PropertyMappingPreview`")))),
6137        }
6138    } else {
6139        let content = resp.text().await?;
6140        let entity: Option<ProvidersSamlPreviewUserRetrieveError> = serde_json::from_str(&content).ok();
6141        Err(Error::ResponseError(ResponseContent {
6142            status,
6143            content,
6144            entity,
6145        }))
6146    }
6147}
6148
6149/// SAMLProvider Viewset
6150pub async fn providers_saml_retrieve(
6151    configuration: &configuration::Configuration,
6152    id: i32,
6153) -> Result<models::SamlProvider, Error<ProvidersSamlRetrieveError>> {
6154    // add a prefix to parameters to efficiently prevent name collisions
6155    let p_path_id = id;
6156
6157    let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
6158    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6159
6160    if let Some(ref user_agent) = configuration.user_agent {
6161        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6162    }
6163    if let Some(ref token) = configuration.bearer_access_token {
6164        req_builder = req_builder.bearer_auth(token.to_owned());
6165    };
6166
6167    let req = req_builder.build()?;
6168    let resp = configuration.client.execute(req).await?;
6169
6170    let status = resp.status();
6171    let content_type = resp
6172        .headers()
6173        .get("content-type")
6174        .and_then(|v| v.to_str().ok())
6175        .unwrap_or("application/octet-stream");
6176    let content_type = super::ContentType::from(content_type);
6177
6178    if !status.is_client_error() && !status.is_server_error() {
6179        let content = resp.text().await?;
6180        match content_type {
6181            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6182            ContentType::Text => {
6183                return Err(Error::from(serde_json::Error::custom(
6184                    "Received `text/plain` content type response that cannot be converted to `models::SamlProvider`",
6185                )))
6186            }
6187            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6188                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlProvider`"
6189            )))),
6190        }
6191    } else {
6192        let content = resp.text().await?;
6193        let entity: Option<ProvidersSamlRetrieveError> = serde_json::from_str(&content).ok();
6194        Err(Error::ResponseError(ResponseContent {
6195            status,
6196            content,
6197            entity,
6198        }))
6199    }
6200}
6201
6202/// SAMLProvider Viewset
6203pub async fn providers_saml_update(
6204    configuration: &configuration::Configuration,
6205    id: i32,
6206    saml_provider_request: models::SamlProviderRequest,
6207) -> Result<models::SamlProvider, Error<ProvidersSamlUpdateError>> {
6208    // add a prefix to parameters to efficiently prevent name collisions
6209    let p_path_id = id;
6210    let p_body_saml_provider_request = saml_provider_request;
6211
6212    let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
6213    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6214
6215    if let Some(ref user_agent) = configuration.user_agent {
6216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6217    }
6218    if let Some(ref token) = configuration.bearer_access_token {
6219        req_builder = req_builder.bearer_auth(token.to_owned());
6220    };
6221    req_builder = req_builder.json(&p_body_saml_provider_request);
6222
6223    let req = req_builder.build()?;
6224    let resp = configuration.client.execute(req).await?;
6225
6226    let status = resp.status();
6227    let content_type = resp
6228        .headers()
6229        .get("content-type")
6230        .and_then(|v| v.to_str().ok())
6231        .unwrap_or("application/octet-stream");
6232    let content_type = super::ContentType::from(content_type);
6233
6234    if !status.is_client_error() && !status.is_server_error() {
6235        let content = resp.text().await?;
6236        match content_type {
6237            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6238            ContentType::Text => {
6239                return Err(Error::from(serde_json::Error::custom(
6240                    "Received `text/plain` content type response that cannot be converted to `models::SamlProvider`",
6241                )))
6242            }
6243            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6244                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlProvider`"
6245            )))),
6246        }
6247    } else {
6248        let content = resp.text().await?;
6249        let entity: Option<ProvidersSamlUpdateError> = serde_json::from_str(&content).ok();
6250        Err(Error::ResponseError(ResponseContent {
6251            status,
6252            content,
6253            entity,
6254        }))
6255    }
6256}
6257
6258/// Get a list of all objects that use this object
6259pub async fn providers_saml_used_by_list(
6260    configuration: &configuration::Configuration,
6261    id: i32,
6262) -> Result<Vec<models::UsedBy>, Error<ProvidersSamlUsedByListError>> {
6263    // add a prefix to parameters to efficiently prevent name collisions
6264    let p_path_id = id;
6265
6266    let uri_str = format!(
6267        "{}/providers/saml/{id}/used_by/",
6268        configuration.base_path,
6269        id = p_path_id
6270    );
6271    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6272
6273    if let Some(ref user_agent) = configuration.user_agent {
6274        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6275    }
6276    if let Some(ref token) = configuration.bearer_access_token {
6277        req_builder = req_builder.bearer_auth(token.to_owned());
6278    };
6279
6280    let req = req_builder.build()?;
6281    let resp = configuration.client.execute(req).await?;
6282
6283    let status = resp.status();
6284    let content_type = resp
6285        .headers()
6286        .get("content-type")
6287        .and_then(|v| v.to_str().ok())
6288        .unwrap_or("application/octet-stream");
6289    let content_type = super::ContentType::from(content_type);
6290
6291    if !status.is_client_error() && !status.is_server_error() {
6292        let content = resp.text().await?;
6293        match content_type {
6294            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6295            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
6296            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
6297        }
6298    } else {
6299        let content = resp.text().await?;
6300        let entity: Option<ProvidersSamlUsedByListError> = serde_json::from_str(&content).ok();
6301        Err(Error::ResponseError(ResponseContent {
6302            status,
6303            content,
6304            entity,
6305        }))
6306    }
6307}
6308
6309/// SCIMProvider Viewset
6310pub async fn providers_scim_create(
6311    configuration: &configuration::Configuration,
6312    scim_provider_request: models::ScimProviderRequest,
6313) -> Result<models::ScimProvider, Error<ProvidersScimCreateError>> {
6314    // add a prefix to parameters to efficiently prevent name collisions
6315    let p_body_scim_provider_request = scim_provider_request;
6316
6317    let uri_str = format!("{}/providers/scim/", configuration.base_path);
6318    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6319
6320    if let Some(ref user_agent) = configuration.user_agent {
6321        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6322    }
6323    if let Some(ref token) = configuration.bearer_access_token {
6324        req_builder = req_builder.bearer_auth(token.to_owned());
6325    };
6326    req_builder = req_builder.json(&p_body_scim_provider_request);
6327
6328    let req = req_builder.build()?;
6329    let resp = configuration.client.execute(req).await?;
6330
6331    let status = resp.status();
6332    let content_type = resp
6333        .headers()
6334        .get("content-type")
6335        .and_then(|v| v.to_str().ok())
6336        .unwrap_or("application/octet-stream");
6337    let content_type = super::ContentType::from(content_type);
6338
6339    if !status.is_client_error() && !status.is_server_error() {
6340        let content = resp.text().await?;
6341        match content_type {
6342            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6343            ContentType::Text => {
6344                return Err(Error::from(serde_json::Error::custom(
6345                    "Received `text/plain` content type response that cannot be converted to `models::ScimProvider`",
6346                )))
6347            }
6348            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6349                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimProvider`"
6350            )))),
6351        }
6352    } else {
6353        let content = resp.text().await?;
6354        let entity: Option<ProvidersScimCreateError> = serde_json::from_str(&content).ok();
6355        Err(Error::ResponseError(ResponseContent {
6356            status,
6357            content,
6358            entity,
6359        }))
6360    }
6361}
6362
6363/// SCIMProvider Viewset
6364pub async fn providers_scim_destroy(
6365    configuration: &configuration::Configuration,
6366    id: i32,
6367) -> Result<(), Error<ProvidersScimDestroyError>> {
6368    // add a prefix to parameters to efficiently prevent name collisions
6369    let p_path_id = id;
6370
6371    let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
6372    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6373
6374    if let Some(ref user_agent) = configuration.user_agent {
6375        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6376    }
6377    if let Some(ref token) = configuration.bearer_access_token {
6378        req_builder = req_builder.bearer_auth(token.to_owned());
6379    };
6380
6381    let req = req_builder.build()?;
6382    let resp = configuration.client.execute(req).await?;
6383
6384    let status = resp.status();
6385
6386    if !status.is_client_error() && !status.is_server_error() {
6387        Ok(())
6388    } else {
6389        let content = resp.text().await?;
6390        let entity: Option<ProvidersScimDestroyError> = serde_json::from_str(&content).ok();
6391        Err(Error::ResponseError(ResponseContent {
6392            status,
6393            content,
6394            entity,
6395        }))
6396    }
6397}
6398
6399/// SCIMProviderGroup Viewset
6400pub async fn providers_scim_groups_create(
6401    configuration: &configuration::Configuration,
6402    scim_provider_group_request: models::ScimProviderGroupRequest,
6403) -> Result<models::ScimProviderGroup, Error<ProvidersScimGroupsCreateError>> {
6404    // add a prefix to parameters to efficiently prevent name collisions
6405    let p_body_scim_provider_group_request = scim_provider_group_request;
6406
6407    let uri_str = format!("{}/providers/scim_groups/", configuration.base_path);
6408    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6409
6410    if let Some(ref user_agent) = configuration.user_agent {
6411        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6412    }
6413    if let Some(ref token) = configuration.bearer_access_token {
6414        req_builder = req_builder.bearer_auth(token.to_owned());
6415    };
6416    req_builder = req_builder.json(&p_body_scim_provider_group_request);
6417
6418    let req = req_builder.build()?;
6419    let resp = configuration.client.execute(req).await?;
6420
6421    let status = resp.status();
6422    let content_type = resp
6423        .headers()
6424        .get("content-type")
6425        .and_then(|v| v.to_str().ok())
6426        .unwrap_or("application/octet-stream");
6427    let content_type = super::ContentType::from(content_type);
6428
6429    if !status.is_client_error() && !status.is_server_error() {
6430        let content = resp.text().await?;
6431        match content_type {
6432            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6433            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimProviderGroup`"))),
6434            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimProviderGroup`")))),
6435        }
6436    } else {
6437        let content = resp.text().await?;
6438        let entity: Option<ProvidersScimGroupsCreateError> = serde_json::from_str(&content).ok();
6439        Err(Error::ResponseError(ResponseContent {
6440            status,
6441            content,
6442            entity,
6443        }))
6444    }
6445}
6446
6447/// SCIMProviderGroup Viewset
6448pub async fn providers_scim_groups_destroy(
6449    configuration: &configuration::Configuration,
6450    id: &str,
6451) -> Result<(), Error<ProvidersScimGroupsDestroyError>> {
6452    // add a prefix to parameters to efficiently prevent name collisions
6453    let p_path_id = id;
6454
6455    let uri_str = format!(
6456        "{}/providers/scim_groups/{id}/",
6457        configuration.base_path,
6458        id = crate::apis::urlencode(p_path_id)
6459    );
6460    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6461
6462    if let Some(ref user_agent) = configuration.user_agent {
6463        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6464    }
6465    if let Some(ref token) = configuration.bearer_access_token {
6466        req_builder = req_builder.bearer_auth(token.to_owned());
6467    };
6468
6469    let req = req_builder.build()?;
6470    let resp = configuration.client.execute(req).await?;
6471
6472    let status = resp.status();
6473
6474    if !status.is_client_error() && !status.is_server_error() {
6475        Ok(())
6476    } else {
6477        let content = resp.text().await?;
6478        let entity: Option<ProvidersScimGroupsDestroyError> = serde_json::from_str(&content).ok();
6479        Err(Error::ResponseError(ResponseContent {
6480            status,
6481            content,
6482            entity,
6483        }))
6484    }
6485}
6486
6487/// SCIMProviderGroup Viewset
6488pub async fn providers_scim_groups_list(
6489    configuration: &configuration::Configuration,
6490    group__group_uuid: Option<&str>,
6491    group__name: Option<&str>,
6492    ordering: Option<&str>,
6493    page: Option<i32>,
6494    page_size: Option<i32>,
6495    provider__id: Option<i32>,
6496    search: Option<&str>,
6497) -> Result<models::PaginatedScimProviderGroupList, Error<ProvidersScimGroupsListError>> {
6498    // add a prefix to parameters to efficiently prevent name collisions
6499    let p_query_group__group_uuid = group__group_uuid;
6500    let p_query_group__name = group__name;
6501    let p_query_ordering = ordering;
6502    let p_query_page = page;
6503    let p_query_page_size = page_size;
6504    let p_query_provider__id = provider__id;
6505    let p_query_search = search;
6506
6507    let uri_str = format!("{}/providers/scim_groups/", configuration.base_path);
6508    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6509
6510    if let Some(ref param_value) = p_query_group__group_uuid {
6511        req_builder = req_builder.query(&[("group__group_uuid", &param_value.to_string())]);
6512    }
6513    if let Some(ref param_value) = p_query_group__name {
6514        req_builder = req_builder.query(&[("group__name", &param_value.to_string())]);
6515    }
6516    if let Some(ref param_value) = p_query_ordering {
6517        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
6518    }
6519    if let Some(ref param_value) = p_query_page {
6520        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
6521    }
6522    if let Some(ref param_value) = p_query_page_size {
6523        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
6524    }
6525    if let Some(ref param_value) = p_query_provider__id {
6526        req_builder = req_builder.query(&[("provider__id", &param_value.to_string())]);
6527    }
6528    if let Some(ref param_value) = p_query_search {
6529        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
6530    }
6531    if let Some(ref user_agent) = configuration.user_agent {
6532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6533    }
6534    if let Some(ref token) = configuration.bearer_access_token {
6535        req_builder = req_builder.bearer_auth(token.to_owned());
6536    };
6537
6538    let req = req_builder.build()?;
6539    let resp = configuration.client.execute(req).await?;
6540
6541    let status = resp.status();
6542    let content_type = resp
6543        .headers()
6544        .get("content-type")
6545        .and_then(|v| v.to_str().ok())
6546        .unwrap_or("application/octet-stream");
6547    let content_type = super::ContentType::from(content_type);
6548
6549    if !status.is_client_error() && !status.is_server_error() {
6550        let content = resp.text().await?;
6551        match content_type {
6552            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6553            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimProviderGroupList`"))),
6554            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimProviderGroupList`")))),
6555        }
6556    } else {
6557        let content = resp.text().await?;
6558        let entity: Option<ProvidersScimGroupsListError> = serde_json::from_str(&content).ok();
6559        Err(Error::ResponseError(ResponseContent {
6560            status,
6561            content,
6562            entity,
6563        }))
6564    }
6565}
6566
6567/// SCIMProviderGroup Viewset
6568pub async fn providers_scim_groups_retrieve(
6569    configuration: &configuration::Configuration,
6570    id: &str,
6571) -> Result<models::ScimProviderGroup, Error<ProvidersScimGroupsRetrieveError>> {
6572    // add a prefix to parameters to efficiently prevent name collisions
6573    let p_path_id = id;
6574
6575    let uri_str = format!(
6576        "{}/providers/scim_groups/{id}/",
6577        configuration.base_path,
6578        id = crate::apis::urlencode(p_path_id)
6579    );
6580    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6581
6582    if let Some(ref user_agent) = configuration.user_agent {
6583        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6584    }
6585    if let Some(ref token) = configuration.bearer_access_token {
6586        req_builder = req_builder.bearer_auth(token.to_owned());
6587    };
6588
6589    let req = req_builder.build()?;
6590    let resp = configuration.client.execute(req).await?;
6591
6592    let status = resp.status();
6593    let content_type = resp
6594        .headers()
6595        .get("content-type")
6596        .and_then(|v| v.to_str().ok())
6597        .unwrap_or("application/octet-stream");
6598    let content_type = super::ContentType::from(content_type);
6599
6600    if !status.is_client_error() && !status.is_server_error() {
6601        let content = resp.text().await?;
6602        match content_type {
6603            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6604            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimProviderGroup`"))),
6605            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimProviderGroup`")))),
6606        }
6607    } else {
6608        let content = resp.text().await?;
6609        let entity: Option<ProvidersScimGroupsRetrieveError> = serde_json::from_str(&content).ok();
6610        Err(Error::ResponseError(ResponseContent {
6611            status,
6612            content,
6613            entity,
6614        }))
6615    }
6616}
6617
6618/// Get a list of all objects that use this object
6619pub async fn providers_scim_groups_used_by_list(
6620    configuration: &configuration::Configuration,
6621    id: &str,
6622) -> Result<Vec<models::UsedBy>, Error<ProvidersScimGroupsUsedByListError>> {
6623    // add a prefix to parameters to efficiently prevent name collisions
6624    let p_path_id = id;
6625
6626    let uri_str = format!(
6627        "{}/providers/scim_groups/{id}/used_by/",
6628        configuration.base_path,
6629        id = crate::apis::urlencode(p_path_id)
6630    );
6631    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6632
6633    if let Some(ref user_agent) = configuration.user_agent {
6634        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6635    }
6636    if let Some(ref token) = configuration.bearer_access_token {
6637        req_builder = req_builder.bearer_auth(token.to_owned());
6638    };
6639
6640    let req = req_builder.build()?;
6641    let resp = configuration.client.execute(req).await?;
6642
6643    let status = resp.status();
6644    let content_type = resp
6645        .headers()
6646        .get("content-type")
6647        .and_then(|v| v.to_str().ok())
6648        .unwrap_or("application/octet-stream");
6649    let content_type = super::ContentType::from(content_type);
6650
6651    if !status.is_client_error() && !status.is_server_error() {
6652        let content = resp.text().await?;
6653        match content_type {
6654            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6655            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
6656            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
6657        }
6658    } else {
6659        let content = resp.text().await?;
6660        let entity: Option<ProvidersScimGroupsUsedByListError> = serde_json::from_str(&content).ok();
6661        Err(Error::ResponseError(ResponseContent {
6662            status,
6663            content,
6664            entity,
6665        }))
6666    }
6667}
6668
6669/// SCIMProvider Viewset
6670pub async fn providers_scim_list(
6671    configuration: &configuration::Configuration,
6672    exclude_users_service_account: Option<bool>,
6673    filter_group: Option<&str>,
6674    name: Option<&str>,
6675    ordering: Option<&str>,
6676    page: Option<i32>,
6677    page_size: Option<i32>,
6678    search: Option<&str>,
6679    url: Option<&str>,
6680) -> Result<models::PaginatedScimProviderList, Error<ProvidersScimListError>> {
6681    // add a prefix to parameters to efficiently prevent name collisions
6682    let p_query_exclude_users_service_account = exclude_users_service_account;
6683    let p_query_filter_group = filter_group;
6684    let p_query_name = name;
6685    let p_query_ordering = ordering;
6686    let p_query_page = page;
6687    let p_query_page_size = page_size;
6688    let p_query_search = search;
6689    let p_query_url = url;
6690
6691    let uri_str = format!("{}/providers/scim/", configuration.base_path);
6692    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6693
6694    if let Some(ref param_value) = p_query_exclude_users_service_account {
6695        req_builder = req_builder.query(&[("exclude_users_service_account", &param_value.to_string())]);
6696    }
6697    if let Some(ref param_value) = p_query_filter_group {
6698        req_builder = req_builder.query(&[("filter_group", &param_value.to_string())]);
6699    }
6700    if let Some(ref param_value) = p_query_name {
6701        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
6702    }
6703    if let Some(ref param_value) = p_query_ordering {
6704        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
6705    }
6706    if let Some(ref param_value) = p_query_page {
6707        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
6708    }
6709    if let Some(ref param_value) = p_query_page_size {
6710        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
6711    }
6712    if let Some(ref param_value) = p_query_search {
6713        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
6714    }
6715    if let Some(ref param_value) = p_query_url {
6716        req_builder = req_builder.query(&[("url", &param_value.to_string())]);
6717    }
6718    if let Some(ref user_agent) = configuration.user_agent {
6719        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6720    }
6721    if let Some(ref token) = configuration.bearer_access_token {
6722        req_builder = req_builder.bearer_auth(token.to_owned());
6723    };
6724
6725    let req = req_builder.build()?;
6726    let resp = configuration.client.execute(req).await?;
6727
6728    let status = resp.status();
6729    let content_type = resp
6730        .headers()
6731        .get("content-type")
6732        .and_then(|v| v.to_str().ok())
6733        .unwrap_or("application/octet-stream");
6734    let content_type = super::ContentType::from(content_type);
6735
6736    if !status.is_client_error() && !status.is_server_error() {
6737        let content = resp.text().await?;
6738        match content_type {
6739            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6740            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimProviderList`"))),
6741            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimProviderList`")))),
6742        }
6743    } else {
6744        let content = resp.text().await?;
6745        let entity: Option<ProvidersScimListError> = serde_json::from_str(&content).ok();
6746        Err(Error::ResponseError(ResponseContent {
6747            status,
6748            content,
6749            entity,
6750        }))
6751    }
6752}
6753
6754/// SCIMProvider Viewset
6755pub async fn providers_scim_partial_update(
6756    configuration: &configuration::Configuration,
6757    id: i32,
6758    patched_scim_provider_request: Option<models::PatchedScimProviderRequest>,
6759) -> Result<models::ScimProvider, Error<ProvidersScimPartialUpdateError>> {
6760    // add a prefix to parameters to efficiently prevent name collisions
6761    let p_path_id = id;
6762    let p_body_patched_scim_provider_request = patched_scim_provider_request;
6763
6764    let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
6765    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6766
6767    if let Some(ref user_agent) = configuration.user_agent {
6768        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6769    }
6770    if let Some(ref token) = configuration.bearer_access_token {
6771        req_builder = req_builder.bearer_auth(token.to_owned());
6772    };
6773    req_builder = req_builder.json(&p_body_patched_scim_provider_request);
6774
6775    let req = req_builder.build()?;
6776    let resp = configuration.client.execute(req).await?;
6777
6778    let status = resp.status();
6779    let content_type = resp
6780        .headers()
6781        .get("content-type")
6782        .and_then(|v| v.to_str().ok())
6783        .unwrap_or("application/octet-stream");
6784    let content_type = super::ContentType::from(content_type);
6785
6786    if !status.is_client_error() && !status.is_server_error() {
6787        let content = resp.text().await?;
6788        match content_type {
6789            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6790            ContentType::Text => {
6791                return Err(Error::from(serde_json::Error::custom(
6792                    "Received `text/plain` content type response that cannot be converted to `models::ScimProvider`",
6793                )))
6794            }
6795            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6796                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimProvider`"
6797            )))),
6798        }
6799    } else {
6800        let content = resp.text().await?;
6801        let entity: Option<ProvidersScimPartialUpdateError> = serde_json::from_str(&content).ok();
6802        Err(Error::ResponseError(ResponseContent {
6803            status,
6804            content,
6805            entity,
6806        }))
6807    }
6808}
6809
6810/// SCIMProvider Viewset
6811pub async fn providers_scim_retrieve(
6812    configuration: &configuration::Configuration,
6813    id: i32,
6814) -> Result<models::ScimProvider, Error<ProvidersScimRetrieveError>> {
6815    // add a prefix to parameters to efficiently prevent name collisions
6816    let p_path_id = id;
6817
6818    let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
6819    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6820
6821    if let Some(ref user_agent) = configuration.user_agent {
6822        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6823    }
6824    if let Some(ref token) = configuration.bearer_access_token {
6825        req_builder = req_builder.bearer_auth(token.to_owned());
6826    };
6827
6828    let req = req_builder.build()?;
6829    let resp = configuration.client.execute(req).await?;
6830
6831    let status = resp.status();
6832    let content_type = resp
6833        .headers()
6834        .get("content-type")
6835        .and_then(|v| v.to_str().ok())
6836        .unwrap_or("application/octet-stream");
6837    let content_type = super::ContentType::from(content_type);
6838
6839    if !status.is_client_error() && !status.is_server_error() {
6840        let content = resp.text().await?;
6841        match content_type {
6842            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6843            ContentType::Text => {
6844                return Err(Error::from(serde_json::Error::custom(
6845                    "Received `text/plain` content type response that cannot be converted to `models::ScimProvider`",
6846                )))
6847            }
6848            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6849                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimProvider`"
6850            )))),
6851        }
6852    } else {
6853        let content = resp.text().await?;
6854        let entity: Option<ProvidersScimRetrieveError> = serde_json::from_str(&content).ok();
6855        Err(Error::ResponseError(ResponseContent {
6856            status,
6857            content,
6858            entity,
6859        }))
6860    }
6861}
6862
6863/// Sync/Re-sync a single user/group object
6864pub async fn providers_scim_sync_object_create(
6865    configuration: &configuration::Configuration,
6866    id: i32,
6867    sync_object_request: models::SyncObjectRequest,
6868) -> Result<models::SyncObjectResult, Error<ProvidersScimSyncObjectCreateError>> {
6869    // add a prefix to parameters to efficiently prevent name collisions
6870    let p_path_id = id;
6871    let p_body_sync_object_request = sync_object_request;
6872
6873    let uri_str = format!(
6874        "{}/providers/scim/{id}/sync/object/",
6875        configuration.base_path,
6876        id = p_path_id
6877    );
6878    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6879
6880    if let Some(ref user_agent) = configuration.user_agent {
6881        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6882    }
6883    if let Some(ref token) = configuration.bearer_access_token {
6884        req_builder = req_builder.bearer_auth(token.to_owned());
6885    };
6886    req_builder = req_builder.json(&p_body_sync_object_request);
6887
6888    let req = req_builder.build()?;
6889    let resp = configuration.client.execute(req).await?;
6890
6891    let status = resp.status();
6892    let content_type = resp
6893        .headers()
6894        .get("content-type")
6895        .and_then(|v| v.to_str().ok())
6896        .unwrap_or("application/octet-stream");
6897    let content_type = super::ContentType::from(content_type);
6898
6899    if !status.is_client_error() && !status.is_server_error() {
6900        let content = resp.text().await?;
6901        match content_type {
6902            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6903            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncObjectResult`"))),
6904            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncObjectResult`")))),
6905        }
6906    } else {
6907        let content = resp.text().await?;
6908        let entity: Option<ProvidersScimSyncObjectCreateError> = serde_json::from_str(&content).ok();
6909        Err(Error::ResponseError(ResponseContent {
6910            status,
6911            content,
6912            entity,
6913        }))
6914    }
6915}
6916
6917/// Get provider's sync status
6918pub async fn providers_scim_sync_status_retrieve(
6919    configuration: &configuration::Configuration,
6920    id: i32,
6921) -> Result<models::SyncStatus, Error<ProvidersScimSyncStatusRetrieveError>> {
6922    // add a prefix to parameters to efficiently prevent name collisions
6923    let p_path_id = id;
6924
6925    let uri_str = format!(
6926        "{}/providers/scim/{id}/sync/status/",
6927        configuration.base_path,
6928        id = p_path_id
6929    );
6930    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6931
6932    if let Some(ref user_agent) = configuration.user_agent {
6933        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6934    }
6935    if let Some(ref token) = configuration.bearer_access_token {
6936        req_builder = req_builder.bearer_auth(token.to_owned());
6937    };
6938
6939    let req = req_builder.build()?;
6940    let resp = configuration.client.execute(req).await?;
6941
6942    let status = resp.status();
6943    let content_type = resp
6944        .headers()
6945        .get("content-type")
6946        .and_then(|v| v.to_str().ok())
6947        .unwrap_or("application/octet-stream");
6948    let content_type = super::ContentType::from(content_type);
6949
6950    if !status.is_client_error() && !status.is_server_error() {
6951        let content = resp.text().await?;
6952        match content_type {
6953            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6954            ContentType::Text => {
6955                return Err(Error::from(serde_json::Error::custom(
6956                    "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
6957                )))
6958            }
6959            ContentType::Unsupported(unknown_type) => {
6960                return Err(Error::from(serde_json::Error::custom(format!(
6961                    "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
6962                ))))
6963            }
6964        }
6965    } else {
6966        let content = resp.text().await?;
6967        let entity: Option<ProvidersScimSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
6968        Err(Error::ResponseError(ResponseContent {
6969            status,
6970            content,
6971            entity,
6972        }))
6973    }
6974}
6975
6976/// SCIMProvider Viewset
6977pub async fn providers_scim_update(
6978    configuration: &configuration::Configuration,
6979    id: i32,
6980    scim_provider_request: models::ScimProviderRequest,
6981) -> Result<models::ScimProvider, Error<ProvidersScimUpdateError>> {
6982    // add a prefix to parameters to efficiently prevent name collisions
6983    let p_path_id = id;
6984    let p_body_scim_provider_request = scim_provider_request;
6985
6986    let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
6987    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6988
6989    if let Some(ref user_agent) = configuration.user_agent {
6990        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6991    }
6992    if let Some(ref token) = configuration.bearer_access_token {
6993        req_builder = req_builder.bearer_auth(token.to_owned());
6994    };
6995    req_builder = req_builder.json(&p_body_scim_provider_request);
6996
6997    let req = req_builder.build()?;
6998    let resp = configuration.client.execute(req).await?;
6999
7000    let status = resp.status();
7001    let content_type = resp
7002        .headers()
7003        .get("content-type")
7004        .and_then(|v| v.to_str().ok())
7005        .unwrap_or("application/octet-stream");
7006    let content_type = super::ContentType::from(content_type);
7007
7008    if !status.is_client_error() && !status.is_server_error() {
7009        let content = resp.text().await?;
7010        match content_type {
7011            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7012            ContentType::Text => {
7013                return Err(Error::from(serde_json::Error::custom(
7014                    "Received `text/plain` content type response that cannot be converted to `models::ScimProvider`",
7015                )))
7016            }
7017            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7018                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimProvider`"
7019            )))),
7020        }
7021    } else {
7022        let content = resp.text().await?;
7023        let entity: Option<ProvidersScimUpdateError> = serde_json::from_str(&content).ok();
7024        Err(Error::ResponseError(ResponseContent {
7025            status,
7026            content,
7027            entity,
7028        }))
7029    }
7030}
7031
7032/// Get a list of all objects that use this object
7033pub async fn providers_scim_used_by_list(
7034    configuration: &configuration::Configuration,
7035    id: i32,
7036) -> Result<Vec<models::UsedBy>, Error<ProvidersScimUsedByListError>> {
7037    // add a prefix to parameters to efficiently prevent name collisions
7038    let p_path_id = id;
7039
7040    let uri_str = format!(
7041        "{}/providers/scim/{id}/used_by/",
7042        configuration.base_path,
7043        id = p_path_id
7044    );
7045    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7046
7047    if let Some(ref user_agent) = configuration.user_agent {
7048        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7049    }
7050    if let Some(ref token) = configuration.bearer_access_token {
7051        req_builder = req_builder.bearer_auth(token.to_owned());
7052    };
7053
7054    let req = req_builder.build()?;
7055    let resp = configuration.client.execute(req).await?;
7056
7057    let status = resp.status();
7058    let content_type = resp
7059        .headers()
7060        .get("content-type")
7061        .and_then(|v| v.to_str().ok())
7062        .unwrap_or("application/octet-stream");
7063    let content_type = super::ContentType::from(content_type);
7064
7065    if !status.is_client_error() && !status.is_server_error() {
7066        let content = resp.text().await?;
7067        match content_type {
7068            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7069            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
7070            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
7071        }
7072    } else {
7073        let content = resp.text().await?;
7074        let entity: Option<ProvidersScimUsedByListError> = serde_json::from_str(&content).ok();
7075        Err(Error::ResponseError(ResponseContent {
7076            status,
7077            content,
7078            entity,
7079        }))
7080    }
7081}
7082
7083/// SCIMProviderUser Viewset
7084pub async fn providers_scim_users_create(
7085    configuration: &configuration::Configuration,
7086    scim_provider_user_request: models::ScimProviderUserRequest,
7087) -> Result<models::ScimProviderUser, Error<ProvidersScimUsersCreateError>> {
7088    // add a prefix to parameters to efficiently prevent name collisions
7089    let p_body_scim_provider_user_request = scim_provider_user_request;
7090
7091    let uri_str = format!("{}/providers/scim_users/", configuration.base_path);
7092    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7093
7094    if let Some(ref user_agent) = configuration.user_agent {
7095        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7096    }
7097    if let Some(ref token) = configuration.bearer_access_token {
7098        req_builder = req_builder.bearer_auth(token.to_owned());
7099    };
7100    req_builder = req_builder.json(&p_body_scim_provider_user_request);
7101
7102    let req = req_builder.build()?;
7103    let resp = configuration.client.execute(req).await?;
7104
7105    let status = resp.status();
7106    let content_type = resp
7107        .headers()
7108        .get("content-type")
7109        .and_then(|v| v.to_str().ok())
7110        .unwrap_or("application/octet-stream");
7111    let content_type = super::ContentType::from(content_type);
7112
7113    if !status.is_client_error() && !status.is_server_error() {
7114        let content = resp.text().await?;
7115        match content_type {
7116            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7117            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimProviderUser`"))),
7118            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimProviderUser`")))),
7119        }
7120    } else {
7121        let content = resp.text().await?;
7122        let entity: Option<ProvidersScimUsersCreateError> = serde_json::from_str(&content).ok();
7123        Err(Error::ResponseError(ResponseContent {
7124            status,
7125            content,
7126            entity,
7127        }))
7128    }
7129}
7130
7131/// SCIMProviderUser Viewset
7132pub async fn providers_scim_users_destroy(
7133    configuration: &configuration::Configuration,
7134    id: &str,
7135) -> Result<(), Error<ProvidersScimUsersDestroyError>> {
7136    // add a prefix to parameters to efficiently prevent name collisions
7137    let p_path_id = id;
7138
7139    let uri_str = format!(
7140        "{}/providers/scim_users/{id}/",
7141        configuration.base_path,
7142        id = crate::apis::urlencode(p_path_id)
7143    );
7144    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7145
7146    if let Some(ref user_agent) = configuration.user_agent {
7147        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7148    }
7149    if let Some(ref token) = configuration.bearer_access_token {
7150        req_builder = req_builder.bearer_auth(token.to_owned());
7151    };
7152
7153    let req = req_builder.build()?;
7154    let resp = configuration.client.execute(req).await?;
7155
7156    let status = resp.status();
7157
7158    if !status.is_client_error() && !status.is_server_error() {
7159        Ok(())
7160    } else {
7161        let content = resp.text().await?;
7162        let entity: Option<ProvidersScimUsersDestroyError> = serde_json::from_str(&content).ok();
7163        Err(Error::ResponseError(ResponseContent {
7164            status,
7165            content,
7166            entity,
7167        }))
7168    }
7169}
7170
7171/// SCIMProviderUser Viewset
7172pub async fn providers_scim_users_list(
7173    configuration: &configuration::Configuration,
7174    ordering: Option<&str>,
7175    page: Option<i32>,
7176    page_size: Option<i32>,
7177    provider__id: Option<i32>,
7178    search: Option<&str>,
7179    user__id: Option<i32>,
7180    user__username: Option<&str>,
7181) -> Result<models::PaginatedScimProviderUserList, Error<ProvidersScimUsersListError>> {
7182    // add a prefix to parameters to efficiently prevent name collisions
7183    let p_query_ordering = ordering;
7184    let p_query_page = page;
7185    let p_query_page_size = page_size;
7186    let p_query_provider__id = provider__id;
7187    let p_query_search = search;
7188    let p_query_user__id = user__id;
7189    let p_query_user__username = user__username;
7190
7191    let uri_str = format!("{}/providers/scim_users/", configuration.base_path);
7192    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7193
7194    if let Some(ref param_value) = p_query_ordering {
7195        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7196    }
7197    if let Some(ref param_value) = p_query_page {
7198        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7199    }
7200    if let Some(ref param_value) = p_query_page_size {
7201        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7202    }
7203    if let Some(ref param_value) = p_query_provider__id {
7204        req_builder = req_builder.query(&[("provider__id", &param_value.to_string())]);
7205    }
7206    if let Some(ref param_value) = p_query_search {
7207        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7208    }
7209    if let Some(ref param_value) = p_query_user__id {
7210        req_builder = req_builder.query(&[("user__id", &param_value.to_string())]);
7211    }
7212    if let Some(ref param_value) = p_query_user__username {
7213        req_builder = req_builder.query(&[("user__username", &param_value.to_string())]);
7214    }
7215    if let Some(ref user_agent) = configuration.user_agent {
7216        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7217    }
7218    if let Some(ref token) = configuration.bearer_access_token {
7219        req_builder = req_builder.bearer_auth(token.to_owned());
7220    };
7221
7222    let req = req_builder.build()?;
7223    let resp = configuration.client.execute(req).await?;
7224
7225    let status = resp.status();
7226    let content_type = resp
7227        .headers()
7228        .get("content-type")
7229        .and_then(|v| v.to_str().ok())
7230        .unwrap_or("application/octet-stream");
7231    let content_type = super::ContentType::from(content_type);
7232
7233    if !status.is_client_error() && !status.is_server_error() {
7234        let content = resp.text().await?;
7235        match content_type {
7236            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7237            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimProviderUserList`"))),
7238            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimProviderUserList`")))),
7239        }
7240    } else {
7241        let content = resp.text().await?;
7242        let entity: Option<ProvidersScimUsersListError> = serde_json::from_str(&content).ok();
7243        Err(Error::ResponseError(ResponseContent {
7244            status,
7245            content,
7246            entity,
7247        }))
7248    }
7249}
7250
7251/// SCIMProviderUser Viewset
7252pub async fn providers_scim_users_retrieve(
7253    configuration: &configuration::Configuration,
7254    id: &str,
7255) -> Result<models::ScimProviderUser, Error<ProvidersScimUsersRetrieveError>> {
7256    // add a prefix to parameters to efficiently prevent name collisions
7257    let p_path_id = id;
7258
7259    let uri_str = format!(
7260        "{}/providers/scim_users/{id}/",
7261        configuration.base_path,
7262        id = crate::apis::urlencode(p_path_id)
7263    );
7264    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7265
7266    if let Some(ref user_agent) = configuration.user_agent {
7267        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7268    }
7269    if let Some(ref token) = configuration.bearer_access_token {
7270        req_builder = req_builder.bearer_auth(token.to_owned());
7271    };
7272
7273    let req = req_builder.build()?;
7274    let resp = configuration.client.execute(req).await?;
7275
7276    let status = resp.status();
7277    let content_type = resp
7278        .headers()
7279        .get("content-type")
7280        .and_then(|v| v.to_str().ok())
7281        .unwrap_or("application/octet-stream");
7282    let content_type = super::ContentType::from(content_type);
7283
7284    if !status.is_client_error() && !status.is_server_error() {
7285        let content = resp.text().await?;
7286        match content_type {
7287            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7288            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimProviderUser`"))),
7289            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimProviderUser`")))),
7290        }
7291    } else {
7292        let content = resp.text().await?;
7293        let entity: Option<ProvidersScimUsersRetrieveError> = serde_json::from_str(&content).ok();
7294        Err(Error::ResponseError(ResponseContent {
7295            status,
7296            content,
7297            entity,
7298        }))
7299    }
7300}
7301
7302/// Get a list of all objects that use this object
7303pub async fn providers_scim_users_used_by_list(
7304    configuration: &configuration::Configuration,
7305    id: &str,
7306) -> Result<Vec<models::UsedBy>, Error<ProvidersScimUsersUsedByListError>> {
7307    // add a prefix to parameters to efficiently prevent name collisions
7308    let p_path_id = id;
7309
7310    let uri_str = format!(
7311        "{}/providers/scim_users/{id}/used_by/",
7312        configuration.base_path,
7313        id = crate::apis::urlencode(p_path_id)
7314    );
7315    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7316
7317    if let Some(ref user_agent) = configuration.user_agent {
7318        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7319    }
7320    if let Some(ref token) = configuration.bearer_access_token {
7321        req_builder = req_builder.bearer_auth(token.to_owned());
7322    };
7323
7324    let req = req_builder.build()?;
7325    let resp = configuration.client.execute(req).await?;
7326
7327    let status = resp.status();
7328    let content_type = resp
7329        .headers()
7330        .get("content-type")
7331        .and_then(|v| v.to_str().ok())
7332        .unwrap_or("application/octet-stream");
7333    let content_type = super::ContentType::from(content_type);
7334
7335    if !status.is_client_error() && !status.is_server_error() {
7336        let content = resp.text().await?;
7337        match content_type {
7338            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7339            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
7340            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
7341        }
7342    } else {
7343        let content = resp.text().await?;
7344        let entity: Option<ProvidersScimUsersUsedByListError> = serde_json::from_str(&content).ok();
7345        Err(Error::ResponseError(ResponseContent {
7346            status,
7347            content,
7348            entity,
7349        }))
7350    }
7351}
7352
7353/// SSFProvider Viewset
7354pub async fn providers_ssf_create(
7355    configuration: &configuration::Configuration,
7356    ssf_provider_request: models::SsfProviderRequest,
7357) -> Result<models::SsfProvider, Error<ProvidersSsfCreateError>> {
7358    // add a prefix to parameters to efficiently prevent name collisions
7359    let p_body_ssf_provider_request = ssf_provider_request;
7360
7361    let uri_str = format!("{}/providers/ssf/", configuration.base_path);
7362    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7363
7364    if let Some(ref user_agent) = configuration.user_agent {
7365        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7366    }
7367    if let Some(ref token) = configuration.bearer_access_token {
7368        req_builder = req_builder.bearer_auth(token.to_owned());
7369    };
7370    req_builder = req_builder.json(&p_body_ssf_provider_request);
7371
7372    let req = req_builder.build()?;
7373    let resp = configuration.client.execute(req).await?;
7374
7375    let status = resp.status();
7376    let content_type = resp
7377        .headers()
7378        .get("content-type")
7379        .and_then(|v| v.to_str().ok())
7380        .unwrap_or("application/octet-stream");
7381    let content_type = super::ContentType::from(content_type);
7382
7383    if !status.is_client_error() && !status.is_server_error() {
7384        let content = resp.text().await?;
7385        match content_type {
7386            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7387            ContentType::Text => {
7388                return Err(Error::from(serde_json::Error::custom(
7389                    "Received `text/plain` content type response that cannot be converted to `models::SsfProvider`",
7390                )))
7391            }
7392            ContentType::Unsupported(unknown_type) => {
7393                return Err(Error::from(serde_json::Error::custom(format!(
7394                    "Received `{unknown_type}` content type response that cannot be converted to `models::SsfProvider`"
7395                ))))
7396            }
7397        }
7398    } else {
7399        let content = resp.text().await?;
7400        let entity: Option<ProvidersSsfCreateError> = serde_json::from_str(&content).ok();
7401        Err(Error::ResponseError(ResponseContent {
7402            status,
7403            content,
7404            entity,
7405        }))
7406    }
7407}
7408
7409/// SSFProvider Viewset
7410pub async fn providers_ssf_destroy(
7411    configuration: &configuration::Configuration,
7412    id: i32,
7413) -> Result<(), Error<ProvidersSsfDestroyError>> {
7414    // add a prefix to parameters to efficiently prevent name collisions
7415    let p_path_id = id;
7416
7417    let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
7418    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7419
7420    if let Some(ref user_agent) = configuration.user_agent {
7421        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7422    }
7423    if let Some(ref token) = configuration.bearer_access_token {
7424        req_builder = req_builder.bearer_auth(token.to_owned());
7425    };
7426
7427    let req = req_builder.build()?;
7428    let resp = configuration.client.execute(req).await?;
7429
7430    let status = resp.status();
7431
7432    if !status.is_client_error() && !status.is_server_error() {
7433        Ok(())
7434    } else {
7435        let content = resp.text().await?;
7436        let entity: Option<ProvidersSsfDestroyError> = serde_json::from_str(&content).ok();
7437        Err(Error::ResponseError(ResponseContent {
7438            status,
7439            content,
7440            entity,
7441        }))
7442    }
7443}
7444
7445/// SSFProvider Viewset
7446pub async fn providers_ssf_list(
7447    configuration: &configuration::Configuration,
7448    application__isnull: Option<bool>,
7449    name__iexact: Option<&str>,
7450    ordering: Option<&str>,
7451    page: Option<i32>,
7452    page_size: Option<i32>,
7453    search: Option<&str>,
7454) -> Result<models::PaginatedSsfProviderList, Error<ProvidersSsfListError>> {
7455    // add a prefix to parameters to efficiently prevent name collisions
7456    let p_query_application__isnull = application__isnull;
7457    let p_query_name__iexact = name__iexact;
7458    let p_query_ordering = ordering;
7459    let p_query_page = page;
7460    let p_query_page_size = page_size;
7461    let p_query_search = search;
7462
7463    let uri_str = format!("{}/providers/ssf/", configuration.base_path);
7464    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7465
7466    if let Some(ref param_value) = p_query_application__isnull {
7467        req_builder = req_builder.query(&[("application__isnull", &param_value.to_string())]);
7468    }
7469    if let Some(ref param_value) = p_query_name__iexact {
7470        req_builder = req_builder.query(&[("name__iexact", &param_value.to_string())]);
7471    }
7472    if let Some(ref param_value) = p_query_ordering {
7473        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7474    }
7475    if let Some(ref param_value) = p_query_page {
7476        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7477    }
7478    if let Some(ref param_value) = p_query_page_size {
7479        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7480    }
7481    if let Some(ref param_value) = p_query_search {
7482        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7483    }
7484    if let Some(ref user_agent) = configuration.user_agent {
7485        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7486    }
7487    if let Some(ref token) = configuration.bearer_access_token {
7488        req_builder = req_builder.bearer_auth(token.to_owned());
7489    };
7490
7491    let req = req_builder.build()?;
7492    let resp = configuration.client.execute(req).await?;
7493
7494    let status = resp.status();
7495    let content_type = resp
7496        .headers()
7497        .get("content-type")
7498        .and_then(|v| v.to_str().ok())
7499        .unwrap_or("application/octet-stream");
7500    let content_type = super::ContentType::from(content_type);
7501
7502    if !status.is_client_error() && !status.is_server_error() {
7503        let content = resp.text().await?;
7504        match content_type {
7505            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7506            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSsfProviderList`"))),
7507            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSsfProviderList`")))),
7508        }
7509    } else {
7510        let content = resp.text().await?;
7511        let entity: Option<ProvidersSsfListError> = serde_json::from_str(&content).ok();
7512        Err(Error::ResponseError(ResponseContent {
7513            status,
7514            content,
7515            entity,
7516        }))
7517    }
7518}
7519
7520/// SSFProvider Viewset
7521pub async fn providers_ssf_partial_update(
7522    configuration: &configuration::Configuration,
7523    id: i32,
7524    patched_ssf_provider_request: Option<models::PatchedSsfProviderRequest>,
7525) -> Result<models::SsfProvider, Error<ProvidersSsfPartialUpdateError>> {
7526    // add a prefix to parameters to efficiently prevent name collisions
7527    let p_path_id = id;
7528    let p_body_patched_ssf_provider_request = patched_ssf_provider_request;
7529
7530    let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
7531    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7532
7533    if let Some(ref user_agent) = configuration.user_agent {
7534        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7535    }
7536    if let Some(ref token) = configuration.bearer_access_token {
7537        req_builder = req_builder.bearer_auth(token.to_owned());
7538    };
7539    req_builder = req_builder.json(&p_body_patched_ssf_provider_request);
7540
7541    let req = req_builder.build()?;
7542    let resp = configuration.client.execute(req).await?;
7543
7544    let status = resp.status();
7545    let content_type = resp
7546        .headers()
7547        .get("content-type")
7548        .and_then(|v| v.to_str().ok())
7549        .unwrap_or("application/octet-stream");
7550    let content_type = super::ContentType::from(content_type);
7551
7552    if !status.is_client_error() && !status.is_server_error() {
7553        let content = resp.text().await?;
7554        match content_type {
7555            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7556            ContentType::Text => {
7557                return Err(Error::from(serde_json::Error::custom(
7558                    "Received `text/plain` content type response that cannot be converted to `models::SsfProvider`",
7559                )))
7560            }
7561            ContentType::Unsupported(unknown_type) => {
7562                return Err(Error::from(serde_json::Error::custom(format!(
7563                    "Received `{unknown_type}` content type response that cannot be converted to `models::SsfProvider`"
7564                ))))
7565            }
7566        }
7567    } else {
7568        let content = resp.text().await?;
7569        let entity: Option<ProvidersSsfPartialUpdateError> = serde_json::from_str(&content).ok();
7570        Err(Error::ResponseError(ResponseContent {
7571            status,
7572            content,
7573            entity,
7574        }))
7575    }
7576}
7577
7578/// SSFProvider Viewset
7579pub async fn providers_ssf_retrieve(
7580    configuration: &configuration::Configuration,
7581    id: i32,
7582) -> Result<models::SsfProvider, Error<ProvidersSsfRetrieveError>> {
7583    // add a prefix to parameters to efficiently prevent name collisions
7584    let p_path_id = id;
7585
7586    let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
7587    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7588
7589    if let Some(ref user_agent) = configuration.user_agent {
7590        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7591    }
7592    if let Some(ref token) = configuration.bearer_access_token {
7593        req_builder = req_builder.bearer_auth(token.to_owned());
7594    };
7595
7596    let req = req_builder.build()?;
7597    let resp = configuration.client.execute(req).await?;
7598
7599    let status = resp.status();
7600    let content_type = resp
7601        .headers()
7602        .get("content-type")
7603        .and_then(|v| v.to_str().ok())
7604        .unwrap_or("application/octet-stream");
7605    let content_type = super::ContentType::from(content_type);
7606
7607    if !status.is_client_error() && !status.is_server_error() {
7608        let content = resp.text().await?;
7609        match content_type {
7610            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7611            ContentType::Text => {
7612                return Err(Error::from(serde_json::Error::custom(
7613                    "Received `text/plain` content type response that cannot be converted to `models::SsfProvider`",
7614                )))
7615            }
7616            ContentType::Unsupported(unknown_type) => {
7617                return Err(Error::from(serde_json::Error::custom(format!(
7618                    "Received `{unknown_type}` content type response that cannot be converted to `models::SsfProvider`"
7619                ))))
7620            }
7621        }
7622    } else {
7623        let content = resp.text().await?;
7624        let entity: Option<ProvidersSsfRetrieveError> = serde_json::from_str(&content).ok();
7625        Err(Error::ResponseError(ResponseContent {
7626            status,
7627            content,
7628            entity,
7629        }))
7630    }
7631}
7632
7633/// SSFProvider Viewset
7634pub async fn providers_ssf_update(
7635    configuration: &configuration::Configuration,
7636    id: i32,
7637    ssf_provider_request: models::SsfProviderRequest,
7638) -> Result<models::SsfProvider, Error<ProvidersSsfUpdateError>> {
7639    // add a prefix to parameters to efficiently prevent name collisions
7640    let p_path_id = id;
7641    let p_body_ssf_provider_request = ssf_provider_request;
7642
7643    let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
7644    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7645
7646    if let Some(ref user_agent) = configuration.user_agent {
7647        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7648    }
7649    if let Some(ref token) = configuration.bearer_access_token {
7650        req_builder = req_builder.bearer_auth(token.to_owned());
7651    };
7652    req_builder = req_builder.json(&p_body_ssf_provider_request);
7653
7654    let req = req_builder.build()?;
7655    let resp = configuration.client.execute(req).await?;
7656
7657    let status = resp.status();
7658    let content_type = resp
7659        .headers()
7660        .get("content-type")
7661        .and_then(|v| v.to_str().ok())
7662        .unwrap_or("application/octet-stream");
7663    let content_type = super::ContentType::from(content_type);
7664
7665    if !status.is_client_error() && !status.is_server_error() {
7666        let content = resp.text().await?;
7667        match content_type {
7668            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7669            ContentType::Text => {
7670                return Err(Error::from(serde_json::Error::custom(
7671                    "Received `text/plain` content type response that cannot be converted to `models::SsfProvider`",
7672                )))
7673            }
7674            ContentType::Unsupported(unknown_type) => {
7675                return Err(Error::from(serde_json::Error::custom(format!(
7676                    "Received `{unknown_type}` content type response that cannot be converted to `models::SsfProvider`"
7677                ))))
7678            }
7679        }
7680    } else {
7681        let content = resp.text().await?;
7682        let entity: Option<ProvidersSsfUpdateError> = serde_json::from_str(&content).ok();
7683        Err(Error::ResponseError(ResponseContent {
7684            status,
7685            content,
7686            entity,
7687        }))
7688    }
7689}
7690
7691/// Get a list of all objects that use this object
7692pub async fn providers_ssf_used_by_list(
7693    configuration: &configuration::Configuration,
7694    id: i32,
7695) -> Result<Vec<models::UsedBy>, Error<ProvidersSsfUsedByListError>> {
7696    // add a prefix to parameters to efficiently prevent name collisions
7697    let p_path_id = id;
7698
7699    let uri_str = format!(
7700        "{}/providers/ssf/{id}/used_by/",
7701        configuration.base_path,
7702        id = p_path_id
7703    );
7704    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7705
7706    if let Some(ref user_agent) = configuration.user_agent {
7707        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7708    }
7709    if let Some(ref token) = configuration.bearer_access_token {
7710        req_builder = req_builder.bearer_auth(token.to_owned());
7711    };
7712
7713    let req = req_builder.build()?;
7714    let resp = configuration.client.execute(req).await?;
7715
7716    let status = resp.status();
7717    let content_type = resp
7718        .headers()
7719        .get("content-type")
7720        .and_then(|v| v.to_str().ok())
7721        .unwrap_or("application/octet-stream");
7722    let content_type = super::ContentType::from(content_type);
7723
7724    if !status.is_client_error() && !status.is_server_error() {
7725        let content = resp.text().await?;
7726        match content_type {
7727            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7728            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
7729            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
7730        }
7731    } else {
7732        let content = resp.text().await?;
7733        let entity: Option<ProvidersSsfUsedByListError> = serde_json::from_str(&content).ok();
7734        Err(Error::ResponseError(ResponseContent {
7735            status,
7736            content,
7737            entity,
7738        }))
7739    }
7740}