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