Skip to main content

authentik_client/apis/
providers_api.rs

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