authentik_client/apis/
sources_api.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.8.4
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15use tokio::fs::File as TokioFile;
16use tokio_util::codec::{BytesCodec, FramedRead};
17
18/// struct for typed errors of method [`sources_all_destroy`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum SourcesAllDestroyError {
22    Status400(models::ValidationError),
23    Status403(models::GenericError),
24    UnknownValue(serde_json::Value),
25}
26
27/// struct for typed errors of method [`sources_all_list`]
28#[derive(Debug, Clone, Serialize, Deserialize)]
29#[serde(untagged)]
30pub enum SourcesAllListError {
31    Status400(models::ValidationError),
32    Status403(models::GenericError),
33    UnknownValue(serde_json::Value),
34}
35
36/// struct for typed errors of method [`sources_all_retrieve`]
37#[derive(Debug, Clone, Serialize, Deserialize)]
38#[serde(untagged)]
39pub enum SourcesAllRetrieveError {
40    Status400(models::ValidationError),
41    Status403(models::GenericError),
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`sources_all_set_icon_create`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum SourcesAllSetIconCreateError {
49    Status400(),
50    Status403(models::GenericError),
51    UnknownValue(serde_json::Value),
52}
53
54/// struct for typed errors of method [`sources_all_set_icon_url_create`]
55#[derive(Debug, Clone, Serialize, Deserialize)]
56#[serde(untagged)]
57pub enum SourcesAllSetIconUrlCreateError {
58    Status400(),
59    Status403(models::GenericError),
60    UnknownValue(serde_json::Value),
61}
62
63/// struct for typed errors of method [`sources_all_types_list`]
64#[derive(Debug, Clone, Serialize, Deserialize)]
65#[serde(untagged)]
66pub enum SourcesAllTypesListError {
67    Status400(models::ValidationError),
68    Status403(models::GenericError),
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`sources_all_used_by_list`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum SourcesAllUsedByListError {
76    Status400(models::ValidationError),
77    Status403(models::GenericError),
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`sources_all_user_settings_list`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum SourcesAllUserSettingsListError {
85    Status400(models::ValidationError),
86    Status403(models::GenericError),
87    UnknownValue(serde_json::Value),
88}
89
90/// struct for typed errors of method [`sources_group_connections_all_destroy`]
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum SourcesGroupConnectionsAllDestroyError {
94    Status400(models::ValidationError),
95    Status403(models::GenericError),
96    UnknownValue(serde_json::Value),
97}
98
99/// struct for typed errors of method [`sources_group_connections_all_list`]
100#[derive(Debug, Clone, Serialize, Deserialize)]
101#[serde(untagged)]
102pub enum SourcesGroupConnectionsAllListError {
103    Status400(models::ValidationError),
104    Status403(models::GenericError),
105    UnknownValue(serde_json::Value),
106}
107
108/// struct for typed errors of method [`sources_group_connections_all_partial_update`]
109#[derive(Debug, Clone, Serialize, Deserialize)]
110#[serde(untagged)]
111pub enum SourcesGroupConnectionsAllPartialUpdateError {
112    Status400(models::ValidationError),
113    Status403(models::GenericError),
114    UnknownValue(serde_json::Value),
115}
116
117/// struct for typed errors of method [`sources_group_connections_all_retrieve`]
118#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum SourcesGroupConnectionsAllRetrieveError {
121    Status400(models::ValidationError),
122    Status403(models::GenericError),
123    UnknownValue(serde_json::Value),
124}
125
126/// struct for typed errors of method [`sources_group_connections_all_update`]
127#[derive(Debug, Clone, Serialize, Deserialize)]
128#[serde(untagged)]
129pub enum SourcesGroupConnectionsAllUpdateError {
130    Status400(models::ValidationError),
131    Status403(models::GenericError),
132    UnknownValue(serde_json::Value),
133}
134
135/// struct for typed errors of method [`sources_group_connections_all_used_by_list`]
136#[derive(Debug, Clone, Serialize, Deserialize)]
137#[serde(untagged)]
138pub enum SourcesGroupConnectionsAllUsedByListError {
139    Status400(models::ValidationError),
140    Status403(models::GenericError),
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`sources_group_connections_kerberos_create`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum SourcesGroupConnectionsKerberosCreateError {
148    Status400(models::ValidationError),
149    Status403(models::GenericError),
150    UnknownValue(serde_json::Value),
151}
152
153/// struct for typed errors of method [`sources_group_connections_kerberos_destroy`]
154#[derive(Debug, Clone, Serialize, Deserialize)]
155#[serde(untagged)]
156pub enum SourcesGroupConnectionsKerberosDestroyError {
157    Status400(models::ValidationError),
158    Status403(models::GenericError),
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`sources_group_connections_kerberos_list`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum SourcesGroupConnectionsKerberosListError {
166    Status400(models::ValidationError),
167    Status403(models::GenericError),
168    UnknownValue(serde_json::Value),
169}
170
171/// struct for typed errors of method [`sources_group_connections_kerberos_partial_update`]
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum SourcesGroupConnectionsKerberosPartialUpdateError {
175    Status400(models::ValidationError),
176    Status403(models::GenericError),
177    UnknownValue(serde_json::Value),
178}
179
180/// struct for typed errors of method [`sources_group_connections_kerberos_retrieve`]
181#[derive(Debug, Clone, Serialize, Deserialize)]
182#[serde(untagged)]
183pub enum SourcesGroupConnectionsKerberosRetrieveError {
184    Status400(models::ValidationError),
185    Status403(models::GenericError),
186    UnknownValue(serde_json::Value),
187}
188
189/// struct for typed errors of method [`sources_group_connections_kerberos_update`]
190#[derive(Debug, Clone, Serialize, Deserialize)]
191#[serde(untagged)]
192pub enum SourcesGroupConnectionsKerberosUpdateError {
193    Status400(models::ValidationError),
194    Status403(models::GenericError),
195    UnknownValue(serde_json::Value),
196}
197
198/// struct for typed errors of method [`sources_group_connections_kerberos_used_by_list`]
199#[derive(Debug, Clone, Serialize, Deserialize)]
200#[serde(untagged)]
201pub enum SourcesGroupConnectionsKerberosUsedByListError {
202    Status400(models::ValidationError),
203    Status403(models::GenericError),
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`sources_group_connections_ldap_create`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum SourcesGroupConnectionsLdapCreateError {
211    Status400(models::ValidationError),
212    Status403(models::GenericError),
213    UnknownValue(serde_json::Value),
214}
215
216/// struct for typed errors of method [`sources_group_connections_ldap_destroy`]
217#[derive(Debug, Clone, Serialize, Deserialize)]
218#[serde(untagged)]
219pub enum SourcesGroupConnectionsLdapDestroyError {
220    Status400(models::ValidationError),
221    Status403(models::GenericError),
222    UnknownValue(serde_json::Value),
223}
224
225/// struct for typed errors of method [`sources_group_connections_ldap_list`]
226#[derive(Debug, Clone, Serialize, Deserialize)]
227#[serde(untagged)]
228pub enum SourcesGroupConnectionsLdapListError {
229    Status400(models::ValidationError),
230    Status403(models::GenericError),
231    UnknownValue(serde_json::Value),
232}
233
234/// struct for typed errors of method [`sources_group_connections_ldap_partial_update`]
235#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum SourcesGroupConnectionsLdapPartialUpdateError {
238    Status400(models::ValidationError),
239    Status403(models::GenericError),
240    UnknownValue(serde_json::Value),
241}
242
243/// struct for typed errors of method [`sources_group_connections_ldap_retrieve`]
244#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum SourcesGroupConnectionsLdapRetrieveError {
247    Status400(models::ValidationError),
248    Status403(models::GenericError),
249    UnknownValue(serde_json::Value),
250}
251
252/// struct for typed errors of method [`sources_group_connections_ldap_update`]
253#[derive(Debug, Clone, Serialize, Deserialize)]
254#[serde(untagged)]
255pub enum SourcesGroupConnectionsLdapUpdateError {
256    Status400(models::ValidationError),
257    Status403(models::GenericError),
258    UnknownValue(serde_json::Value),
259}
260
261/// struct for typed errors of method [`sources_group_connections_ldap_used_by_list`]
262#[derive(Debug, Clone, Serialize, Deserialize)]
263#[serde(untagged)]
264pub enum SourcesGroupConnectionsLdapUsedByListError {
265    Status400(models::ValidationError),
266    Status403(models::GenericError),
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`sources_group_connections_oauth_create`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum SourcesGroupConnectionsOauthCreateError {
274    Status400(models::ValidationError),
275    Status403(models::GenericError),
276    UnknownValue(serde_json::Value),
277}
278
279/// struct for typed errors of method [`sources_group_connections_oauth_destroy`]
280#[derive(Debug, Clone, Serialize, Deserialize)]
281#[serde(untagged)]
282pub enum SourcesGroupConnectionsOauthDestroyError {
283    Status400(models::ValidationError),
284    Status403(models::GenericError),
285    UnknownValue(serde_json::Value),
286}
287
288/// struct for typed errors of method [`sources_group_connections_oauth_list`]
289#[derive(Debug, Clone, Serialize, Deserialize)]
290#[serde(untagged)]
291pub enum SourcesGroupConnectionsOauthListError {
292    Status400(models::ValidationError),
293    Status403(models::GenericError),
294    UnknownValue(serde_json::Value),
295}
296
297/// struct for typed errors of method [`sources_group_connections_oauth_partial_update`]
298#[derive(Debug, Clone, Serialize, Deserialize)]
299#[serde(untagged)]
300pub enum SourcesGroupConnectionsOauthPartialUpdateError {
301    Status400(models::ValidationError),
302    Status403(models::GenericError),
303    UnknownValue(serde_json::Value),
304}
305
306/// struct for typed errors of method [`sources_group_connections_oauth_retrieve`]
307#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum SourcesGroupConnectionsOauthRetrieveError {
310    Status400(models::ValidationError),
311    Status403(models::GenericError),
312    UnknownValue(serde_json::Value),
313}
314
315/// struct for typed errors of method [`sources_group_connections_oauth_update`]
316#[derive(Debug, Clone, Serialize, Deserialize)]
317#[serde(untagged)]
318pub enum SourcesGroupConnectionsOauthUpdateError {
319    Status400(models::ValidationError),
320    Status403(models::GenericError),
321    UnknownValue(serde_json::Value),
322}
323
324/// struct for typed errors of method [`sources_group_connections_oauth_used_by_list`]
325#[derive(Debug, Clone, Serialize, Deserialize)]
326#[serde(untagged)]
327pub enum SourcesGroupConnectionsOauthUsedByListError {
328    Status400(models::ValidationError),
329    Status403(models::GenericError),
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`sources_group_connections_plex_create`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum SourcesGroupConnectionsPlexCreateError {
337    Status400(models::ValidationError),
338    Status403(models::GenericError),
339    UnknownValue(serde_json::Value),
340}
341
342/// struct for typed errors of method [`sources_group_connections_plex_destroy`]
343#[derive(Debug, Clone, Serialize, Deserialize)]
344#[serde(untagged)]
345pub enum SourcesGroupConnectionsPlexDestroyError {
346    Status400(models::ValidationError),
347    Status403(models::GenericError),
348    UnknownValue(serde_json::Value),
349}
350
351/// struct for typed errors of method [`sources_group_connections_plex_list`]
352#[derive(Debug, Clone, Serialize, Deserialize)]
353#[serde(untagged)]
354pub enum SourcesGroupConnectionsPlexListError {
355    Status400(models::ValidationError),
356    Status403(models::GenericError),
357    UnknownValue(serde_json::Value),
358}
359
360/// struct for typed errors of method [`sources_group_connections_plex_partial_update`]
361#[derive(Debug, Clone, Serialize, Deserialize)]
362#[serde(untagged)]
363pub enum SourcesGroupConnectionsPlexPartialUpdateError {
364    Status400(models::ValidationError),
365    Status403(models::GenericError),
366    UnknownValue(serde_json::Value),
367}
368
369/// struct for typed errors of method [`sources_group_connections_plex_retrieve`]
370#[derive(Debug, Clone, Serialize, Deserialize)]
371#[serde(untagged)]
372pub enum SourcesGroupConnectionsPlexRetrieveError {
373    Status400(models::ValidationError),
374    Status403(models::GenericError),
375    UnknownValue(serde_json::Value),
376}
377
378/// struct for typed errors of method [`sources_group_connections_plex_update`]
379#[derive(Debug, Clone, Serialize, Deserialize)]
380#[serde(untagged)]
381pub enum SourcesGroupConnectionsPlexUpdateError {
382    Status400(models::ValidationError),
383    Status403(models::GenericError),
384    UnknownValue(serde_json::Value),
385}
386
387/// struct for typed errors of method [`sources_group_connections_plex_used_by_list`]
388#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum SourcesGroupConnectionsPlexUsedByListError {
391    Status400(models::ValidationError),
392    Status403(models::GenericError),
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`sources_group_connections_saml_create`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum SourcesGroupConnectionsSamlCreateError {
400    Status400(models::ValidationError),
401    Status403(models::GenericError),
402    UnknownValue(serde_json::Value),
403}
404
405/// struct for typed errors of method [`sources_group_connections_saml_destroy`]
406#[derive(Debug, Clone, Serialize, Deserialize)]
407#[serde(untagged)]
408pub enum SourcesGroupConnectionsSamlDestroyError {
409    Status400(models::ValidationError),
410    Status403(models::GenericError),
411    UnknownValue(serde_json::Value),
412}
413
414/// struct for typed errors of method [`sources_group_connections_saml_list`]
415#[derive(Debug, Clone, Serialize, Deserialize)]
416#[serde(untagged)]
417pub enum SourcesGroupConnectionsSamlListError {
418    Status400(models::ValidationError),
419    Status403(models::GenericError),
420    UnknownValue(serde_json::Value),
421}
422
423/// struct for typed errors of method [`sources_group_connections_saml_partial_update`]
424#[derive(Debug, Clone, Serialize, Deserialize)]
425#[serde(untagged)]
426pub enum SourcesGroupConnectionsSamlPartialUpdateError {
427    Status400(models::ValidationError),
428    Status403(models::GenericError),
429    UnknownValue(serde_json::Value),
430}
431
432/// struct for typed errors of method [`sources_group_connections_saml_retrieve`]
433#[derive(Debug, Clone, Serialize, Deserialize)]
434#[serde(untagged)]
435pub enum SourcesGroupConnectionsSamlRetrieveError {
436    Status400(models::ValidationError),
437    Status403(models::GenericError),
438    UnknownValue(serde_json::Value),
439}
440
441/// struct for typed errors of method [`sources_group_connections_saml_update`]
442#[derive(Debug, Clone, Serialize, Deserialize)]
443#[serde(untagged)]
444pub enum SourcesGroupConnectionsSamlUpdateError {
445    Status400(models::ValidationError),
446    Status403(models::GenericError),
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`sources_group_connections_saml_used_by_list`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum SourcesGroupConnectionsSamlUsedByListError {
454    Status400(models::ValidationError),
455    Status403(models::GenericError),
456    UnknownValue(serde_json::Value),
457}
458
459/// struct for typed errors of method [`sources_kerberos_create`]
460#[derive(Debug, Clone, Serialize, Deserialize)]
461#[serde(untagged)]
462pub enum SourcesKerberosCreateError {
463    Status400(models::ValidationError),
464    Status403(models::GenericError),
465    UnknownValue(serde_json::Value),
466}
467
468/// struct for typed errors of method [`sources_kerberos_destroy`]
469#[derive(Debug, Clone, Serialize, Deserialize)]
470#[serde(untagged)]
471pub enum SourcesKerberosDestroyError {
472    Status400(models::ValidationError),
473    Status403(models::GenericError),
474    UnknownValue(serde_json::Value),
475}
476
477/// struct for typed errors of method [`sources_kerberos_list`]
478#[derive(Debug, Clone, Serialize, Deserialize)]
479#[serde(untagged)]
480pub enum SourcesKerberosListError {
481    Status400(models::ValidationError),
482    Status403(models::GenericError),
483    UnknownValue(serde_json::Value),
484}
485
486/// struct for typed errors of method [`sources_kerberos_partial_update`]
487#[derive(Debug, Clone, Serialize, Deserialize)]
488#[serde(untagged)]
489pub enum SourcesKerberosPartialUpdateError {
490    Status400(models::ValidationError),
491    Status403(models::GenericError),
492    UnknownValue(serde_json::Value),
493}
494
495/// struct for typed errors of method [`sources_kerberos_retrieve`]
496#[derive(Debug, Clone, Serialize, Deserialize)]
497#[serde(untagged)]
498pub enum SourcesKerberosRetrieveError {
499    Status400(models::ValidationError),
500    Status403(models::GenericError),
501    UnknownValue(serde_json::Value),
502}
503
504/// struct for typed errors of method [`sources_kerberos_sync_status_retrieve`]
505#[derive(Debug, Clone, Serialize, Deserialize)]
506#[serde(untagged)]
507pub enum SourcesKerberosSyncStatusRetrieveError {
508    Status400(models::ValidationError),
509    Status403(models::GenericError),
510    UnknownValue(serde_json::Value),
511}
512
513/// struct for typed errors of method [`sources_kerberos_update`]
514#[derive(Debug, Clone, Serialize, Deserialize)]
515#[serde(untagged)]
516pub enum SourcesKerberosUpdateError {
517    Status400(models::ValidationError),
518    Status403(models::GenericError),
519    UnknownValue(serde_json::Value),
520}
521
522/// struct for typed errors of method [`sources_kerberos_used_by_list`]
523#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum SourcesKerberosUsedByListError {
526    Status400(models::ValidationError),
527    Status403(models::GenericError),
528    UnknownValue(serde_json::Value),
529}
530
531/// struct for typed errors of method [`sources_ldap_create`]
532#[derive(Debug, Clone, Serialize, Deserialize)]
533#[serde(untagged)]
534pub enum SourcesLdapCreateError {
535    Status400(models::ValidationError),
536    Status403(models::GenericError),
537    UnknownValue(serde_json::Value),
538}
539
540/// struct for typed errors of method [`sources_ldap_debug_retrieve`]
541#[derive(Debug, Clone, Serialize, Deserialize)]
542#[serde(untagged)]
543pub enum SourcesLdapDebugRetrieveError {
544    Status400(models::ValidationError),
545    Status403(models::GenericError),
546    UnknownValue(serde_json::Value),
547}
548
549/// struct for typed errors of method [`sources_ldap_destroy`]
550#[derive(Debug, Clone, Serialize, Deserialize)]
551#[serde(untagged)]
552pub enum SourcesLdapDestroyError {
553    Status400(models::ValidationError),
554    Status403(models::GenericError),
555    UnknownValue(serde_json::Value),
556}
557
558/// struct for typed errors of method [`sources_ldap_list`]
559#[derive(Debug, Clone, Serialize, Deserialize)]
560#[serde(untagged)]
561pub enum SourcesLdapListError {
562    Status400(models::ValidationError),
563    Status403(models::GenericError),
564    UnknownValue(serde_json::Value),
565}
566
567/// struct for typed errors of method [`sources_ldap_partial_update`]
568#[derive(Debug, Clone, Serialize, Deserialize)]
569#[serde(untagged)]
570pub enum SourcesLdapPartialUpdateError {
571    Status400(models::ValidationError),
572    Status403(models::GenericError),
573    UnknownValue(serde_json::Value),
574}
575
576/// struct for typed errors of method [`sources_ldap_retrieve`]
577#[derive(Debug, Clone, Serialize, Deserialize)]
578#[serde(untagged)]
579pub enum SourcesLdapRetrieveError {
580    Status400(models::ValidationError),
581    Status403(models::GenericError),
582    UnknownValue(serde_json::Value),
583}
584
585/// struct for typed errors of method [`sources_ldap_sync_status_retrieve`]
586#[derive(Debug, Clone, Serialize, Deserialize)]
587#[serde(untagged)]
588pub enum SourcesLdapSyncStatusRetrieveError {
589    Status400(models::ValidationError),
590    Status403(models::GenericError),
591    UnknownValue(serde_json::Value),
592}
593
594/// struct for typed errors of method [`sources_ldap_update`]
595#[derive(Debug, Clone, Serialize, Deserialize)]
596#[serde(untagged)]
597pub enum SourcesLdapUpdateError {
598    Status400(models::ValidationError),
599    Status403(models::GenericError),
600    UnknownValue(serde_json::Value),
601}
602
603/// struct for typed errors of method [`sources_ldap_used_by_list`]
604#[derive(Debug, Clone, Serialize, Deserialize)]
605#[serde(untagged)]
606pub enum SourcesLdapUsedByListError {
607    Status400(models::ValidationError),
608    Status403(models::GenericError),
609    UnknownValue(serde_json::Value),
610}
611
612/// struct for typed errors of method [`sources_oauth_create`]
613#[derive(Debug, Clone, Serialize, Deserialize)]
614#[serde(untagged)]
615pub enum SourcesOauthCreateError {
616    Status400(models::ValidationError),
617    Status403(models::GenericError),
618    UnknownValue(serde_json::Value),
619}
620
621/// struct for typed errors of method [`sources_oauth_destroy`]
622#[derive(Debug, Clone, Serialize, Deserialize)]
623#[serde(untagged)]
624pub enum SourcesOauthDestroyError {
625    Status400(models::ValidationError),
626    Status403(models::GenericError),
627    UnknownValue(serde_json::Value),
628}
629
630/// struct for typed errors of method [`sources_oauth_list`]
631#[derive(Debug, Clone, Serialize, Deserialize)]
632#[serde(untagged)]
633pub enum SourcesOauthListError {
634    Status400(models::ValidationError),
635    Status403(models::GenericError),
636    UnknownValue(serde_json::Value),
637}
638
639/// struct for typed errors of method [`sources_oauth_partial_update`]
640#[derive(Debug, Clone, Serialize, Deserialize)]
641#[serde(untagged)]
642pub enum SourcesOauthPartialUpdateError {
643    Status400(models::ValidationError),
644    Status403(models::GenericError),
645    UnknownValue(serde_json::Value),
646}
647
648/// struct for typed errors of method [`sources_oauth_retrieve`]
649#[derive(Debug, Clone, Serialize, Deserialize)]
650#[serde(untagged)]
651pub enum SourcesOauthRetrieveError {
652    Status400(models::ValidationError),
653    Status403(models::GenericError),
654    UnknownValue(serde_json::Value),
655}
656
657/// struct for typed errors of method [`sources_oauth_source_types_list`]
658#[derive(Debug, Clone, Serialize, Deserialize)]
659#[serde(untagged)]
660pub enum SourcesOauthSourceTypesListError {
661    Status400(models::ValidationError),
662    Status403(models::GenericError),
663    UnknownValue(serde_json::Value),
664}
665
666/// struct for typed errors of method [`sources_oauth_update`]
667#[derive(Debug, Clone, Serialize, Deserialize)]
668#[serde(untagged)]
669pub enum SourcesOauthUpdateError {
670    Status400(models::ValidationError),
671    Status403(models::GenericError),
672    UnknownValue(serde_json::Value),
673}
674
675/// struct for typed errors of method [`sources_oauth_used_by_list`]
676#[derive(Debug, Clone, Serialize, Deserialize)]
677#[serde(untagged)]
678pub enum SourcesOauthUsedByListError {
679    Status400(models::ValidationError),
680    Status403(models::GenericError),
681    UnknownValue(serde_json::Value),
682}
683
684/// struct for typed errors of method [`sources_plex_create`]
685#[derive(Debug, Clone, Serialize, Deserialize)]
686#[serde(untagged)]
687pub enum SourcesPlexCreateError {
688    Status400(models::ValidationError),
689    Status403(models::GenericError),
690    UnknownValue(serde_json::Value),
691}
692
693/// struct for typed errors of method [`sources_plex_destroy`]
694#[derive(Debug, Clone, Serialize, Deserialize)]
695#[serde(untagged)]
696pub enum SourcesPlexDestroyError {
697    Status400(models::ValidationError),
698    Status403(models::GenericError),
699    UnknownValue(serde_json::Value),
700}
701
702/// struct for typed errors of method [`sources_plex_list`]
703#[derive(Debug, Clone, Serialize, Deserialize)]
704#[serde(untagged)]
705pub enum SourcesPlexListError {
706    Status400(models::ValidationError),
707    Status403(models::GenericError),
708    UnknownValue(serde_json::Value),
709}
710
711/// struct for typed errors of method [`sources_plex_partial_update`]
712#[derive(Debug, Clone, Serialize, Deserialize)]
713#[serde(untagged)]
714pub enum SourcesPlexPartialUpdateError {
715    Status400(models::ValidationError),
716    Status403(models::GenericError),
717    UnknownValue(serde_json::Value),
718}
719
720/// struct for typed errors of method [`sources_plex_redeem_token_authenticated_create`]
721#[derive(Debug, Clone, Serialize, Deserialize)]
722#[serde(untagged)]
723pub enum SourcesPlexRedeemTokenAuthenticatedCreateError {
724    Status400(),
725    Status403(),
726    UnknownValue(serde_json::Value),
727}
728
729/// struct for typed errors of method [`sources_plex_redeem_token_create`]
730#[derive(Debug, Clone, Serialize, Deserialize)]
731#[serde(untagged)]
732pub enum SourcesPlexRedeemTokenCreateError {
733    Status400(),
734    Status403(),
735    UnknownValue(serde_json::Value),
736}
737
738/// struct for typed errors of method [`sources_plex_retrieve`]
739#[derive(Debug, Clone, Serialize, Deserialize)]
740#[serde(untagged)]
741pub enum SourcesPlexRetrieveError {
742    Status400(models::ValidationError),
743    Status403(models::GenericError),
744    UnknownValue(serde_json::Value),
745}
746
747/// struct for typed errors of method [`sources_plex_update`]
748#[derive(Debug, Clone, Serialize, Deserialize)]
749#[serde(untagged)]
750pub enum SourcesPlexUpdateError {
751    Status400(models::ValidationError),
752    Status403(models::GenericError),
753    UnknownValue(serde_json::Value),
754}
755
756/// struct for typed errors of method [`sources_plex_used_by_list`]
757#[derive(Debug, Clone, Serialize, Deserialize)]
758#[serde(untagged)]
759pub enum SourcesPlexUsedByListError {
760    Status400(models::ValidationError),
761    Status403(models::GenericError),
762    UnknownValue(serde_json::Value),
763}
764
765/// struct for typed errors of method [`sources_saml_create`]
766#[derive(Debug, Clone, Serialize, Deserialize)]
767#[serde(untagged)]
768pub enum SourcesSamlCreateError {
769    Status400(models::ValidationError),
770    Status403(models::GenericError),
771    UnknownValue(serde_json::Value),
772}
773
774/// struct for typed errors of method [`sources_saml_destroy`]
775#[derive(Debug, Clone, Serialize, Deserialize)]
776#[serde(untagged)]
777pub enum SourcesSamlDestroyError {
778    Status400(models::ValidationError),
779    Status403(models::GenericError),
780    UnknownValue(serde_json::Value),
781}
782
783/// struct for typed errors of method [`sources_saml_list`]
784#[derive(Debug, Clone, Serialize, Deserialize)]
785#[serde(untagged)]
786pub enum SourcesSamlListError {
787    Status400(models::ValidationError),
788    Status403(models::GenericError),
789    UnknownValue(serde_json::Value),
790}
791
792/// struct for typed errors of method [`sources_saml_metadata_retrieve`]
793#[derive(Debug, Clone, Serialize, Deserialize)]
794#[serde(untagged)]
795pub enum SourcesSamlMetadataRetrieveError {
796    Status400(models::ValidationError),
797    Status403(models::GenericError),
798    UnknownValue(serde_json::Value),
799}
800
801/// struct for typed errors of method [`sources_saml_partial_update`]
802#[derive(Debug, Clone, Serialize, Deserialize)]
803#[serde(untagged)]
804pub enum SourcesSamlPartialUpdateError {
805    Status400(models::ValidationError),
806    Status403(models::GenericError),
807    UnknownValue(serde_json::Value),
808}
809
810/// struct for typed errors of method [`sources_saml_retrieve`]
811#[derive(Debug, Clone, Serialize, Deserialize)]
812#[serde(untagged)]
813pub enum SourcesSamlRetrieveError {
814    Status400(models::ValidationError),
815    Status403(models::GenericError),
816    UnknownValue(serde_json::Value),
817}
818
819/// struct for typed errors of method [`sources_saml_update`]
820#[derive(Debug, Clone, Serialize, Deserialize)]
821#[serde(untagged)]
822pub enum SourcesSamlUpdateError {
823    Status400(models::ValidationError),
824    Status403(models::GenericError),
825    UnknownValue(serde_json::Value),
826}
827
828/// struct for typed errors of method [`sources_saml_used_by_list`]
829#[derive(Debug, Clone, Serialize, Deserialize)]
830#[serde(untagged)]
831pub enum SourcesSamlUsedByListError {
832    Status400(models::ValidationError),
833    Status403(models::GenericError),
834    UnknownValue(serde_json::Value),
835}
836
837/// struct for typed errors of method [`sources_scim_create`]
838#[derive(Debug, Clone, Serialize, Deserialize)]
839#[serde(untagged)]
840pub enum SourcesScimCreateError {
841    Status400(models::ValidationError),
842    Status403(models::GenericError),
843    UnknownValue(serde_json::Value),
844}
845
846/// struct for typed errors of method [`sources_scim_destroy`]
847#[derive(Debug, Clone, Serialize, Deserialize)]
848#[serde(untagged)]
849pub enum SourcesScimDestroyError {
850    Status400(models::ValidationError),
851    Status403(models::GenericError),
852    UnknownValue(serde_json::Value),
853}
854
855/// struct for typed errors of method [`sources_scim_groups_create`]
856#[derive(Debug, Clone, Serialize, Deserialize)]
857#[serde(untagged)]
858pub enum SourcesScimGroupsCreateError {
859    Status400(models::ValidationError),
860    Status403(models::GenericError),
861    UnknownValue(serde_json::Value),
862}
863
864/// struct for typed errors of method [`sources_scim_groups_destroy`]
865#[derive(Debug, Clone, Serialize, Deserialize)]
866#[serde(untagged)]
867pub enum SourcesScimGroupsDestroyError {
868    Status400(models::ValidationError),
869    Status403(models::GenericError),
870    UnknownValue(serde_json::Value),
871}
872
873/// struct for typed errors of method [`sources_scim_groups_list`]
874#[derive(Debug, Clone, Serialize, Deserialize)]
875#[serde(untagged)]
876pub enum SourcesScimGroupsListError {
877    Status400(models::ValidationError),
878    Status403(models::GenericError),
879    UnknownValue(serde_json::Value),
880}
881
882/// struct for typed errors of method [`sources_scim_groups_partial_update`]
883#[derive(Debug, Clone, Serialize, Deserialize)]
884#[serde(untagged)]
885pub enum SourcesScimGroupsPartialUpdateError {
886    Status400(models::ValidationError),
887    Status403(models::GenericError),
888    UnknownValue(serde_json::Value),
889}
890
891/// struct for typed errors of method [`sources_scim_groups_retrieve`]
892#[derive(Debug, Clone, Serialize, Deserialize)]
893#[serde(untagged)]
894pub enum SourcesScimGroupsRetrieveError {
895    Status400(models::ValidationError),
896    Status403(models::GenericError),
897    UnknownValue(serde_json::Value),
898}
899
900/// struct for typed errors of method [`sources_scim_groups_update`]
901#[derive(Debug, Clone, Serialize, Deserialize)]
902#[serde(untagged)]
903pub enum SourcesScimGroupsUpdateError {
904    Status400(models::ValidationError),
905    Status403(models::GenericError),
906    UnknownValue(serde_json::Value),
907}
908
909/// struct for typed errors of method [`sources_scim_groups_used_by_list`]
910#[derive(Debug, Clone, Serialize, Deserialize)]
911#[serde(untagged)]
912pub enum SourcesScimGroupsUsedByListError {
913    Status400(models::ValidationError),
914    Status403(models::GenericError),
915    UnknownValue(serde_json::Value),
916}
917
918/// struct for typed errors of method [`sources_scim_list`]
919#[derive(Debug, Clone, Serialize, Deserialize)]
920#[serde(untagged)]
921pub enum SourcesScimListError {
922    Status400(models::ValidationError),
923    Status403(models::GenericError),
924    UnknownValue(serde_json::Value),
925}
926
927/// struct for typed errors of method [`sources_scim_partial_update`]
928#[derive(Debug, Clone, Serialize, Deserialize)]
929#[serde(untagged)]
930pub enum SourcesScimPartialUpdateError {
931    Status400(models::ValidationError),
932    Status403(models::GenericError),
933    UnknownValue(serde_json::Value),
934}
935
936/// struct for typed errors of method [`sources_scim_retrieve`]
937#[derive(Debug, Clone, Serialize, Deserialize)]
938#[serde(untagged)]
939pub enum SourcesScimRetrieveError {
940    Status400(models::ValidationError),
941    Status403(models::GenericError),
942    UnknownValue(serde_json::Value),
943}
944
945/// struct for typed errors of method [`sources_scim_update`]
946#[derive(Debug, Clone, Serialize, Deserialize)]
947#[serde(untagged)]
948pub enum SourcesScimUpdateError {
949    Status400(models::ValidationError),
950    Status403(models::GenericError),
951    UnknownValue(serde_json::Value),
952}
953
954/// struct for typed errors of method [`sources_scim_used_by_list`]
955#[derive(Debug, Clone, Serialize, Deserialize)]
956#[serde(untagged)]
957pub enum SourcesScimUsedByListError {
958    Status400(models::ValidationError),
959    Status403(models::GenericError),
960    UnknownValue(serde_json::Value),
961}
962
963/// struct for typed errors of method [`sources_scim_users_create`]
964#[derive(Debug, Clone, Serialize, Deserialize)]
965#[serde(untagged)]
966pub enum SourcesScimUsersCreateError {
967    Status400(models::ValidationError),
968    Status403(models::GenericError),
969    UnknownValue(serde_json::Value),
970}
971
972/// struct for typed errors of method [`sources_scim_users_destroy`]
973#[derive(Debug, Clone, Serialize, Deserialize)]
974#[serde(untagged)]
975pub enum SourcesScimUsersDestroyError {
976    Status400(models::ValidationError),
977    Status403(models::GenericError),
978    UnknownValue(serde_json::Value),
979}
980
981/// struct for typed errors of method [`sources_scim_users_list`]
982#[derive(Debug, Clone, Serialize, Deserialize)]
983#[serde(untagged)]
984pub enum SourcesScimUsersListError {
985    Status400(models::ValidationError),
986    Status403(models::GenericError),
987    UnknownValue(serde_json::Value),
988}
989
990/// struct for typed errors of method [`sources_scim_users_partial_update`]
991#[derive(Debug, Clone, Serialize, Deserialize)]
992#[serde(untagged)]
993pub enum SourcesScimUsersPartialUpdateError {
994    Status400(models::ValidationError),
995    Status403(models::GenericError),
996    UnknownValue(serde_json::Value),
997}
998
999/// struct for typed errors of method [`sources_scim_users_retrieve`]
1000#[derive(Debug, Clone, Serialize, Deserialize)]
1001#[serde(untagged)]
1002pub enum SourcesScimUsersRetrieveError {
1003    Status400(models::ValidationError),
1004    Status403(models::GenericError),
1005    UnknownValue(serde_json::Value),
1006}
1007
1008/// struct for typed errors of method [`sources_scim_users_update`]
1009#[derive(Debug, Clone, Serialize, Deserialize)]
1010#[serde(untagged)]
1011pub enum SourcesScimUsersUpdateError {
1012    Status400(models::ValidationError),
1013    Status403(models::GenericError),
1014    UnknownValue(serde_json::Value),
1015}
1016
1017/// struct for typed errors of method [`sources_scim_users_used_by_list`]
1018#[derive(Debug, Clone, Serialize, Deserialize)]
1019#[serde(untagged)]
1020pub enum SourcesScimUsersUsedByListError {
1021    Status400(models::ValidationError),
1022    Status403(models::GenericError),
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`sources_user_connections_all_destroy`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum SourcesUserConnectionsAllDestroyError {
1030    Status400(models::ValidationError),
1031    Status403(models::GenericError),
1032    UnknownValue(serde_json::Value),
1033}
1034
1035/// struct for typed errors of method [`sources_user_connections_all_list`]
1036#[derive(Debug, Clone, Serialize, Deserialize)]
1037#[serde(untagged)]
1038pub enum SourcesUserConnectionsAllListError {
1039    Status400(models::ValidationError),
1040    Status403(models::GenericError),
1041    UnknownValue(serde_json::Value),
1042}
1043
1044/// struct for typed errors of method [`sources_user_connections_all_partial_update`]
1045#[derive(Debug, Clone, Serialize, Deserialize)]
1046#[serde(untagged)]
1047pub enum SourcesUserConnectionsAllPartialUpdateError {
1048    Status400(models::ValidationError),
1049    Status403(models::GenericError),
1050    UnknownValue(serde_json::Value),
1051}
1052
1053/// struct for typed errors of method [`sources_user_connections_all_retrieve`]
1054#[derive(Debug, Clone, Serialize, Deserialize)]
1055#[serde(untagged)]
1056pub enum SourcesUserConnectionsAllRetrieveError {
1057    Status400(models::ValidationError),
1058    Status403(models::GenericError),
1059    UnknownValue(serde_json::Value),
1060}
1061
1062/// struct for typed errors of method [`sources_user_connections_all_update`]
1063#[derive(Debug, Clone, Serialize, Deserialize)]
1064#[serde(untagged)]
1065pub enum SourcesUserConnectionsAllUpdateError {
1066    Status400(models::ValidationError),
1067    Status403(models::GenericError),
1068    UnknownValue(serde_json::Value),
1069}
1070
1071/// struct for typed errors of method [`sources_user_connections_all_used_by_list`]
1072#[derive(Debug, Clone, Serialize, Deserialize)]
1073#[serde(untagged)]
1074pub enum SourcesUserConnectionsAllUsedByListError {
1075    Status400(models::ValidationError),
1076    Status403(models::GenericError),
1077    UnknownValue(serde_json::Value),
1078}
1079
1080/// struct for typed errors of method [`sources_user_connections_kerberos_create`]
1081#[derive(Debug, Clone, Serialize, Deserialize)]
1082#[serde(untagged)]
1083pub enum SourcesUserConnectionsKerberosCreateError {
1084    Status400(models::ValidationError),
1085    Status403(models::GenericError),
1086    UnknownValue(serde_json::Value),
1087}
1088
1089/// struct for typed errors of method [`sources_user_connections_kerberos_destroy`]
1090#[derive(Debug, Clone, Serialize, Deserialize)]
1091#[serde(untagged)]
1092pub enum SourcesUserConnectionsKerberosDestroyError {
1093    Status400(models::ValidationError),
1094    Status403(models::GenericError),
1095    UnknownValue(serde_json::Value),
1096}
1097
1098/// struct for typed errors of method [`sources_user_connections_kerberos_list`]
1099#[derive(Debug, Clone, Serialize, Deserialize)]
1100#[serde(untagged)]
1101pub enum SourcesUserConnectionsKerberosListError {
1102    Status400(models::ValidationError),
1103    Status403(models::GenericError),
1104    UnknownValue(serde_json::Value),
1105}
1106
1107/// struct for typed errors of method [`sources_user_connections_kerberos_partial_update`]
1108#[derive(Debug, Clone, Serialize, Deserialize)]
1109#[serde(untagged)]
1110pub enum SourcesUserConnectionsKerberosPartialUpdateError {
1111    Status400(models::ValidationError),
1112    Status403(models::GenericError),
1113    UnknownValue(serde_json::Value),
1114}
1115
1116/// struct for typed errors of method [`sources_user_connections_kerberos_retrieve`]
1117#[derive(Debug, Clone, Serialize, Deserialize)]
1118#[serde(untagged)]
1119pub enum SourcesUserConnectionsKerberosRetrieveError {
1120    Status400(models::ValidationError),
1121    Status403(models::GenericError),
1122    UnknownValue(serde_json::Value),
1123}
1124
1125/// struct for typed errors of method [`sources_user_connections_kerberos_update`]
1126#[derive(Debug, Clone, Serialize, Deserialize)]
1127#[serde(untagged)]
1128pub enum SourcesUserConnectionsKerberosUpdateError {
1129    Status400(models::ValidationError),
1130    Status403(models::GenericError),
1131    UnknownValue(serde_json::Value),
1132}
1133
1134/// struct for typed errors of method [`sources_user_connections_kerberos_used_by_list`]
1135#[derive(Debug, Clone, Serialize, Deserialize)]
1136#[serde(untagged)]
1137pub enum SourcesUserConnectionsKerberosUsedByListError {
1138    Status400(models::ValidationError),
1139    Status403(models::GenericError),
1140    UnknownValue(serde_json::Value),
1141}
1142
1143/// struct for typed errors of method [`sources_user_connections_ldap_create`]
1144#[derive(Debug, Clone, Serialize, Deserialize)]
1145#[serde(untagged)]
1146pub enum SourcesUserConnectionsLdapCreateError {
1147    Status400(models::ValidationError),
1148    Status403(models::GenericError),
1149    UnknownValue(serde_json::Value),
1150}
1151
1152/// struct for typed errors of method [`sources_user_connections_ldap_destroy`]
1153#[derive(Debug, Clone, Serialize, Deserialize)]
1154#[serde(untagged)]
1155pub enum SourcesUserConnectionsLdapDestroyError {
1156    Status400(models::ValidationError),
1157    Status403(models::GenericError),
1158    UnknownValue(serde_json::Value),
1159}
1160
1161/// struct for typed errors of method [`sources_user_connections_ldap_list`]
1162#[derive(Debug, Clone, Serialize, Deserialize)]
1163#[serde(untagged)]
1164pub enum SourcesUserConnectionsLdapListError {
1165    Status400(models::ValidationError),
1166    Status403(models::GenericError),
1167    UnknownValue(serde_json::Value),
1168}
1169
1170/// struct for typed errors of method [`sources_user_connections_ldap_partial_update`]
1171#[derive(Debug, Clone, Serialize, Deserialize)]
1172#[serde(untagged)]
1173pub enum SourcesUserConnectionsLdapPartialUpdateError {
1174    Status400(models::ValidationError),
1175    Status403(models::GenericError),
1176    UnknownValue(serde_json::Value),
1177}
1178
1179/// struct for typed errors of method [`sources_user_connections_ldap_retrieve`]
1180#[derive(Debug, Clone, Serialize, Deserialize)]
1181#[serde(untagged)]
1182pub enum SourcesUserConnectionsLdapRetrieveError {
1183    Status400(models::ValidationError),
1184    Status403(models::GenericError),
1185    UnknownValue(serde_json::Value),
1186}
1187
1188/// struct for typed errors of method [`sources_user_connections_ldap_update`]
1189#[derive(Debug, Clone, Serialize, Deserialize)]
1190#[serde(untagged)]
1191pub enum SourcesUserConnectionsLdapUpdateError {
1192    Status400(models::ValidationError),
1193    Status403(models::GenericError),
1194    UnknownValue(serde_json::Value),
1195}
1196
1197/// struct for typed errors of method [`sources_user_connections_ldap_used_by_list`]
1198#[derive(Debug, Clone, Serialize, Deserialize)]
1199#[serde(untagged)]
1200pub enum SourcesUserConnectionsLdapUsedByListError {
1201    Status400(models::ValidationError),
1202    Status403(models::GenericError),
1203    UnknownValue(serde_json::Value),
1204}
1205
1206/// struct for typed errors of method [`sources_user_connections_oauth_create`]
1207#[derive(Debug, Clone, Serialize, Deserialize)]
1208#[serde(untagged)]
1209pub enum SourcesUserConnectionsOauthCreateError {
1210    Status400(models::ValidationError),
1211    Status403(models::GenericError),
1212    UnknownValue(serde_json::Value),
1213}
1214
1215/// struct for typed errors of method [`sources_user_connections_oauth_destroy`]
1216#[derive(Debug, Clone, Serialize, Deserialize)]
1217#[serde(untagged)]
1218pub enum SourcesUserConnectionsOauthDestroyError {
1219    Status400(models::ValidationError),
1220    Status403(models::GenericError),
1221    UnknownValue(serde_json::Value),
1222}
1223
1224/// struct for typed errors of method [`sources_user_connections_oauth_list`]
1225#[derive(Debug, Clone, Serialize, Deserialize)]
1226#[serde(untagged)]
1227pub enum SourcesUserConnectionsOauthListError {
1228    Status400(models::ValidationError),
1229    Status403(models::GenericError),
1230    UnknownValue(serde_json::Value),
1231}
1232
1233/// struct for typed errors of method [`sources_user_connections_oauth_partial_update`]
1234#[derive(Debug, Clone, Serialize, Deserialize)]
1235#[serde(untagged)]
1236pub enum SourcesUserConnectionsOauthPartialUpdateError {
1237    Status400(models::ValidationError),
1238    Status403(models::GenericError),
1239    UnknownValue(serde_json::Value),
1240}
1241
1242/// struct for typed errors of method [`sources_user_connections_oauth_retrieve`]
1243#[derive(Debug, Clone, Serialize, Deserialize)]
1244#[serde(untagged)]
1245pub enum SourcesUserConnectionsOauthRetrieveError {
1246    Status400(models::ValidationError),
1247    Status403(models::GenericError),
1248    UnknownValue(serde_json::Value),
1249}
1250
1251/// struct for typed errors of method [`sources_user_connections_oauth_update`]
1252#[derive(Debug, Clone, Serialize, Deserialize)]
1253#[serde(untagged)]
1254pub enum SourcesUserConnectionsOauthUpdateError {
1255    Status400(models::ValidationError),
1256    Status403(models::GenericError),
1257    UnknownValue(serde_json::Value),
1258}
1259
1260/// struct for typed errors of method [`sources_user_connections_oauth_used_by_list`]
1261#[derive(Debug, Clone, Serialize, Deserialize)]
1262#[serde(untagged)]
1263pub enum SourcesUserConnectionsOauthUsedByListError {
1264    Status400(models::ValidationError),
1265    Status403(models::GenericError),
1266    UnknownValue(serde_json::Value),
1267}
1268
1269/// struct for typed errors of method [`sources_user_connections_plex_create`]
1270#[derive(Debug, Clone, Serialize, Deserialize)]
1271#[serde(untagged)]
1272pub enum SourcesUserConnectionsPlexCreateError {
1273    Status400(models::ValidationError),
1274    Status403(models::GenericError),
1275    UnknownValue(serde_json::Value),
1276}
1277
1278/// struct for typed errors of method [`sources_user_connections_plex_destroy`]
1279#[derive(Debug, Clone, Serialize, Deserialize)]
1280#[serde(untagged)]
1281pub enum SourcesUserConnectionsPlexDestroyError {
1282    Status400(models::ValidationError),
1283    Status403(models::GenericError),
1284    UnknownValue(serde_json::Value),
1285}
1286
1287/// struct for typed errors of method [`sources_user_connections_plex_list`]
1288#[derive(Debug, Clone, Serialize, Deserialize)]
1289#[serde(untagged)]
1290pub enum SourcesUserConnectionsPlexListError {
1291    Status400(models::ValidationError),
1292    Status403(models::GenericError),
1293    UnknownValue(serde_json::Value),
1294}
1295
1296/// struct for typed errors of method [`sources_user_connections_plex_partial_update`]
1297#[derive(Debug, Clone, Serialize, Deserialize)]
1298#[serde(untagged)]
1299pub enum SourcesUserConnectionsPlexPartialUpdateError {
1300    Status400(models::ValidationError),
1301    Status403(models::GenericError),
1302    UnknownValue(serde_json::Value),
1303}
1304
1305/// struct for typed errors of method [`sources_user_connections_plex_retrieve`]
1306#[derive(Debug, Clone, Serialize, Deserialize)]
1307#[serde(untagged)]
1308pub enum SourcesUserConnectionsPlexRetrieveError {
1309    Status400(models::ValidationError),
1310    Status403(models::GenericError),
1311    UnknownValue(serde_json::Value),
1312}
1313
1314/// struct for typed errors of method [`sources_user_connections_plex_update`]
1315#[derive(Debug, Clone, Serialize, Deserialize)]
1316#[serde(untagged)]
1317pub enum SourcesUserConnectionsPlexUpdateError {
1318    Status400(models::ValidationError),
1319    Status403(models::GenericError),
1320    UnknownValue(serde_json::Value),
1321}
1322
1323/// struct for typed errors of method [`sources_user_connections_plex_used_by_list`]
1324#[derive(Debug, Clone, Serialize, Deserialize)]
1325#[serde(untagged)]
1326pub enum SourcesUserConnectionsPlexUsedByListError {
1327    Status400(models::ValidationError),
1328    Status403(models::GenericError),
1329    UnknownValue(serde_json::Value),
1330}
1331
1332/// struct for typed errors of method [`sources_user_connections_saml_create`]
1333#[derive(Debug, Clone, Serialize, Deserialize)]
1334#[serde(untagged)]
1335pub enum SourcesUserConnectionsSamlCreateError {
1336    Status400(models::ValidationError),
1337    Status403(models::GenericError),
1338    UnknownValue(serde_json::Value),
1339}
1340
1341/// struct for typed errors of method [`sources_user_connections_saml_destroy`]
1342#[derive(Debug, Clone, Serialize, Deserialize)]
1343#[serde(untagged)]
1344pub enum SourcesUserConnectionsSamlDestroyError {
1345    Status400(models::ValidationError),
1346    Status403(models::GenericError),
1347    UnknownValue(serde_json::Value),
1348}
1349
1350/// struct for typed errors of method [`sources_user_connections_saml_list`]
1351#[derive(Debug, Clone, Serialize, Deserialize)]
1352#[serde(untagged)]
1353pub enum SourcesUserConnectionsSamlListError {
1354    Status400(models::ValidationError),
1355    Status403(models::GenericError),
1356    UnknownValue(serde_json::Value),
1357}
1358
1359/// struct for typed errors of method [`sources_user_connections_saml_partial_update`]
1360#[derive(Debug, Clone, Serialize, Deserialize)]
1361#[serde(untagged)]
1362pub enum SourcesUserConnectionsSamlPartialUpdateError {
1363    Status400(models::ValidationError),
1364    Status403(models::GenericError),
1365    UnknownValue(serde_json::Value),
1366}
1367
1368/// struct for typed errors of method [`sources_user_connections_saml_retrieve`]
1369#[derive(Debug, Clone, Serialize, Deserialize)]
1370#[serde(untagged)]
1371pub enum SourcesUserConnectionsSamlRetrieveError {
1372    Status400(models::ValidationError),
1373    Status403(models::GenericError),
1374    UnknownValue(serde_json::Value),
1375}
1376
1377/// struct for typed errors of method [`sources_user_connections_saml_update`]
1378#[derive(Debug, Clone, Serialize, Deserialize)]
1379#[serde(untagged)]
1380pub enum SourcesUserConnectionsSamlUpdateError {
1381    Status400(models::ValidationError),
1382    Status403(models::GenericError),
1383    UnknownValue(serde_json::Value),
1384}
1385
1386/// struct for typed errors of method [`sources_user_connections_saml_used_by_list`]
1387#[derive(Debug, Clone, Serialize, Deserialize)]
1388#[serde(untagged)]
1389pub enum SourcesUserConnectionsSamlUsedByListError {
1390    Status400(models::ValidationError),
1391    Status403(models::GenericError),
1392    UnknownValue(serde_json::Value),
1393}
1394
1395/// Prevent deletion of built-in sources
1396pub async fn sources_all_destroy(
1397    configuration: &configuration::Configuration,
1398    slug: &str,
1399) -> Result<(), Error<SourcesAllDestroyError>> {
1400    // add a prefix to parameters to efficiently prevent name collisions
1401    let p_path_slug = slug;
1402
1403    let uri_str = format!(
1404        "{}/sources/all/{slug}/",
1405        configuration.base_path,
1406        slug = crate::apis::urlencode(p_path_slug)
1407    );
1408    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1409
1410    if let Some(ref user_agent) = configuration.user_agent {
1411        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1412    }
1413    if let Some(ref token) = configuration.bearer_access_token {
1414        req_builder = req_builder.bearer_auth(token.to_owned());
1415    };
1416
1417    let req = req_builder.build()?;
1418    let resp = configuration.client.execute(req).await?;
1419
1420    let status = resp.status();
1421
1422    if !status.is_client_error() && !status.is_server_error() {
1423        Ok(())
1424    } else {
1425        let content = resp.text().await?;
1426        let entity: Option<SourcesAllDestroyError> = serde_json::from_str(&content).ok();
1427        Err(Error::ResponseError(ResponseContent {
1428            status,
1429            content,
1430            entity,
1431        }))
1432    }
1433}
1434
1435/// Source Viewset
1436pub async fn sources_all_list(
1437    configuration: &configuration::Configuration,
1438    managed: Option<&str>,
1439    name: Option<&str>,
1440    ordering: Option<&str>,
1441    page: Option<i32>,
1442    page_size: Option<i32>,
1443    pbm_uuid: Option<&str>,
1444    search: Option<&str>,
1445    slug: Option<&str>,
1446) -> Result<models::PaginatedSourceList, Error<SourcesAllListError>> {
1447    // add a prefix to parameters to efficiently prevent name collisions
1448    let p_query_managed = managed;
1449    let p_query_name = name;
1450    let p_query_ordering = ordering;
1451    let p_query_page = page;
1452    let p_query_page_size = page_size;
1453    let p_query_pbm_uuid = pbm_uuid;
1454    let p_query_search = search;
1455    let p_query_slug = slug;
1456
1457    let uri_str = format!("{}/sources/all/", configuration.base_path);
1458    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1459
1460    if let Some(ref param_value) = p_query_managed {
1461        req_builder = req_builder.query(&[("managed", &param_value.to_string())]);
1462    }
1463    if let Some(ref param_value) = p_query_name {
1464        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
1465    }
1466    if let Some(ref param_value) = p_query_ordering {
1467        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1468    }
1469    if let Some(ref param_value) = p_query_page {
1470        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1471    }
1472    if let Some(ref param_value) = p_query_page_size {
1473        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1474    }
1475    if let Some(ref param_value) = p_query_pbm_uuid {
1476        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
1477    }
1478    if let Some(ref param_value) = p_query_search {
1479        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1480    }
1481    if let Some(ref param_value) = p_query_slug {
1482        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
1483    }
1484    if let Some(ref user_agent) = configuration.user_agent {
1485        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1486    }
1487    if let Some(ref token) = configuration.bearer_access_token {
1488        req_builder = req_builder.bearer_auth(token.to_owned());
1489    };
1490
1491    let req = req_builder.build()?;
1492    let resp = configuration.client.execute(req).await?;
1493
1494    let status = resp.status();
1495    let content_type = resp
1496        .headers()
1497        .get("content-type")
1498        .and_then(|v| v.to_str().ok())
1499        .unwrap_or("application/octet-stream");
1500    let content_type = super::ContentType::from(content_type);
1501
1502    if !status.is_client_error() && !status.is_server_error() {
1503        let content = resp.text().await?;
1504        match content_type {
1505            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1506            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSourceList`"))),
1507            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSourceList`")))),
1508        }
1509    } else {
1510        let content = resp.text().await?;
1511        let entity: Option<SourcesAllListError> = serde_json::from_str(&content).ok();
1512        Err(Error::ResponseError(ResponseContent {
1513            status,
1514            content,
1515            entity,
1516        }))
1517    }
1518}
1519
1520/// Source Viewset
1521pub async fn sources_all_retrieve(
1522    configuration: &configuration::Configuration,
1523    slug: &str,
1524) -> Result<models::Source, Error<SourcesAllRetrieveError>> {
1525    // add a prefix to parameters to efficiently prevent name collisions
1526    let p_path_slug = slug;
1527
1528    let uri_str = format!(
1529        "{}/sources/all/{slug}/",
1530        configuration.base_path,
1531        slug = crate::apis::urlencode(p_path_slug)
1532    );
1533    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1534
1535    if let Some(ref user_agent) = configuration.user_agent {
1536        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1537    }
1538    if let Some(ref token) = configuration.bearer_access_token {
1539        req_builder = req_builder.bearer_auth(token.to_owned());
1540    };
1541
1542    let req = req_builder.build()?;
1543    let resp = configuration.client.execute(req).await?;
1544
1545    let status = resp.status();
1546    let content_type = resp
1547        .headers()
1548        .get("content-type")
1549        .and_then(|v| v.to_str().ok())
1550        .unwrap_or("application/octet-stream");
1551    let content_type = super::ContentType::from(content_type);
1552
1553    if !status.is_client_error() && !status.is_server_error() {
1554        let content = resp.text().await?;
1555        match content_type {
1556            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1557            ContentType::Text => {
1558                return Err(Error::from(serde_json::Error::custom(
1559                    "Received `text/plain` content type response that cannot be converted to `models::Source`",
1560                )))
1561            }
1562            ContentType::Unsupported(unknown_type) => {
1563                return Err(Error::from(serde_json::Error::custom(format!(
1564                    "Received `{unknown_type}` content type response that cannot be converted to `models::Source`"
1565                ))))
1566            }
1567        }
1568    } else {
1569        let content = resp.text().await?;
1570        let entity: Option<SourcesAllRetrieveError> = serde_json::from_str(&content).ok();
1571        Err(Error::ResponseError(ResponseContent {
1572            status,
1573            content,
1574            entity,
1575        }))
1576    }
1577}
1578
1579/// Set source icon
1580pub async fn sources_all_set_icon_create(
1581    configuration: &configuration::Configuration,
1582    slug: &str,
1583    file: Option<std::path::PathBuf>,
1584    clear: Option<bool>,
1585) -> Result<(), Error<SourcesAllSetIconCreateError>> {
1586    // add a prefix to parameters to efficiently prevent name collisions
1587    let p_path_slug = slug;
1588    let p_form_file = file;
1589    let p_form_clear = clear;
1590
1591    let uri_str = format!(
1592        "{}/sources/all/{slug}/set_icon/",
1593        configuration.base_path,
1594        slug = crate::apis::urlencode(p_path_slug)
1595    );
1596    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1597
1598    if let Some(ref user_agent) = configuration.user_agent {
1599        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1600    }
1601    if let Some(ref token) = configuration.bearer_access_token {
1602        req_builder = req_builder.bearer_auth(token.to_owned());
1603    };
1604    let mut multipart_form = reqwest::multipart::Form::new();
1605    // TODO: support file upload for 'file' parameter
1606    if let Some(param_value) = p_form_clear {
1607        multipart_form = multipart_form.text("clear", param_value.to_string());
1608    }
1609    req_builder = req_builder.multipart(multipart_form);
1610
1611    let req = req_builder.build()?;
1612    let resp = configuration.client.execute(req).await?;
1613
1614    let status = resp.status();
1615
1616    if !status.is_client_error() && !status.is_server_error() {
1617        Ok(())
1618    } else {
1619        let content = resp.text().await?;
1620        let entity: Option<SourcesAllSetIconCreateError> = serde_json::from_str(&content).ok();
1621        Err(Error::ResponseError(ResponseContent {
1622            status,
1623            content,
1624            entity,
1625        }))
1626    }
1627}
1628
1629/// Set source icon (as URL)
1630pub async fn sources_all_set_icon_url_create(
1631    configuration: &configuration::Configuration,
1632    slug: &str,
1633    file_path_request: models::FilePathRequest,
1634) -> Result<(), Error<SourcesAllSetIconUrlCreateError>> {
1635    // add a prefix to parameters to efficiently prevent name collisions
1636    let p_path_slug = slug;
1637    let p_body_file_path_request = file_path_request;
1638
1639    let uri_str = format!(
1640        "{}/sources/all/{slug}/set_icon_url/",
1641        configuration.base_path,
1642        slug = crate::apis::urlencode(p_path_slug)
1643    );
1644    let mut req_builder = configuration.client.request(reqwest::Method::POST, &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    req_builder = req_builder.json(&p_body_file_path_request);
1653
1654    let req = req_builder.build()?;
1655    let resp = configuration.client.execute(req).await?;
1656
1657    let status = resp.status();
1658
1659    if !status.is_client_error() && !status.is_server_error() {
1660        Ok(())
1661    } else {
1662        let content = resp.text().await?;
1663        let entity: Option<SourcesAllSetIconUrlCreateError> = serde_json::from_str(&content).ok();
1664        Err(Error::ResponseError(ResponseContent {
1665            status,
1666            content,
1667            entity,
1668        }))
1669    }
1670}
1671
1672/// Get all creatable types
1673pub async fn sources_all_types_list(
1674    configuration: &configuration::Configuration,
1675) -> Result<Vec<models::TypeCreate>, Error<SourcesAllTypesListError>> {
1676    let uri_str = format!("{}/sources/all/types/", configuration.base_path);
1677    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1678
1679    if let Some(ref user_agent) = configuration.user_agent {
1680        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1681    }
1682    if let Some(ref token) = configuration.bearer_access_token {
1683        req_builder = req_builder.bearer_auth(token.to_owned());
1684    };
1685
1686    let req = req_builder.build()?;
1687    let resp = configuration.client.execute(req).await?;
1688
1689    let status = resp.status();
1690    let content_type = resp
1691        .headers()
1692        .get("content-type")
1693        .and_then(|v| v.to_str().ok())
1694        .unwrap_or("application/octet-stream");
1695    let content_type = super::ContentType::from(content_type);
1696
1697    if !status.is_client_error() && !status.is_server_error() {
1698        let content = resp.text().await?;
1699        match content_type {
1700            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1701            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;`"))),
1702            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;`")))),
1703        }
1704    } else {
1705        let content = resp.text().await?;
1706        let entity: Option<SourcesAllTypesListError> = serde_json::from_str(&content).ok();
1707        Err(Error::ResponseError(ResponseContent {
1708            status,
1709            content,
1710            entity,
1711        }))
1712    }
1713}
1714
1715/// Get a list of all objects that use this object
1716pub async fn sources_all_used_by_list(
1717    configuration: &configuration::Configuration,
1718    slug: &str,
1719) -> Result<Vec<models::UsedBy>, Error<SourcesAllUsedByListError>> {
1720    // add a prefix to parameters to efficiently prevent name collisions
1721    let p_path_slug = slug;
1722
1723    let uri_str = format!(
1724        "{}/sources/all/{slug}/used_by/",
1725        configuration.base_path,
1726        slug = crate::apis::urlencode(p_path_slug)
1727    );
1728    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1729
1730    if let Some(ref user_agent) = configuration.user_agent {
1731        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1732    }
1733    if let Some(ref token) = configuration.bearer_access_token {
1734        req_builder = req_builder.bearer_auth(token.to_owned());
1735    };
1736
1737    let req = req_builder.build()?;
1738    let resp = configuration.client.execute(req).await?;
1739
1740    let status = resp.status();
1741    let content_type = resp
1742        .headers()
1743        .get("content-type")
1744        .and_then(|v| v.to_str().ok())
1745        .unwrap_or("application/octet-stream");
1746    let content_type = super::ContentType::from(content_type);
1747
1748    if !status.is_client_error() && !status.is_server_error() {
1749        let content = resp.text().await?;
1750        match content_type {
1751            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1752            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;`"))),
1753            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;`")))),
1754        }
1755    } else {
1756        let content = resp.text().await?;
1757        let entity: Option<SourcesAllUsedByListError> = serde_json::from_str(&content).ok();
1758        Err(Error::ResponseError(ResponseContent {
1759            status,
1760            content,
1761            entity,
1762        }))
1763    }
1764}
1765
1766/// Get all sources the user can configure
1767pub async fn sources_all_user_settings_list(
1768    configuration: &configuration::Configuration,
1769) -> Result<Vec<models::UserSetting>, Error<SourcesAllUserSettingsListError>> {
1770    let uri_str = format!("{}/sources/all/user_settings/", configuration.base_path);
1771    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1772
1773    if let Some(ref user_agent) = configuration.user_agent {
1774        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1775    }
1776    if let Some(ref token) = configuration.bearer_access_token {
1777        req_builder = req_builder.bearer_auth(token.to_owned());
1778    };
1779
1780    let req = req_builder.build()?;
1781    let resp = configuration.client.execute(req).await?;
1782
1783    let status = resp.status();
1784    let content_type = resp
1785        .headers()
1786        .get("content-type")
1787        .and_then(|v| v.to_str().ok())
1788        .unwrap_or("application/octet-stream");
1789    let content_type = super::ContentType::from(content_type);
1790
1791    if !status.is_client_error() && !status.is_server_error() {
1792        let content = resp.text().await?;
1793        match content_type {
1794            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1795            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UserSetting&gt;`"))),
1796            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::UserSetting&gt;`")))),
1797        }
1798    } else {
1799        let content = resp.text().await?;
1800        let entity: Option<SourcesAllUserSettingsListError> = serde_json::from_str(&content).ok();
1801        Err(Error::ResponseError(ResponseContent {
1802            status,
1803            content,
1804            entity,
1805        }))
1806    }
1807}
1808
1809/// Group-source connection Viewset
1810pub async fn sources_group_connections_all_destroy(
1811    configuration: &configuration::Configuration,
1812    id: i32,
1813) -> Result<(), Error<SourcesGroupConnectionsAllDestroyError>> {
1814    // add a prefix to parameters to efficiently prevent name collisions
1815    let p_path_id = id;
1816
1817    let uri_str = format!(
1818        "{}/sources/group_connections/all/{id}/",
1819        configuration.base_path,
1820        id = p_path_id
1821    );
1822    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1823
1824    if let Some(ref user_agent) = configuration.user_agent {
1825        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1826    }
1827    if let Some(ref token) = configuration.bearer_access_token {
1828        req_builder = req_builder.bearer_auth(token.to_owned());
1829    };
1830
1831    let req = req_builder.build()?;
1832    let resp = configuration.client.execute(req).await?;
1833
1834    let status = resp.status();
1835
1836    if !status.is_client_error() && !status.is_server_error() {
1837        Ok(())
1838    } else {
1839        let content = resp.text().await?;
1840        let entity: Option<SourcesGroupConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
1841        Err(Error::ResponseError(ResponseContent {
1842            status,
1843            content,
1844            entity,
1845        }))
1846    }
1847}
1848
1849/// Group-source connection Viewset
1850pub async fn sources_group_connections_all_list(
1851    configuration: &configuration::Configuration,
1852    group: Option<&str>,
1853    ordering: Option<&str>,
1854    page: Option<i32>,
1855    page_size: Option<i32>,
1856    search: Option<&str>,
1857    source__slug: Option<&str>,
1858) -> Result<models::PaginatedGroupSourceConnectionList, Error<SourcesGroupConnectionsAllListError>> {
1859    // add a prefix to parameters to efficiently prevent name collisions
1860    let p_query_group = group;
1861    let p_query_ordering = ordering;
1862    let p_query_page = page;
1863    let p_query_page_size = page_size;
1864    let p_query_search = search;
1865    let p_query_source__slug = source__slug;
1866
1867    let uri_str = format!("{}/sources/group_connections/all/", configuration.base_path);
1868    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1869
1870    if let Some(ref param_value) = p_query_group {
1871        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
1872    }
1873    if let Some(ref param_value) = p_query_ordering {
1874        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1875    }
1876    if let Some(ref param_value) = p_query_page {
1877        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1878    }
1879    if let Some(ref param_value) = p_query_page_size {
1880        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1881    }
1882    if let Some(ref param_value) = p_query_search {
1883        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1884    }
1885    if let Some(ref param_value) = p_query_source__slug {
1886        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
1887    }
1888    if let Some(ref user_agent) = configuration.user_agent {
1889        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1890    }
1891    if let Some(ref token) = configuration.bearer_access_token {
1892        req_builder = req_builder.bearer_auth(token.to_owned());
1893    };
1894
1895    let req = req_builder.build()?;
1896    let resp = configuration.client.execute(req).await?;
1897
1898    let status = resp.status();
1899    let content_type = resp
1900        .headers()
1901        .get("content-type")
1902        .and_then(|v| v.to_str().ok())
1903        .unwrap_or("application/octet-stream");
1904    let content_type = super::ContentType::from(content_type);
1905
1906    if !status.is_client_error() && !status.is_server_error() {
1907        let content = resp.text().await?;
1908        match content_type {
1909            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1910            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupSourceConnectionList`"))),
1911            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupSourceConnectionList`")))),
1912        }
1913    } else {
1914        let content = resp.text().await?;
1915        let entity: Option<SourcesGroupConnectionsAllListError> = serde_json::from_str(&content).ok();
1916        Err(Error::ResponseError(ResponseContent {
1917            status,
1918            content,
1919            entity,
1920        }))
1921    }
1922}
1923
1924/// Group-source connection Viewset
1925pub async fn sources_group_connections_all_partial_update(
1926    configuration: &configuration::Configuration,
1927    id: i32,
1928    patched_group_source_connection_request: Option<models::PatchedGroupSourceConnectionRequest>,
1929) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllPartialUpdateError>> {
1930    // add a prefix to parameters to efficiently prevent name collisions
1931    let p_path_id = id;
1932    let p_body_patched_group_source_connection_request = patched_group_source_connection_request;
1933
1934    let uri_str = format!(
1935        "{}/sources/group_connections/all/{id}/",
1936        configuration.base_path,
1937        id = p_path_id
1938    );
1939    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &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    req_builder = req_builder.json(&p_body_patched_group_source_connection_request);
1948
1949    let req = req_builder.build()?;
1950    let resp = configuration.client.execute(req).await?;
1951
1952    let status = resp.status();
1953    let content_type = resp
1954        .headers()
1955        .get("content-type")
1956        .and_then(|v| v.to_str().ok())
1957        .unwrap_or("application/octet-stream");
1958    let content_type = super::ContentType::from(content_type);
1959
1960    if !status.is_client_error() && !status.is_server_error() {
1961        let content = resp.text().await?;
1962        match content_type {
1963            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1964            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
1965            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSourceConnection`")))),
1966        }
1967    } else {
1968        let content = resp.text().await?;
1969        let entity: Option<SourcesGroupConnectionsAllPartialUpdateError> = serde_json::from_str(&content).ok();
1970        Err(Error::ResponseError(ResponseContent {
1971            status,
1972            content,
1973            entity,
1974        }))
1975    }
1976}
1977
1978/// Group-source connection Viewset
1979pub async fn sources_group_connections_all_retrieve(
1980    configuration: &configuration::Configuration,
1981    id: i32,
1982) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllRetrieveError>> {
1983    // add a prefix to parameters to efficiently prevent name collisions
1984    let p_path_id = id;
1985
1986    let uri_str = format!(
1987        "{}/sources/group_connections/all/{id}/",
1988        configuration.base_path,
1989        id = p_path_id
1990    );
1991    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1992
1993    if let Some(ref user_agent) = configuration.user_agent {
1994        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1995    }
1996    if let Some(ref token) = configuration.bearer_access_token {
1997        req_builder = req_builder.bearer_auth(token.to_owned());
1998    };
1999
2000    let req = req_builder.build()?;
2001    let resp = configuration.client.execute(req).await?;
2002
2003    let status = resp.status();
2004    let content_type = resp
2005        .headers()
2006        .get("content-type")
2007        .and_then(|v| v.to_str().ok())
2008        .unwrap_or("application/octet-stream");
2009    let content_type = super::ContentType::from(content_type);
2010
2011    if !status.is_client_error() && !status.is_server_error() {
2012        let content = resp.text().await?;
2013        match content_type {
2014            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2015            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2016            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSourceConnection`")))),
2017        }
2018    } else {
2019        let content = resp.text().await?;
2020        let entity: Option<SourcesGroupConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
2021        Err(Error::ResponseError(ResponseContent {
2022            status,
2023            content,
2024            entity,
2025        }))
2026    }
2027}
2028
2029/// Group-source connection Viewset
2030pub async fn sources_group_connections_all_update(
2031    configuration: &configuration::Configuration,
2032    id: i32,
2033    group_source_connection_request: models::GroupSourceConnectionRequest,
2034) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllUpdateError>> {
2035    // add a prefix to parameters to efficiently prevent name collisions
2036    let p_path_id = id;
2037    let p_body_group_source_connection_request = group_source_connection_request;
2038
2039    let uri_str = format!(
2040        "{}/sources/group_connections/all/{id}/",
2041        configuration.base_path,
2042        id = p_path_id
2043    );
2044    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2045
2046    if let Some(ref user_agent) = configuration.user_agent {
2047        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2048    }
2049    if let Some(ref token) = configuration.bearer_access_token {
2050        req_builder = req_builder.bearer_auth(token.to_owned());
2051    };
2052    req_builder = req_builder.json(&p_body_group_source_connection_request);
2053
2054    let req = req_builder.build()?;
2055    let resp = configuration.client.execute(req).await?;
2056
2057    let status = resp.status();
2058    let content_type = resp
2059        .headers()
2060        .get("content-type")
2061        .and_then(|v| v.to_str().ok())
2062        .unwrap_or("application/octet-stream");
2063    let content_type = super::ContentType::from(content_type);
2064
2065    if !status.is_client_error() && !status.is_server_error() {
2066        let content = resp.text().await?;
2067        match content_type {
2068            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2069            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2070            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSourceConnection`")))),
2071        }
2072    } else {
2073        let content = resp.text().await?;
2074        let entity: Option<SourcesGroupConnectionsAllUpdateError> = serde_json::from_str(&content).ok();
2075        Err(Error::ResponseError(ResponseContent {
2076            status,
2077            content,
2078            entity,
2079        }))
2080    }
2081}
2082
2083/// Get a list of all objects that use this object
2084pub async fn sources_group_connections_all_used_by_list(
2085    configuration: &configuration::Configuration,
2086    id: i32,
2087) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsAllUsedByListError>> {
2088    // add a prefix to parameters to efficiently prevent name collisions
2089    let p_path_id = id;
2090
2091    let uri_str = format!(
2092        "{}/sources/group_connections/all/{id}/used_by/",
2093        configuration.base_path,
2094        id = p_path_id
2095    );
2096    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2097
2098    if let Some(ref user_agent) = configuration.user_agent {
2099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2100    }
2101    if let Some(ref token) = configuration.bearer_access_token {
2102        req_builder = req_builder.bearer_auth(token.to_owned());
2103    };
2104
2105    let req = req_builder.build()?;
2106    let resp = configuration.client.execute(req).await?;
2107
2108    let status = resp.status();
2109    let content_type = resp
2110        .headers()
2111        .get("content-type")
2112        .and_then(|v| v.to_str().ok())
2113        .unwrap_or("application/octet-stream");
2114    let content_type = super::ContentType::from(content_type);
2115
2116    if !status.is_client_error() && !status.is_server_error() {
2117        let content = resp.text().await?;
2118        match content_type {
2119            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2120            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;`"))),
2121            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;`")))),
2122        }
2123    } else {
2124        let content = resp.text().await?;
2125        let entity: Option<SourcesGroupConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
2126        Err(Error::ResponseError(ResponseContent {
2127            status,
2128            content,
2129            entity,
2130        }))
2131    }
2132}
2133
2134/// Group-source connection Viewset
2135pub async fn sources_group_connections_kerberos_create(
2136    configuration: &configuration::Configuration,
2137    group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest,
2138) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosCreateError>> {
2139    // add a prefix to parameters to efficiently prevent name collisions
2140    let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request;
2141
2142    let uri_str = format!("{}/sources/group_connections/kerberos/", configuration.base_path);
2143    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2144
2145    if let Some(ref user_agent) = configuration.user_agent {
2146        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2147    }
2148    if let Some(ref token) = configuration.bearer_access_token {
2149        req_builder = req_builder.bearer_auth(token.to_owned());
2150    };
2151    req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request);
2152
2153    let req = req_builder.build()?;
2154    let resp = configuration.client.execute(req).await?;
2155
2156    let status = resp.status();
2157    let content_type = resp
2158        .headers()
2159        .get("content-type")
2160        .and_then(|v| v.to_str().ok())
2161        .unwrap_or("application/octet-stream");
2162    let content_type = super::ContentType::from(content_type);
2163
2164    if !status.is_client_error() && !status.is_server_error() {
2165        let content = resp.text().await?;
2166        match content_type {
2167            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2168            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2169            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2170        }
2171    } else {
2172        let content = resp.text().await?;
2173        let entity: Option<SourcesGroupConnectionsKerberosCreateError> = serde_json::from_str(&content).ok();
2174        Err(Error::ResponseError(ResponseContent {
2175            status,
2176            content,
2177            entity,
2178        }))
2179    }
2180}
2181
2182/// Group-source connection Viewset
2183pub async fn sources_group_connections_kerberos_destroy(
2184    configuration: &configuration::Configuration,
2185    id: i32,
2186) -> Result<(), Error<SourcesGroupConnectionsKerberosDestroyError>> {
2187    // add a prefix to parameters to efficiently prevent name collisions
2188    let p_path_id = id;
2189
2190    let uri_str = format!(
2191        "{}/sources/group_connections/kerberos/{id}/",
2192        configuration.base_path,
2193        id = p_path_id
2194    );
2195    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2196
2197    if let Some(ref user_agent) = configuration.user_agent {
2198        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2199    }
2200    if let Some(ref token) = configuration.bearer_access_token {
2201        req_builder = req_builder.bearer_auth(token.to_owned());
2202    };
2203
2204    let req = req_builder.build()?;
2205    let resp = configuration.client.execute(req).await?;
2206
2207    let status = resp.status();
2208
2209    if !status.is_client_error() && !status.is_server_error() {
2210        Ok(())
2211    } else {
2212        let content = resp.text().await?;
2213        let entity: Option<SourcesGroupConnectionsKerberosDestroyError> = serde_json::from_str(&content).ok();
2214        Err(Error::ResponseError(ResponseContent {
2215            status,
2216            content,
2217            entity,
2218        }))
2219    }
2220}
2221
2222/// Group-source connection Viewset
2223pub async fn sources_group_connections_kerberos_list(
2224    configuration: &configuration::Configuration,
2225    group: Option<&str>,
2226    ordering: Option<&str>,
2227    page: Option<i32>,
2228    page_size: Option<i32>,
2229    search: Option<&str>,
2230    source__slug: Option<&str>,
2231) -> Result<models::PaginatedGroupKerberosSourceConnectionList, Error<SourcesGroupConnectionsKerberosListError>> {
2232    // add a prefix to parameters to efficiently prevent name collisions
2233    let p_query_group = group;
2234    let p_query_ordering = ordering;
2235    let p_query_page = page;
2236    let p_query_page_size = page_size;
2237    let p_query_search = search;
2238    let p_query_source__slug = source__slug;
2239
2240    let uri_str = format!("{}/sources/group_connections/kerberos/", configuration.base_path);
2241    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2242
2243    if let Some(ref param_value) = p_query_group {
2244        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
2245    }
2246    if let Some(ref param_value) = p_query_ordering {
2247        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2248    }
2249    if let Some(ref param_value) = p_query_page {
2250        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2251    }
2252    if let Some(ref param_value) = p_query_page_size {
2253        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2254    }
2255    if let Some(ref param_value) = p_query_search {
2256        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2257    }
2258    if let Some(ref param_value) = p_query_source__slug {
2259        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
2260    }
2261    if let Some(ref user_agent) = configuration.user_agent {
2262        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2263    }
2264    if let Some(ref token) = configuration.bearer_access_token {
2265        req_builder = req_builder.bearer_auth(token.to_owned());
2266    };
2267
2268    let req = req_builder.build()?;
2269    let resp = configuration.client.execute(req).await?;
2270
2271    let status = resp.status();
2272    let content_type = resp
2273        .headers()
2274        .get("content-type")
2275        .and_then(|v| v.to_str().ok())
2276        .unwrap_or("application/octet-stream");
2277    let content_type = super::ContentType::from(content_type);
2278
2279    if !status.is_client_error() && !status.is_server_error() {
2280        let content = resp.text().await?;
2281        match content_type {
2282            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2283            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupKerberosSourceConnectionList`"))),
2284            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupKerberosSourceConnectionList`")))),
2285        }
2286    } else {
2287        let content = resp.text().await?;
2288        let entity: Option<SourcesGroupConnectionsKerberosListError> = serde_json::from_str(&content).ok();
2289        Err(Error::ResponseError(ResponseContent {
2290            status,
2291            content,
2292            entity,
2293        }))
2294    }
2295}
2296
2297/// Group-source connection Viewset
2298pub async fn sources_group_connections_kerberos_partial_update(
2299    configuration: &configuration::Configuration,
2300    id: i32,
2301    patched_group_kerberos_source_connection_request: Option<models::PatchedGroupKerberosSourceConnectionRequest>,
2302) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosPartialUpdateError>> {
2303    // add a prefix to parameters to efficiently prevent name collisions
2304    let p_path_id = id;
2305    let p_body_patched_group_kerberos_source_connection_request = patched_group_kerberos_source_connection_request;
2306
2307    let uri_str = format!(
2308        "{}/sources/group_connections/kerberos/{id}/",
2309        configuration.base_path,
2310        id = p_path_id
2311    );
2312    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2313
2314    if let Some(ref user_agent) = configuration.user_agent {
2315        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2316    }
2317    if let Some(ref token) = configuration.bearer_access_token {
2318        req_builder = req_builder.bearer_auth(token.to_owned());
2319    };
2320    req_builder = req_builder.json(&p_body_patched_group_kerberos_source_connection_request);
2321
2322    let req = req_builder.build()?;
2323    let resp = configuration.client.execute(req).await?;
2324
2325    let status = resp.status();
2326    let content_type = resp
2327        .headers()
2328        .get("content-type")
2329        .and_then(|v| v.to_str().ok())
2330        .unwrap_or("application/octet-stream");
2331    let content_type = super::ContentType::from(content_type);
2332
2333    if !status.is_client_error() && !status.is_server_error() {
2334        let content = resp.text().await?;
2335        match content_type {
2336            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2337            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2338            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2339        }
2340    } else {
2341        let content = resp.text().await?;
2342        let entity: Option<SourcesGroupConnectionsKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
2343        Err(Error::ResponseError(ResponseContent {
2344            status,
2345            content,
2346            entity,
2347        }))
2348    }
2349}
2350
2351/// Group-source connection Viewset
2352pub async fn sources_group_connections_kerberos_retrieve(
2353    configuration: &configuration::Configuration,
2354    id: i32,
2355) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosRetrieveError>> {
2356    // add a prefix to parameters to efficiently prevent name collisions
2357    let p_path_id = id;
2358
2359    let uri_str = format!(
2360        "{}/sources/group_connections/kerberos/{id}/",
2361        configuration.base_path,
2362        id = p_path_id
2363    );
2364    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2365
2366    if let Some(ref user_agent) = configuration.user_agent {
2367        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2368    }
2369    if let Some(ref token) = configuration.bearer_access_token {
2370        req_builder = req_builder.bearer_auth(token.to_owned());
2371    };
2372
2373    let req = req_builder.build()?;
2374    let resp = configuration.client.execute(req).await?;
2375
2376    let status = resp.status();
2377    let content_type = resp
2378        .headers()
2379        .get("content-type")
2380        .and_then(|v| v.to_str().ok())
2381        .unwrap_or("application/octet-stream");
2382    let content_type = super::ContentType::from(content_type);
2383
2384    if !status.is_client_error() && !status.is_server_error() {
2385        let content = resp.text().await?;
2386        match content_type {
2387            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2388            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2389            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2390        }
2391    } else {
2392        let content = resp.text().await?;
2393        let entity: Option<SourcesGroupConnectionsKerberosRetrieveError> = serde_json::from_str(&content).ok();
2394        Err(Error::ResponseError(ResponseContent {
2395            status,
2396            content,
2397            entity,
2398        }))
2399    }
2400}
2401
2402/// Group-source connection Viewset
2403pub async fn sources_group_connections_kerberos_update(
2404    configuration: &configuration::Configuration,
2405    id: i32,
2406    group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest,
2407) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosUpdateError>> {
2408    // add a prefix to parameters to efficiently prevent name collisions
2409    let p_path_id = id;
2410    let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request;
2411
2412    let uri_str = format!(
2413        "{}/sources/group_connections/kerberos/{id}/",
2414        configuration.base_path,
2415        id = p_path_id
2416    );
2417    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2418
2419    if let Some(ref user_agent) = configuration.user_agent {
2420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2421    }
2422    if let Some(ref token) = configuration.bearer_access_token {
2423        req_builder = req_builder.bearer_auth(token.to_owned());
2424    };
2425    req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request);
2426
2427    let req = req_builder.build()?;
2428    let resp = configuration.client.execute(req).await?;
2429
2430    let status = resp.status();
2431    let content_type = resp
2432        .headers()
2433        .get("content-type")
2434        .and_then(|v| v.to_str().ok())
2435        .unwrap_or("application/octet-stream");
2436    let content_type = super::ContentType::from(content_type);
2437
2438    if !status.is_client_error() && !status.is_server_error() {
2439        let content = resp.text().await?;
2440        match content_type {
2441            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2442            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2443            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2444        }
2445    } else {
2446        let content = resp.text().await?;
2447        let entity: Option<SourcesGroupConnectionsKerberosUpdateError> = serde_json::from_str(&content).ok();
2448        Err(Error::ResponseError(ResponseContent {
2449            status,
2450            content,
2451            entity,
2452        }))
2453    }
2454}
2455
2456/// Get a list of all objects that use this object
2457pub async fn sources_group_connections_kerberos_used_by_list(
2458    configuration: &configuration::Configuration,
2459    id: i32,
2460) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsKerberosUsedByListError>> {
2461    // add a prefix to parameters to efficiently prevent name collisions
2462    let p_path_id = id;
2463
2464    let uri_str = format!(
2465        "{}/sources/group_connections/kerberos/{id}/used_by/",
2466        configuration.base_path,
2467        id = p_path_id
2468    );
2469    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2470
2471    if let Some(ref user_agent) = configuration.user_agent {
2472        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2473    }
2474    if let Some(ref token) = configuration.bearer_access_token {
2475        req_builder = req_builder.bearer_auth(token.to_owned());
2476    };
2477
2478    let req = req_builder.build()?;
2479    let resp = configuration.client.execute(req).await?;
2480
2481    let status = resp.status();
2482    let content_type = resp
2483        .headers()
2484        .get("content-type")
2485        .and_then(|v| v.to_str().ok())
2486        .unwrap_or("application/octet-stream");
2487    let content_type = super::ContentType::from(content_type);
2488
2489    if !status.is_client_error() && !status.is_server_error() {
2490        let content = resp.text().await?;
2491        match content_type {
2492            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2493            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;`"))),
2494            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;`")))),
2495        }
2496    } else {
2497        let content = resp.text().await?;
2498        let entity: Option<SourcesGroupConnectionsKerberosUsedByListError> = serde_json::from_str(&content).ok();
2499        Err(Error::ResponseError(ResponseContent {
2500            status,
2501            content,
2502            entity,
2503        }))
2504    }
2505}
2506
2507/// Group-source connection Viewset
2508pub async fn sources_group_connections_ldap_create(
2509    configuration: &configuration::Configuration,
2510    group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest,
2511) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapCreateError>> {
2512    // add a prefix to parameters to efficiently prevent name collisions
2513    let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request;
2514
2515    let uri_str = format!("{}/sources/group_connections/ldap/", configuration.base_path);
2516    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2517
2518    if let Some(ref user_agent) = configuration.user_agent {
2519        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2520    }
2521    if let Some(ref token) = configuration.bearer_access_token {
2522        req_builder = req_builder.bearer_auth(token.to_owned());
2523    };
2524    req_builder = req_builder.json(&p_body_group_ldap_source_connection_request);
2525
2526    let req = req_builder.build()?;
2527    let resp = configuration.client.execute(req).await?;
2528
2529    let status = resp.status();
2530    let content_type = resp
2531        .headers()
2532        .get("content-type")
2533        .and_then(|v| v.to_str().ok())
2534        .unwrap_or("application/octet-stream");
2535    let content_type = super::ContentType::from(content_type);
2536
2537    if !status.is_client_error() && !status.is_server_error() {
2538        let content = resp.text().await?;
2539        match content_type {
2540            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2541            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2542            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2543        }
2544    } else {
2545        let content = resp.text().await?;
2546        let entity: Option<SourcesGroupConnectionsLdapCreateError> = serde_json::from_str(&content).ok();
2547        Err(Error::ResponseError(ResponseContent {
2548            status,
2549            content,
2550            entity,
2551        }))
2552    }
2553}
2554
2555/// Group-source connection Viewset
2556pub async fn sources_group_connections_ldap_destroy(
2557    configuration: &configuration::Configuration,
2558    id: i32,
2559) -> Result<(), Error<SourcesGroupConnectionsLdapDestroyError>> {
2560    // add a prefix to parameters to efficiently prevent name collisions
2561    let p_path_id = id;
2562
2563    let uri_str = format!(
2564        "{}/sources/group_connections/ldap/{id}/",
2565        configuration.base_path,
2566        id = p_path_id
2567    );
2568    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2569
2570    if let Some(ref user_agent) = configuration.user_agent {
2571        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2572    }
2573    if let Some(ref token) = configuration.bearer_access_token {
2574        req_builder = req_builder.bearer_auth(token.to_owned());
2575    };
2576
2577    let req = req_builder.build()?;
2578    let resp = configuration.client.execute(req).await?;
2579
2580    let status = resp.status();
2581
2582    if !status.is_client_error() && !status.is_server_error() {
2583        Ok(())
2584    } else {
2585        let content = resp.text().await?;
2586        let entity: Option<SourcesGroupConnectionsLdapDestroyError> = serde_json::from_str(&content).ok();
2587        Err(Error::ResponseError(ResponseContent {
2588            status,
2589            content,
2590            entity,
2591        }))
2592    }
2593}
2594
2595/// Group-source connection Viewset
2596pub async fn sources_group_connections_ldap_list(
2597    configuration: &configuration::Configuration,
2598    group: Option<&str>,
2599    ordering: Option<&str>,
2600    page: Option<i32>,
2601    page_size: Option<i32>,
2602    search: Option<&str>,
2603    source__slug: Option<&str>,
2604) -> Result<models::PaginatedGroupLdapSourceConnectionList, Error<SourcesGroupConnectionsLdapListError>> {
2605    // add a prefix to parameters to efficiently prevent name collisions
2606    let p_query_group = group;
2607    let p_query_ordering = ordering;
2608    let p_query_page = page;
2609    let p_query_page_size = page_size;
2610    let p_query_search = search;
2611    let p_query_source__slug = source__slug;
2612
2613    let uri_str = format!("{}/sources/group_connections/ldap/", configuration.base_path);
2614    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2615
2616    if let Some(ref param_value) = p_query_group {
2617        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
2618    }
2619    if let Some(ref param_value) = p_query_ordering {
2620        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2621    }
2622    if let Some(ref param_value) = p_query_page {
2623        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2624    }
2625    if let Some(ref param_value) = p_query_page_size {
2626        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2627    }
2628    if let Some(ref param_value) = p_query_search {
2629        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2630    }
2631    if let Some(ref param_value) = p_query_source__slug {
2632        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
2633    }
2634    if let Some(ref user_agent) = configuration.user_agent {
2635        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2636    }
2637    if let Some(ref token) = configuration.bearer_access_token {
2638        req_builder = req_builder.bearer_auth(token.to_owned());
2639    };
2640
2641    let req = req_builder.build()?;
2642    let resp = configuration.client.execute(req).await?;
2643
2644    let status = resp.status();
2645    let content_type = resp
2646        .headers()
2647        .get("content-type")
2648        .and_then(|v| v.to_str().ok())
2649        .unwrap_or("application/octet-stream");
2650    let content_type = super::ContentType::from(content_type);
2651
2652    if !status.is_client_error() && !status.is_server_error() {
2653        let content = resp.text().await?;
2654        match content_type {
2655            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2656            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupLdapSourceConnectionList`"))),
2657            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupLdapSourceConnectionList`")))),
2658        }
2659    } else {
2660        let content = resp.text().await?;
2661        let entity: Option<SourcesGroupConnectionsLdapListError> = serde_json::from_str(&content).ok();
2662        Err(Error::ResponseError(ResponseContent {
2663            status,
2664            content,
2665            entity,
2666        }))
2667    }
2668}
2669
2670/// Group-source connection Viewset
2671pub async fn sources_group_connections_ldap_partial_update(
2672    configuration: &configuration::Configuration,
2673    id: i32,
2674    patched_group_ldap_source_connection_request: Option<models::PatchedGroupLdapSourceConnectionRequest>,
2675) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapPartialUpdateError>> {
2676    // add a prefix to parameters to efficiently prevent name collisions
2677    let p_path_id = id;
2678    let p_body_patched_group_ldap_source_connection_request = patched_group_ldap_source_connection_request;
2679
2680    let uri_str = format!(
2681        "{}/sources/group_connections/ldap/{id}/",
2682        configuration.base_path,
2683        id = p_path_id
2684    );
2685    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2686
2687    if let Some(ref user_agent) = configuration.user_agent {
2688        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2689    }
2690    if let Some(ref token) = configuration.bearer_access_token {
2691        req_builder = req_builder.bearer_auth(token.to_owned());
2692    };
2693    req_builder = req_builder.json(&p_body_patched_group_ldap_source_connection_request);
2694
2695    let req = req_builder.build()?;
2696    let resp = configuration.client.execute(req).await?;
2697
2698    let status = resp.status();
2699    let content_type = resp
2700        .headers()
2701        .get("content-type")
2702        .and_then(|v| v.to_str().ok())
2703        .unwrap_or("application/octet-stream");
2704    let content_type = super::ContentType::from(content_type);
2705
2706    if !status.is_client_error() && !status.is_server_error() {
2707        let content = resp.text().await?;
2708        match content_type {
2709            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2710            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2711            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2712        }
2713    } else {
2714        let content = resp.text().await?;
2715        let entity: Option<SourcesGroupConnectionsLdapPartialUpdateError> = serde_json::from_str(&content).ok();
2716        Err(Error::ResponseError(ResponseContent {
2717            status,
2718            content,
2719            entity,
2720        }))
2721    }
2722}
2723
2724/// Group-source connection Viewset
2725pub async fn sources_group_connections_ldap_retrieve(
2726    configuration: &configuration::Configuration,
2727    id: i32,
2728) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapRetrieveError>> {
2729    // add a prefix to parameters to efficiently prevent name collisions
2730    let p_path_id = id;
2731
2732    let uri_str = format!(
2733        "{}/sources/group_connections/ldap/{id}/",
2734        configuration.base_path,
2735        id = p_path_id
2736    );
2737    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2738
2739    if let Some(ref user_agent) = configuration.user_agent {
2740        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2741    }
2742    if let Some(ref token) = configuration.bearer_access_token {
2743        req_builder = req_builder.bearer_auth(token.to_owned());
2744    };
2745
2746    let req = req_builder.build()?;
2747    let resp = configuration.client.execute(req).await?;
2748
2749    let status = resp.status();
2750    let content_type = resp
2751        .headers()
2752        .get("content-type")
2753        .and_then(|v| v.to_str().ok())
2754        .unwrap_or("application/octet-stream");
2755    let content_type = super::ContentType::from(content_type);
2756
2757    if !status.is_client_error() && !status.is_server_error() {
2758        let content = resp.text().await?;
2759        match content_type {
2760            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2761            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2762            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2763        }
2764    } else {
2765        let content = resp.text().await?;
2766        let entity: Option<SourcesGroupConnectionsLdapRetrieveError> = serde_json::from_str(&content).ok();
2767        Err(Error::ResponseError(ResponseContent {
2768            status,
2769            content,
2770            entity,
2771        }))
2772    }
2773}
2774
2775/// Group-source connection Viewset
2776pub async fn sources_group_connections_ldap_update(
2777    configuration: &configuration::Configuration,
2778    id: i32,
2779    group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest,
2780) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapUpdateError>> {
2781    // add a prefix to parameters to efficiently prevent name collisions
2782    let p_path_id = id;
2783    let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request;
2784
2785    let uri_str = format!(
2786        "{}/sources/group_connections/ldap/{id}/",
2787        configuration.base_path,
2788        id = p_path_id
2789    );
2790    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2791
2792    if let Some(ref user_agent) = configuration.user_agent {
2793        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2794    }
2795    if let Some(ref token) = configuration.bearer_access_token {
2796        req_builder = req_builder.bearer_auth(token.to_owned());
2797    };
2798    req_builder = req_builder.json(&p_body_group_ldap_source_connection_request);
2799
2800    let req = req_builder.build()?;
2801    let resp = configuration.client.execute(req).await?;
2802
2803    let status = resp.status();
2804    let content_type = resp
2805        .headers()
2806        .get("content-type")
2807        .and_then(|v| v.to_str().ok())
2808        .unwrap_or("application/octet-stream");
2809    let content_type = super::ContentType::from(content_type);
2810
2811    if !status.is_client_error() && !status.is_server_error() {
2812        let content = resp.text().await?;
2813        match content_type {
2814            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2815            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2816            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2817        }
2818    } else {
2819        let content = resp.text().await?;
2820        let entity: Option<SourcesGroupConnectionsLdapUpdateError> = serde_json::from_str(&content).ok();
2821        Err(Error::ResponseError(ResponseContent {
2822            status,
2823            content,
2824            entity,
2825        }))
2826    }
2827}
2828
2829/// Get a list of all objects that use this object
2830pub async fn sources_group_connections_ldap_used_by_list(
2831    configuration: &configuration::Configuration,
2832    id: i32,
2833) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsLdapUsedByListError>> {
2834    // add a prefix to parameters to efficiently prevent name collisions
2835    let p_path_id = id;
2836
2837    let uri_str = format!(
2838        "{}/sources/group_connections/ldap/{id}/used_by/",
2839        configuration.base_path,
2840        id = p_path_id
2841    );
2842    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2843
2844    if let Some(ref user_agent) = configuration.user_agent {
2845        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2846    }
2847    if let Some(ref token) = configuration.bearer_access_token {
2848        req_builder = req_builder.bearer_auth(token.to_owned());
2849    };
2850
2851    let req = req_builder.build()?;
2852    let resp = configuration.client.execute(req).await?;
2853
2854    let status = resp.status();
2855    let content_type = resp
2856        .headers()
2857        .get("content-type")
2858        .and_then(|v| v.to_str().ok())
2859        .unwrap_or("application/octet-stream");
2860    let content_type = super::ContentType::from(content_type);
2861
2862    if !status.is_client_error() && !status.is_server_error() {
2863        let content = resp.text().await?;
2864        match content_type {
2865            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2866            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;`"))),
2867            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;`")))),
2868        }
2869    } else {
2870        let content = resp.text().await?;
2871        let entity: Option<SourcesGroupConnectionsLdapUsedByListError> = serde_json::from_str(&content).ok();
2872        Err(Error::ResponseError(ResponseContent {
2873            status,
2874            content,
2875            entity,
2876        }))
2877    }
2878}
2879
2880/// Group-source connection Viewset
2881pub async fn sources_group_connections_oauth_create(
2882    configuration: &configuration::Configuration,
2883    group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest,
2884) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthCreateError>> {
2885    // add a prefix to parameters to efficiently prevent name collisions
2886    let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request;
2887
2888    let uri_str = format!("{}/sources/group_connections/oauth/", configuration.base_path);
2889    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2890
2891    if let Some(ref user_agent) = configuration.user_agent {
2892        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2893    }
2894    if let Some(ref token) = configuration.bearer_access_token {
2895        req_builder = req_builder.bearer_auth(token.to_owned());
2896    };
2897    req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request);
2898
2899    let req = req_builder.build()?;
2900    let resp = configuration.client.execute(req).await?;
2901
2902    let status = resp.status();
2903    let content_type = resp
2904        .headers()
2905        .get("content-type")
2906        .and_then(|v| v.to_str().ok())
2907        .unwrap_or("application/octet-stream");
2908    let content_type = super::ContentType::from(content_type);
2909
2910    if !status.is_client_error() && !status.is_server_error() {
2911        let content = resp.text().await?;
2912        match content_type {
2913            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2914            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
2915            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
2916        }
2917    } else {
2918        let content = resp.text().await?;
2919        let entity: Option<SourcesGroupConnectionsOauthCreateError> = serde_json::from_str(&content).ok();
2920        Err(Error::ResponseError(ResponseContent {
2921            status,
2922            content,
2923            entity,
2924        }))
2925    }
2926}
2927
2928/// Group-source connection Viewset
2929pub async fn sources_group_connections_oauth_destroy(
2930    configuration: &configuration::Configuration,
2931    id: i32,
2932) -> Result<(), Error<SourcesGroupConnectionsOauthDestroyError>> {
2933    // add a prefix to parameters to efficiently prevent name collisions
2934    let p_path_id = id;
2935
2936    let uri_str = format!(
2937        "{}/sources/group_connections/oauth/{id}/",
2938        configuration.base_path,
2939        id = p_path_id
2940    );
2941    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2942
2943    if let Some(ref user_agent) = configuration.user_agent {
2944        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2945    }
2946    if let Some(ref token) = configuration.bearer_access_token {
2947        req_builder = req_builder.bearer_auth(token.to_owned());
2948    };
2949
2950    let req = req_builder.build()?;
2951    let resp = configuration.client.execute(req).await?;
2952
2953    let status = resp.status();
2954
2955    if !status.is_client_error() && !status.is_server_error() {
2956        Ok(())
2957    } else {
2958        let content = resp.text().await?;
2959        let entity: Option<SourcesGroupConnectionsOauthDestroyError> = serde_json::from_str(&content).ok();
2960        Err(Error::ResponseError(ResponseContent {
2961            status,
2962            content,
2963            entity,
2964        }))
2965    }
2966}
2967
2968/// Group-source connection Viewset
2969pub async fn sources_group_connections_oauth_list(
2970    configuration: &configuration::Configuration,
2971    group: Option<&str>,
2972    ordering: Option<&str>,
2973    page: Option<i32>,
2974    page_size: Option<i32>,
2975    search: Option<&str>,
2976    source__slug: Option<&str>,
2977) -> Result<models::PaginatedGroupOAuthSourceConnectionList, Error<SourcesGroupConnectionsOauthListError>> {
2978    // add a prefix to parameters to efficiently prevent name collisions
2979    let p_query_group = group;
2980    let p_query_ordering = ordering;
2981    let p_query_page = page;
2982    let p_query_page_size = page_size;
2983    let p_query_search = search;
2984    let p_query_source__slug = source__slug;
2985
2986    let uri_str = format!("{}/sources/group_connections/oauth/", configuration.base_path);
2987    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2988
2989    if let Some(ref param_value) = p_query_group {
2990        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
2991    }
2992    if let Some(ref param_value) = p_query_ordering {
2993        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2994    }
2995    if let Some(ref param_value) = p_query_page {
2996        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2997    }
2998    if let Some(ref param_value) = p_query_page_size {
2999        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3000    }
3001    if let Some(ref param_value) = p_query_search {
3002        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3003    }
3004    if let Some(ref param_value) = p_query_source__slug {
3005        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
3006    }
3007    if let Some(ref user_agent) = configuration.user_agent {
3008        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3009    }
3010    if let Some(ref token) = configuration.bearer_access_token {
3011        req_builder = req_builder.bearer_auth(token.to_owned());
3012    };
3013
3014    let req = req_builder.build()?;
3015    let resp = configuration.client.execute(req).await?;
3016
3017    let status = resp.status();
3018    let content_type = resp
3019        .headers()
3020        .get("content-type")
3021        .and_then(|v| v.to_str().ok())
3022        .unwrap_or("application/octet-stream");
3023    let content_type = super::ContentType::from(content_type);
3024
3025    if !status.is_client_error() && !status.is_server_error() {
3026        let content = resp.text().await?;
3027        match content_type {
3028            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3029            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupOAuthSourceConnectionList`"))),
3030            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupOAuthSourceConnectionList`")))),
3031        }
3032    } else {
3033        let content = resp.text().await?;
3034        let entity: Option<SourcesGroupConnectionsOauthListError> = serde_json::from_str(&content).ok();
3035        Err(Error::ResponseError(ResponseContent {
3036            status,
3037            content,
3038            entity,
3039        }))
3040    }
3041}
3042
3043/// Group-source connection Viewset
3044pub async fn sources_group_connections_oauth_partial_update(
3045    configuration: &configuration::Configuration,
3046    id: i32,
3047    patched_group_o_auth_source_connection_request: Option<models::PatchedGroupOAuthSourceConnectionRequest>,
3048) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthPartialUpdateError>> {
3049    // add a prefix to parameters to efficiently prevent name collisions
3050    let p_path_id = id;
3051    let p_body_patched_group_o_auth_source_connection_request = patched_group_o_auth_source_connection_request;
3052
3053    let uri_str = format!(
3054        "{}/sources/group_connections/oauth/{id}/",
3055        configuration.base_path,
3056        id = p_path_id
3057    );
3058    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3059
3060    if let Some(ref user_agent) = configuration.user_agent {
3061        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3062    }
3063    if let Some(ref token) = configuration.bearer_access_token {
3064        req_builder = req_builder.bearer_auth(token.to_owned());
3065    };
3066    req_builder = req_builder.json(&p_body_patched_group_o_auth_source_connection_request);
3067
3068    let req = req_builder.build()?;
3069    let resp = configuration.client.execute(req).await?;
3070
3071    let status = resp.status();
3072    let content_type = resp
3073        .headers()
3074        .get("content-type")
3075        .and_then(|v| v.to_str().ok())
3076        .unwrap_or("application/octet-stream");
3077    let content_type = super::ContentType::from(content_type);
3078
3079    if !status.is_client_error() && !status.is_server_error() {
3080        let content = resp.text().await?;
3081        match content_type {
3082            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3083            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3084            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3085        }
3086    } else {
3087        let content = resp.text().await?;
3088        let entity: Option<SourcesGroupConnectionsOauthPartialUpdateError> = serde_json::from_str(&content).ok();
3089        Err(Error::ResponseError(ResponseContent {
3090            status,
3091            content,
3092            entity,
3093        }))
3094    }
3095}
3096
3097/// Group-source connection Viewset
3098pub async fn sources_group_connections_oauth_retrieve(
3099    configuration: &configuration::Configuration,
3100    id: i32,
3101) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthRetrieveError>> {
3102    // add a prefix to parameters to efficiently prevent name collisions
3103    let p_path_id = id;
3104
3105    let uri_str = format!(
3106        "{}/sources/group_connections/oauth/{id}/",
3107        configuration.base_path,
3108        id = p_path_id
3109    );
3110    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3111
3112    if let Some(ref user_agent) = configuration.user_agent {
3113        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3114    }
3115    if let Some(ref token) = configuration.bearer_access_token {
3116        req_builder = req_builder.bearer_auth(token.to_owned());
3117    };
3118
3119    let req = req_builder.build()?;
3120    let resp = configuration.client.execute(req).await?;
3121
3122    let status = resp.status();
3123    let content_type = resp
3124        .headers()
3125        .get("content-type")
3126        .and_then(|v| v.to_str().ok())
3127        .unwrap_or("application/octet-stream");
3128    let content_type = super::ContentType::from(content_type);
3129
3130    if !status.is_client_error() && !status.is_server_error() {
3131        let content = resp.text().await?;
3132        match content_type {
3133            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3134            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3135            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3136        }
3137    } else {
3138        let content = resp.text().await?;
3139        let entity: Option<SourcesGroupConnectionsOauthRetrieveError> = serde_json::from_str(&content).ok();
3140        Err(Error::ResponseError(ResponseContent {
3141            status,
3142            content,
3143            entity,
3144        }))
3145    }
3146}
3147
3148/// Group-source connection Viewset
3149pub async fn sources_group_connections_oauth_update(
3150    configuration: &configuration::Configuration,
3151    id: i32,
3152    group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest,
3153) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthUpdateError>> {
3154    // add a prefix to parameters to efficiently prevent name collisions
3155    let p_path_id = id;
3156    let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request;
3157
3158    let uri_str = format!(
3159        "{}/sources/group_connections/oauth/{id}/",
3160        configuration.base_path,
3161        id = p_path_id
3162    );
3163    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3164
3165    if let Some(ref user_agent) = configuration.user_agent {
3166        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3167    }
3168    if let Some(ref token) = configuration.bearer_access_token {
3169        req_builder = req_builder.bearer_auth(token.to_owned());
3170    };
3171    req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request);
3172
3173    let req = req_builder.build()?;
3174    let resp = configuration.client.execute(req).await?;
3175
3176    let status = resp.status();
3177    let content_type = resp
3178        .headers()
3179        .get("content-type")
3180        .and_then(|v| v.to_str().ok())
3181        .unwrap_or("application/octet-stream");
3182    let content_type = super::ContentType::from(content_type);
3183
3184    if !status.is_client_error() && !status.is_server_error() {
3185        let content = resp.text().await?;
3186        match content_type {
3187            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3188            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3189            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3190        }
3191    } else {
3192        let content = resp.text().await?;
3193        let entity: Option<SourcesGroupConnectionsOauthUpdateError> = serde_json::from_str(&content).ok();
3194        Err(Error::ResponseError(ResponseContent {
3195            status,
3196            content,
3197            entity,
3198        }))
3199    }
3200}
3201
3202/// Get a list of all objects that use this object
3203pub async fn sources_group_connections_oauth_used_by_list(
3204    configuration: &configuration::Configuration,
3205    id: i32,
3206) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsOauthUsedByListError>> {
3207    // add a prefix to parameters to efficiently prevent name collisions
3208    let p_path_id = id;
3209
3210    let uri_str = format!(
3211        "{}/sources/group_connections/oauth/{id}/used_by/",
3212        configuration.base_path,
3213        id = p_path_id
3214    );
3215    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3216
3217    if let Some(ref user_agent) = configuration.user_agent {
3218        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3219    }
3220    if let Some(ref token) = configuration.bearer_access_token {
3221        req_builder = req_builder.bearer_auth(token.to_owned());
3222    };
3223
3224    let req = req_builder.build()?;
3225    let resp = configuration.client.execute(req).await?;
3226
3227    let status = resp.status();
3228    let content_type = resp
3229        .headers()
3230        .get("content-type")
3231        .and_then(|v| v.to_str().ok())
3232        .unwrap_or("application/octet-stream");
3233    let content_type = super::ContentType::from(content_type);
3234
3235    if !status.is_client_error() && !status.is_server_error() {
3236        let content = resp.text().await?;
3237        match content_type {
3238            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3239            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;`"))),
3240            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;`")))),
3241        }
3242    } else {
3243        let content = resp.text().await?;
3244        let entity: Option<SourcesGroupConnectionsOauthUsedByListError> = serde_json::from_str(&content).ok();
3245        Err(Error::ResponseError(ResponseContent {
3246            status,
3247            content,
3248            entity,
3249        }))
3250    }
3251}
3252
3253/// Group-source connection Viewset
3254pub async fn sources_group_connections_plex_create(
3255    configuration: &configuration::Configuration,
3256    group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest,
3257) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexCreateError>> {
3258    // add a prefix to parameters to efficiently prevent name collisions
3259    let p_body_group_plex_source_connection_request = group_plex_source_connection_request;
3260
3261    let uri_str = format!("{}/sources/group_connections/plex/", configuration.base_path);
3262    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3263
3264    if let Some(ref user_agent) = configuration.user_agent {
3265        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3266    }
3267    if let Some(ref token) = configuration.bearer_access_token {
3268        req_builder = req_builder.bearer_auth(token.to_owned());
3269    };
3270    req_builder = req_builder.json(&p_body_group_plex_source_connection_request);
3271
3272    let req = req_builder.build()?;
3273    let resp = configuration.client.execute(req).await?;
3274
3275    let status = resp.status();
3276    let content_type = resp
3277        .headers()
3278        .get("content-type")
3279        .and_then(|v| v.to_str().ok())
3280        .unwrap_or("application/octet-stream");
3281    let content_type = super::ContentType::from(content_type);
3282
3283    if !status.is_client_error() && !status.is_server_error() {
3284        let content = resp.text().await?;
3285        match content_type {
3286            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3287            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3288            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3289        }
3290    } else {
3291        let content = resp.text().await?;
3292        let entity: Option<SourcesGroupConnectionsPlexCreateError> = serde_json::from_str(&content).ok();
3293        Err(Error::ResponseError(ResponseContent {
3294            status,
3295            content,
3296            entity,
3297        }))
3298    }
3299}
3300
3301/// Group-source connection Viewset
3302pub async fn sources_group_connections_plex_destroy(
3303    configuration: &configuration::Configuration,
3304    id: i32,
3305) -> Result<(), Error<SourcesGroupConnectionsPlexDestroyError>> {
3306    // add a prefix to parameters to efficiently prevent name collisions
3307    let p_path_id = id;
3308
3309    let uri_str = format!(
3310        "{}/sources/group_connections/plex/{id}/",
3311        configuration.base_path,
3312        id = p_path_id
3313    );
3314    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3315
3316    if let Some(ref user_agent) = configuration.user_agent {
3317        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3318    }
3319    if let Some(ref token) = configuration.bearer_access_token {
3320        req_builder = req_builder.bearer_auth(token.to_owned());
3321    };
3322
3323    let req = req_builder.build()?;
3324    let resp = configuration.client.execute(req).await?;
3325
3326    let status = resp.status();
3327
3328    if !status.is_client_error() && !status.is_server_error() {
3329        Ok(())
3330    } else {
3331        let content = resp.text().await?;
3332        let entity: Option<SourcesGroupConnectionsPlexDestroyError> = serde_json::from_str(&content).ok();
3333        Err(Error::ResponseError(ResponseContent {
3334            status,
3335            content,
3336            entity,
3337        }))
3338    }
3339}
3340
3341/// Group-source connection Viewset
3342pub async fn sources_group_connections_plex_list(
3343    configuration: &configuration::Configuration,
3344    group: Option<&str>,
3345    ordering: Option<&str>,
3346    page: Option<i32>,
3347    page_size: Option<i32>,
3348    search: Option<&str>,
3349    source__slug: Option<&str>,
3350) -> Result<models::PaginatedGroupPlexSourceConnectionList, Error<SourcesGroupConnectionsPlexListError>> {
3351    // add a prefix to parameters to efficiently prevent name collisions
3352    let p_query_group = group;
3353    let p_query_ordering = ordering;
3354    let p_query_page = page;
3355    let p_query_page_size = page_size;
3356    let p_query_search = search;
3357    let p_query_source__slug = source__slug;
3358
3359    let uri_str = format!("{}/sources/group_connections/plex/", configuration.base_path);
3360    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3361
3362    if let Some(ref param_value) = p_query_group {
3363        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
3364    }
3365    if let Some(ref param_value) = p_query_ordering {
3366        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3367    }
3368    if let Some(ref param_value) = p_query_page {
3369        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3370    }
3371    if let Some(ref param_value) = p_query_page_size {
3372        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3373    }
3374    if let Some(ref param_value) = p_query_search {
3375        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3376    }
3377    if let Some(ref param_value) = p_query_source__slug {
3378        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
3379    }
3380    if let Some(ref user_agent) = configuration.user_agent {
3381        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3382    }
3383    if let Some(ref token) = configuration.bearer_access_token {
3384        req_builder = req_builder.bearer_auth(token.to_owned());
3385    };
3386
3387    let req = req_builder.build()?;
3388    let resp = configuration.client.execute(req).await?;
3389
3390    let status = resp.status();
3391    let content_type = resp
3392        .headers()
3393        .get("content-type")
3394        .and_then(|v| v.to_str().ok())
3395        .unwrap_or("application/octet-stream");
3396    let content_type = super::ContentType::from(content_type);
3397
3398    if !status.is_client_error() && !status.is_server_error() {
3399        let content = resp.text().await?;
3400        match content_type {
3401            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3402            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupPlexSourceConnectionList`"))),
3403            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupPlexSourceConnectionList`")))),
3404        }
3405    } else {
3406        let content = resp.text().await?;
3407        let entity: Option<SourcesGroupConnectionsPlexListError> = serde_json::from_str(&content).ok();
3408        Err(Error::ResponseError(ResponseContent {
3409            status,
3410            content,
3411            entity,
3412        }))
3413    }
3414}
3415
3416/// Group-source connection Viewset
3417pub async fn sources_group_connections_plex_partial_update(
3418    configuration: &configuration::Configuration,
3419    id: i32,
3420    patched_group_plex_source_connection_request: Option<models::PatchedGroupPlexSourceConnectionRequest>,
3421) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexPartialUpdateError>> {
3422    // add a prefix to parameters to efficiently prevent name collisions
3423    let p_path_id = id;
3424    let p_body_patched_group_plex_source_connection_request = patched_group_plex_source_connection_request;
3425
3426    let uri_str = format!(
3427        "{}/sources/group_connections/plex/{id}/",
3428        configuration.base_path,
3429        id = p_path_id
3430    );
3431    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3432
3433    if let Some(ref user_agent) = configuration.user_agent {
3434        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3435    }
3436    if let Some(ref token) = configuration.bearer_access_token {
3437        req_builder = req_builder.bearer_auth(token.to_owned());
3438    };
3439    req_builder = req_builder.json(&p_body_patched_group_plex_source_connection_request);
3440
3441    let req = req_builder.build()?;
3442    let resp = configuration.client.execute(req).await?;
3443
3444    let status = resp.status();
3445    let content_type = resp
3446        .headers()
3447        .get("content-type")
3448        .and_then(|v| v.to_str().ok())
3449        .unwrap_or("application/octet-stream");
3450    let content_type = super::ContentType::from(content_type);
3451
3452    if !status.is_client_error() && !status.is_server_error() {
3453        let content = resp.text().await?;
3454        match content_type {
3455            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3456            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3457            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3458        }
3459    } else {
3460        let content = resp.text().await?;
3461        let entity: Option<SourcesGroupConnectionsPlexPartialUpdateError> = serde_json::from_str(&content).ok();
3462        Err(Error::ResponseError(ResponseContent {
3463            status,
3464            content,
3465            entity,
3466        }))
3467    }
3468}
3469
3470/// Group-source connection Viewset
3471pub async fn sources_group_connections_plex_retrieve(
3472    configuration: &configuration::Configuration,
3473    id: i32,
3474) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexRetrieveError>> {
3475    // add a prefix to parameters to efficiently prevent name collisions
3476    let p_path_id = id;
3477
3478    let uri_str = format!(
3479        "{}/sources/group_connections/plex/{id}/",
3480        configuration.base_path,
3481        id = p_path_id
3482    );
3483    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3484
3485    if let Some(ref user_agent) = configuration.user_agent {
3486        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3487    }
3488    if let Some(ref token) = configuration.bearer_access_token {
3489        req_builder = req_builder.bearer_auth(token.to_owned());
3490    };
3491
3492    let req = req_builder.build()?;
3493    let resp = configuration.client.execute(req).await?;
3494
3495    let status = resp.status();
3496    let content_type = resp
3497        .headers()
3498        .get("content-type")
3499        .and_then(|v| v.to_str().ok())
3500        .unwrap_or("application/octet-stream");
3501    let content_type = super::ContentType::from(content_type);
3502
3503    if !status.is_client_error() && !status.is_server_error() {
3504        let content = resp.text().await?;
3505        match content_type {
3506            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3507            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3508            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3509        }
3510    } else {
3511        let content = resp.text().await?;
3512        let entity: Option<SourcesGroupConnectionsPlexRetrieveError> = serde_json::from_str(&content).ok();
3513        Err(Error::ResponseError(ResponseContent {
3514            status,
3515            content,
3516            entity,
3517        }))
3518    }
3519}
3520
3521/// Group-source connection Viewset
3522pub async fn sources_group_connections_plex_update(
3523    configuration: &configuration::Configuration,
3524    id: i32,
3525    group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest,
3526) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexUpdateError>> {
3527    // add a prefix to parameters to efficiently prevent name collisions
3528    let p_path_id = id;
3529    let p_body_group_plex_source_connection_request = group_plex_source_connection_request;
3530
3531    let uri_str = format!(
3532        "{}/sources/group_connections/plex/{id}/",
3533        configuration.base_path,
3534        id = p_path_id
3535    );
3536    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3537
3538    if let Some(ref user_agent) = configuration.user_agent {
3539        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3540    }
3541    if let Some(ref token) = configuration.bearer_access_token {
3542        req_builder = req_builder.bearer_auth(token.to_owned());
3543    };
3544    req_builder = req_builder.json(&p_body_group_plex_source_connection_request);
3545
3546    let req = req_builder.build()?;
3547    let resp = configuration.client.execute(req).await?;
3548
3549    let status = resp.status();
3550    let content_type = resp
3551        .headers()
3552        .get("content-type")
3553        .and_then(|v| v.to_str().ok())
3554        .unwrap_or("application/octet-stream");
3555    let content_type = super::ContentType::from(content_type);
3556
3557    if !status.is_client_error() && !status.is_server_error() {
3558        let content = resp.text().await?;
3559        match content_type {
3560            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3561            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3562            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3563        }
3564    } else {
3565        let content = resp.text().await?;
3566        let entity: Option<SourcesGroupConnectionsPlexUpdateError> = serde_json::from_str(&content).ok();
3567        Err(Error::ResponseError(ResponseContent {
3568            status,
3569            content,
3570            entity,
3571        }))
3572    }
3573}
3574
3575/// Get a list of all objects that use this object
3576pub async fn sources_group_connections_plex_used_by_list(
3577    configuration: &configuration::Configuration,
3578    id: i32,
3579) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsPlexUsedByListError>> {
3580    // add a prefix to parameters to efficiently prevent name collisions
3581    let p_path_id = id;
3582
3583    let uri_str = format!(
3584        "{}/sources/group_connections/plex/{id}/used_by/",
3585        configuration.base_path,
3586        id = p_path_id
3587    );
3588    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3589
3590    if let Some(ref user_agent) = configuration.user_agent {
3591        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3592    }
3593    if let Some(ref token) = configuration.bearer_access_token {
3594        req_builder = req_builder.bearer_auth(token.to_owned());
3595    };
3596
3597    let req = req_builder.build()?;
3598    let resp = configuration.client.execute(req).await?;
3599
3600    let status = resp.status();
3601    let content_type = resp
3602        .headers()
3603        .get("content-type")
3604        .and_then(|v| v.to_str().ok())
3605        .unwrap_or("application/octet-stream");
3606    let content_type = super::ContentType::from(content_type);
3607
3608    if !status.is_client_error() && !status.is_server_error() {
3609        let content = resp.text().await?;
3610        match content_type {
3611            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3612            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;`"))),
3613            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;`")))),
3614        }
3615    } else {
3616        let content = resp.text().await?;
3617        let entity: Option<SourcesGroupConnectionsPlexUsedByListError> = serde_json::from_str(&content).ok();
3618        Err(Error::ResponseError(ResponseContent {
3619            status,
3620            content,
3621            entity,
3622        }))
3623    }
3624}
3625
3626/// Group-source connection Viewset
3627pub async fn sources_group_connections_saml_create(
3628    configuration: &configuration::Configuration,
3629    group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest,
3630) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlCreateError>> {
3631    // add a prefix to parameters to efficiently prevent name collisions
3632    let p_body_group_saml_source_connection_request = group_saml_source_connection_request;
3633
3634    let uri_str = format!("{}/sources/group_connections/saml/", configuration.base_path);
3635    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3636
3637    if let Some(ref user_agent) = configuration.user_agent {
3638        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3639    }
3640    if let Some(ref token) = configuration.bearer_access_token {
3641        req_builder = req_builder.bearer_auth(token.to_owned());
3642    };
3643    req_builder = req_builder.json(&p_body_group_saml_source_connection_request);
3644
3645    let req = req_builder.build()?;
3646    let resp = configuration.client.execute(req).await?;
3647
3648    let status = resp.status();
3649    let content_type = resp
3650        .headers()
3651        .get("content-type")
3652        .and_then(|v| v.to_str().ok())
3653        .unwrap_or("application/octet-stream");
3654    let content_type = super::ContentType::from(content_type);
3655
3656    if !status.is_client_error() && !status.is_server_error() {
3657        let content = resp.text().await?;
3658        match content_type {
3659            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3660            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3661            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3662        }
3663    } else {
3664        let content = resp.text().await?;
3665        let entity: Option<SourcesGroupConnectionsSamlCreateError> = serde_json::from_str(&content).ok();
3666        Err(Error::ResponseError(ResponseContent {
3667            status,
3668            content,
3669            entity,
3670        }))
3671    }
3672}
3673
3674/// Group-source connection Viewset
3675pub async fn sources_group_connections_saml_destroy(
3676    configuration: &configuration::Configuration,
3677    id: i32,
3678) -> Result<(), Error<SourcesGroupConnectionsSamlDestroyError>> {
3679    // add a prefix to parameters to efficiently prevent name collisions
3680    let p_path_id = id;
3681
3682    let uri_str = format!(
3683        "{}/sources/group_connections/saml/{id}/",
3684        configuration.base_path,
3685        id = p_path_id
3686    );
3687    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3688
3689    if let Some(ref user_agent) = configuration.user_agent {
3690        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3691    }
3692    if let Some(ref token) = configuration.bearer_access_token {
3693        req_builder = req_builder.bearer_auth(token.to_owned());
3694    };
3695
3696    let req = req_builder.build()?;
3697    let resp = configuration.client.execute(req).await?;
3698
3699    let status = resp.status();
3700
3701    if !status.is_client_error() && !status.is_server_error() {
3702        Ok(())
3703    } else {
3704        let content = resp.text().await?;
3705        let entity: Option<SourcesGroupConnectionsSamlDestroyError> = serde_json::from_str(&content).ok();
3706        Err(Error::ResponseError(ResponseContent {
3707            status,
3708            content,
3709            entity,
3710        }))
3711    }
3712}
3713
3714/// Group-source connection Viewset
3715pub async fn sources_group_connections_saml_list(
3716    configuration: &configuration::Configuration,
3717    group: Option<&str>,
3718    ordering: Option<&str>,
3719    page: Option<i32>,
3720    page_size: Option<i32>,
3721    search: Option<&str>,
3722    source__slug: Option<&str>,
3723) -> Result<models::PaginatedGroupSamlSourceConnectionList, Error<SourcesGroupConnectionsSamlListError>> {
3724    // add a prefix to parameters to efficiently prevent name collisions
3725    let p_query_group = group;
3726    let p_query_ordering = ordering;
3727    let p_query_page = page;
3728    let p_query_page_size = page_size;
3729    let p_query_search = search;
3730    let p_query_source__slug = source__slug;
3731
3732    let uri_str = format!("{}/sources/group_connections/saml/", configuration.base_path);
3733    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3734
3735    if let Some(ref param_value) = p_query_group {
3736        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
3737    }
3738    if let Some(ref param_value) = p_query_ordering {
3739        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3740    }
3741    if let Some(ref param_value) = p_query_page {
3742        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3743    }
3744    if let Some(ref param_value) = p_query_page_size {
3745        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3746    }
3747    if let Some(ref param_value) = p_query_search {
3748        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3749    }
3750    if let Some(ref param_value) = p_query_source__slug {
3751        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
3752    }
3753    if let Some(ref user_agent) = configuration.user_agent {
3754        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3755    }
3756    if let Some(ref token) = configuration.bearer_access_token {
3757        req_builder = req_builder.bearer_auth(token.to_owned());
3758    };
3759
3760    let req = req_builder.build()?;
3761    let resp = configuration.client.execute(req).await?;
3762
3763    let status = resp.status();
3764    let content_type = resp
3765        .headers()
3766        .get("content-type")
3767        .and_then(|v| v.to_str().ok())
3768        .unwrap_or("application/octet-stream");
3769    let content_type = super::ContentType::from(content_type);
3770
3771    if !status.is_client_error() && !status.is_server_error() {
3772        let content = resp.text().await?;
3773        match content_type {
3774            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3775            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupSamlSourceConnectionList`"))),
3776            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupSamlSourceConnectionList`")))),
3777        }
3778    } else {
3779        let content = resp.text().await?;
3780        let entity: Option<SourcesGroupConnectionsSamlListError> = serde_json::from_str(&content).ok();
3781        Err(Error::ResponseError(ResponseContent {
3782            status,
3783            content,
3784            entity,
3785        }))
3786    }
3787}
3788
3789/// Group-source connection Viewset
3790pub async fn sources_group_connections_saml_partial_update(
3791    configuration: &configuration::Configuration,
3792    id: i32,
3793    patched_group_saml_source_connection_request: Option<models::PatchedGroupSamlSourceConnectionRequest>,
3794) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlPartialUpdateError>> {
3795    // add a prefix to parameters to efficiently prevent name collisions
3796    let p_path_id = id;
3797    let p_body_patched_group_saml_source_connection_request = patched_group_saml_source_connection_request;
3798
3799    let uri_str = format!(
3800        "{}/sources/group_connections/saml/{id}/",
3801        configuration.base_path,
3802        id = p_path_id
3803    );
3804    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3805
3806    if let Some(ref user_agent) = configuration.user_agent {
3807        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3808    }
3809    if let Some(ref token) = configuration.bearer_access_token {
3810        req_builder = req_builder.bearer_auth(token.to_owned());
3811    };
3812    req_builder = req_builder.json(&p_body_patched_group_saml_source_connection_request);
3813
3814    let req = req_builder.build()?;
3815    let resp = configuration.client.execute(req).await?;
3816
3817    let status = resp.status();
3818    let content_type = resp
3819        .headers()
3820        .get("content-type")
3821        .and_then(|v| v.to_str().ok())
3822        .unwrap_or("application/octet-stream");
3823    let content_type = super::ContentType::from(content_type);
3824
3825    if !status.is_client_error() && !status.is_server_error() {
3826        let content = resp.text().await?;
3827        match content_type {
3828            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3829            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3830            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3831        }
3832    } else {
3833        let content = resp.text().await?;
3834        let entity: Option<SourcesGroupConnectionsSamlPartialUpdateError> = serde_json::from_str(&content).ok();
3835        Err(Error::ResponseError(ResponseContent {
3836            status,
3837            content,
3838            entity,
3839        }))
3840    }
3841}
3842
3843/// Group-source connection Viewset
3844pub async fn sources_group_connections_saml_retrieve(
3845    configuration: &configuration::Configuration,
3846    id: i32,
3847) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlRetrieveError>> {
3848    // add a prefix to parameters to efficiently prevent name collisions
3849    let p_path_id = id;
3850
3851    let uri_str = format!(
3852        "{}/sources/group_connections/saml/{id}/",
3853        configuration.base_path,
3854        id = p_path_id
3855    );
3856    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3857
3858    if let Some(ref user_agent) = configuration.user_agent {
3859        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3860    }
3861    if let Some(ref token) = configuration.bearer_access_token {
3862        req_builder = req_builder.bearer_auth(token.to_owned());
3863    };
3864
3865    let req = req_builder.build()?;
3866    let resp = configuration.client.execute(req).await?;
3867
3868    let status = resp.status();
3869    let content_type = resp
3870        .headers()
3871        .get("content-type")
3872        .and_then(|v| v.to_str().ok())
3873        .unwrap_or("application/octet-stream");
3874    let content_type = super::ContentType::from(content_type);
3875
3876    if !status.is_client_error() && !status.is_server_error() {
3877        let content = resp.text().await?;
3878        match content_type {
3879            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3880            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3881            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3882        }
3883    } else {
3884        let content = resp.text().await?;
3885        let entity: Option<SourcesGroupConnectionsSamlRetrieveError> = serde_json::from_str(&content).ok();
3886        Err(Error::ResponseError(ResponseContent {
3887            status,
3888            content,
3889            entity,
3890        }))
3891    }
3892}
3893
3894/// Group-source connection Viewset
3895pub async fn sources_group_connections_saml_update(
3896    configuration: &configuration::Configuration,
3897    id: i32,
3898    group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest,
3899) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlUpdateError>> {
3900    // add a prefix to parameters to efficiently prevent name collisions
3901    let p_path_id = id;
3902    let p_body_group_saml_source_connection_request = group_saml_source_connection_request;
3903
3904    let uri_str = format!(
3905        "{}/sources/group_connections/saml/{id}/",
3906        configuration.base_path,
3907        id = p_path_id
3908    );
3909    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3910
3911    if let Some(ref user_agent) = configuration.user_agent {
3912        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3913    }
3914    if let Some(ref token) = configuration.bearer_access_token {
3915        req_builder = req_builder.bearer_auth(token.to_owned());
3916    };
3917    req_builder = req_builder.json(&p_body_group_saml_source_connection_request);
3918
3919    let req = req_builder.build()?;
3920    let resp = configuration.client.execute(req).await?;
3921
3922    let status = resp.status();
3923    let content_type = resp
3924        .headers()
3925        .get("content-type")
3926        .and_then(|v| v.to_str().ok())
3927        .unwrap_or("application/octet-stream");
3928    let content_type = super::ContentType::from(content_type);
3929
3930    if !status.is_client_error() && !status.is_server_error() {
3931        let content = resp.text().await?;
3932        match content_type {
3933            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3934            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3935            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3936        }
3937    } else {
3938        let content = resp.text().await?;
3939        let entity: Option<SourcesGroupConnectionsSamlUpdateError> = serde_json::from_str(&content).ok();
3940        Err(Error::ResponseError(ResponseContent {
3941            status,
3942            content,
3943            entity,
3944        }))
3945    }
3946}
3947
3948/// Get a list of all objects that use this object
3949pub async fn sources_group_connections_saml_used_by_list(
3950    configuration: &configuration::Configuration,
3951    id: i32,
3952) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsSamlUsedByListError>> {
3953    // add a prefix to parameters to efficiently prevent name collisions
3954    let p_path_id = id;
3955
3956    let uri_str = format!(
3957        "{}/sources/group_connections/saml/{id}/used_by/",
3958        configuration.base_path,
3959        id = p_path_id
3960    );
3961    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3962
3963    if let Some(ref user_agent) = configuration.user_agent {
3964        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3965    }
3966    if let Some(ref token) = configuration.bearer_access_token {
3967        req_builder = req_builder.bearer_auth(token.to_owned());
3968    };
3969
3970    let req = req_builder.build()?;
3971    let resp = configuration.client.execute(req).await?;
3972
3973    let status = resp.status();
3974    let content_type = resp
3975        .headers()
3976        .get("content-type")
3977        .and_then(|v| v.to_str().ok())
3978        .unwrap_or("application/octet-stream");
3979    let content_type = super::ContentType::from(content_type);
3980
3981    if !status.is_client_error() && !status.is_server_error() {
3982        let content = resp.text().await?;
3983        match content_type {
3984            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3985            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;`"))),
3986            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;`")))),
3987        }
3988    } else {
3989        let content = resp.text().await?;
3990        let entity: Option<SourcesGroupConnectionsSamlUsedByListError> = serde_json::from_str(&content).ok();
3991        Err(Error::ResponseError(ResponseContent {
3992            status,
3993            content,
3994            entity,
3995        }))
3996    }
3997}
3998
3999/// Kerberos Source Viewset
4000pub async fn sources_kerberos_create(
4001    configuration: &configuration::Configuration,
4002    kerberos_source_request: models::KerberosSourceRequest,
4003) -> Result<models::KerberosSource, Error<SourcesKerberosCreateError>> {
4004    // add a prefix to parameters to efficiently prevent name collisions
4005    let p_body_kerberos_source_request = kerberos_source_request;
4006
4007    let uri_str = format!("{}/sources/kerberos/", configuration.base_path);
4008    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4009
4010    if let Some(ref user_agent) = configuration.user_agent {
4011        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4012    }
4013    if let Some(ref token) = configuration.bearer_access_token {
4014        req_builder = req_builder.bearer_auth(token.to_owned());
4015    };
4016    req_builder = req_builder.json(&p_body_kerberos_source_request);
4017
4018    let req = req_builder.build()?;
4019    let resp = configuration.client.execute(req).await?;
4020
4021    let status = resp.status();
4022    let content_type = resp
4023        .headers()
4024        .get("content-type")
4025        .and_then(|v| v.to_str().ok())
4026        .unwrap_or("application/octet-stream");
4027    let content_type = super::ContentType::from(content_type);
4028
4029    if !status.is_client_error() && !status.is_server_error() {
4030        let content = resp.text().await?;
4031        match content_type {
4032            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4033            ContentType::Text => {
4034                return Err(Error::from(serde_json::Error::custom(
4035                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4036                )))
4037            }
4038            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4039                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4040            )))),
4041        }
4042    } else {
4043        let content = resp.text().await?;
4044        let entity: Option<SourcesKerberosCreateError> = serde_json::from_str(&content).ok();
4045        Err(Error::ResponseError(ResponseContent {
4046            status,
4047            content,
4048            entity,
4049        }))
4050    }
4051}
4052
4053/// Kerberos Source Viewset
4054pub async fn sources_kerberos_destroy(
4055    configuration: &configuration::Configuration,
4056    slug: &str,
4057) -> Result<(), Error<SourcesKerberosDestroyError>> {
4058    // add a prefix to parameters to efficiently prevent name collisions
4059    let p_path_slug = slug;
4060
4061    let uri_str = format!(
4062        "{}/sources/kerberos/{slug}/",
4063        configuration.base_path,
4064        slug = crate::apis::urlencode(p_path_slug)
4065    );
4066    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4067
4068    if let Some(ref user_agent) = configuration.user_agent {
4069        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4070    }
4071    if let Some(ref token) = configuration.bearer_access_token {
4072        req_builder = req_builder.bearer_auth(token.to_owned());
4073    };
4074
4075    let req = req_builder.build()?;
4076    let resp = configuration.client.execute(req).await?;
4077
4078    let status = resp.status();
4079
4080    if !status.is_client_error() && !status.is_server_error() {
4081        Ok(())
4082    } else {
4083        let content = resp.text().await?;
4084        let entity: Option<SourcesKerberosDestroyError> = serde_json::from_str(&content).ok();
4085        Err(Error::ResponseError(ResponseContent {
4086            status,
4087            content,
4088            entity,
4089        }))
4090    }
4091}
4092
4093/// Kerberos Source Viewset
4094pub async fn sources_kerberos_list(
4095    configuration: &configuration::Configuration,
4096    enabled: Option<bool>,
4097    kadmin_type: Option<&str>,
4098    name: Option<&str>,
4099    ordering: Option<&str>,
4100    page: Option<i32>,
4101    page_size: Option<i32>,
4102    password_login_update_internal_password: Option<bool>,
4103    pbm_uuid: Option<&str>,
4104    realm: Option<&str>,
4105    search: Option<&str>,
4106    slug: Option<&str>,
4107    spnego_server_name: Option<&str>,
4108    sync_principal: Option<&str>,
4109    sync_users: Option<bool>,
4110    sync_users_password: Option<bool>,
4111) -> Result<models::PaginatedKerberosSourceList, Error<SourcesKerberosListError>> {
4112    // add a prefix to parameters to efficiently prevent name collisions
4113    let p_query_enabled = enabled;
4114    let p_query_kadmin_type = kadmin_type;
4115    let p_query_name = name;
4116    let p_query_ordering = ordering;
4117    let p_query_page = page;
4118    let p_query_page_size = page_size;
4119    let p_query_password_login_update_internal_password = password_login_update_internal_password;
4120    let p_query_pbm_uuid = pbm_uuid;
4121    let p_query_realm = realm;
4122    let p_query_search = search;
4123    let p_query_slug = slug;
4124    let p_query_spnego_server_name = spnego_server_name;
4125    let p_query_sync_principal = sync_principal;
4126    let p_query_sync_users = sync_users;
4127    let p_query_sync_users_password = sync_users_password;
4128
4129    let uri_str = format!("{}/sources/kerberos/", configuration.base_path);
4130    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4131
4132    if let Some(ref param_value) = p_query_enabled {
4133        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
4134    }
4135    if let Some(ref param_value) = p_query_kadmin_type {
4136        req_builder = req_builder.query(&[("kadmin_type", &param_value.to_string())]);
4137    }
4138    if let Some(ref param_value) = p_query_name {
4139        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
4140    }
4141    if let Some(ref param_value) = p_query_ordering {
4142        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4143    }
4144    if let Some(ref param_value) = p_query_page {
4145        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4146    }
4147    if let Some(ref param_value) = p_query_page_size {
4148        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4149    }
4150    if let Some(ref param_value) = p_query_password_login_update_internal_password {
4151        req_builder = req_builder.query(&[("password_login_update_internal_password", &param_value.to_string())]);
4152    }
4153    if let Some(ref param_value) = p_query_pbm_uuid {
4154        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
4155    }
4156    if let Some(ref param_value) = p_query_realm {
4157        req_builder = req_builder.query(&[("realm", &param_value.to_string())]);
4158    }
4159    if let Some(ref param_value) = p_query_search {
4160        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4161    }
4162    if let Some(ref param_value) = p_query_slug {
4163        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
4164    }
4165    if let Some(ref param_value) = p_query_spnego_server_name {
4166        req_builder = req_builder.query(&[("spnego_server_name", &param_value.to_string())]);
4167    }
4168    if let Some(ref param_value) = p_query_sync_principal {
4169        req_builder = req_builder.query(&[("sync_principal", &param_value.to_string())]);
4170    }
4171    if let Some(ref param_value) = p_query_sync_users {
4172        req_builder = req_builder.query(&[("sync_users", &param_value.to_string())]);
4173    }
4174    if let Some(ref param_value) = p_query_sync_users_password {
4175        req_builder = req_builder.query(&[("sync_users_password", &param_value.to_string())]);
4176    }
4177    if let Some(ref user_agent) = configuration.user_agent {
4178        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4179    }
4180    if let Some(ref token) = configuration.bearer_access_token {
4181        req_builder = req_builder.bearer_auth(token.to_owned());
4182    };
4183
4184    let req = req_builder.build()?;
4185    let resp = configuration.client.execute(req).await?;
4186
4187    let status = resp.status();
4188    let content_type = resp
4189        .headers()
4190        .get("content-type")
4191        .and_then(|v| v.to_str().ok())
4192        .unwrap_or("application/octet-stream");
4193    let content_type = super::ContentType::from(content_type);
4194
4195    if !status.is_client_error() && !status.is_server_error() {
4196        let content = resp.text().await?;
4197        match content_type {
4198            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4199            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedKerberosSourceList`"))),
4200            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedKerberosSourceList`")))),
4201        }
4202    } else {
4203        let content = resp.text().await?;
4204        let entity: Option<SourcesKerberosListError> = serde_json::from_str(&content).ok();
4205        Err(Error::ResponseError(ResponseContent {
4206            status,
4207            content,
4208            entity,
4209        }))
4210    }
4211}
4212
4213/// Kerberos Source Viewset
4214pub async fn sources_kerberos_partial_update(
4215    configuration: &configuration::Configuration,
4216    slug: &str,
4217    patched_kerberos_source_request: Option<models::PatchedKerberosSourceRequest>,
4218) -> Result<models::KerberosSource, Error<SourcesKerberosPartialUpdateError>> {
4219    // add a prefix to parameters to efficiently prevent name collisions
4220    let p_path_slug = slug;
4221    let p_body_patched_kerberos_source_request = patched_kerberos_source_request;
4222
4223    let uri_str = format!(
4224        "{}/sources/kerberos/{slug}/",
4225        configuration.base_path,
4226        slug = crate::apis::urlencode(p_path_slug)
4227    );
4228    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4229
4230    if let Some(ref user_agent) = configuration.user_agent {
4231        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4232    }
4233    if let Some(ref token) = configuration.bearer_access_token {
4234        req_builder = req_builder.bearer_auth(token.to_owned());
4235    };
4236    req_builder = req_builder.json(&p_body_patched_kerberos_source_request);
4237
4238    let req = req_builder.build()?;
4239    let resp = configuration.client.execute(req).await?;
4240
4241    let status = resp.status();
4242    let content_type = resp
4243        .headers()
4244        .get("content-type")
4245        .and_then(|v| v.to_str().ok())
4246        .unwrap_or("application/octet-stream");
4247    let content_type = super::ContentType::from(content_type);
4248
4249    if !status.is_client_error() && !status.is_server_error() {
4250        let content = resp.text().await?;
4251        match content_type {
4252            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4253            ContentType::Text => {
4254                return Err(Error::from(serde_json::Error::custom(
4255                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4256                )))
4257            }
4258            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4259                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4260            )))),
4261        }
4262    } else {
4263        let content = resp.text().await?;
4264        let entity: Option<SourcesKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
4265        Err(Error::ResponseError(ResponseContent {
4266            status,
4267            content,
4268            entity,
4269        }))
4270    }
4271}
4272
4273/// Kerberos Source Viewset
4274pub async fn sources_kerberos_retrieve(
4275    configuration: &configuration::Configuration,
4276    slug: &str,
4277) -> Result<models::KerberosSource, Error<SourcesKerberosRetrieveError>> {
4278    // add a prefix to parameters to efficiently prevent name collisions
4279    let p_path_slug = slug;
4280
4281    let uri_str = format!(
4282        "{}/sources/kerberos/{slug}/",
4283        configuration.base_path,
4284        slug = crate::apis::urlencode(p_path_slug)
4285    );
4286    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4287
4288    if let Some(ref user_agent) = configuration.user_agent {
4289        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4290    }
4291    if let Some(ref token) = configuration.bearer_access_token {
4292        req_builder = req_builder.bearer_auth(token.to_owned());
4293    };
4294
4295    let req = req_builder.build()?;
4296    let resp = configuration.client.execute(req).await?;
4297
4298    let status = resp.status();
4299    let content_type = resp
4300        .headers()
4301        .get("content-type")
4302        .and_then(|v| v.to_str().ok())
4303        .unwrap_or("application/octet-stream");
4304    let content_type = super::ContentType::from(content_type);
4305
4306    if !status.is_client_error() && !status.is_server_error() {
4307        let content = resp.text().await?;
4308        match content_type {
4309            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4310            ContentType::Text => {
4311                return Err(Error::from(serde_json::Error::custom(
4312                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4313                )))
4314            }
4315            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4316                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4317            )))),
4318        }
4319    } else {
4320        let content = resp.text().await?;
4321        let entity: Option<SourcesKerberosRetrieveError> = serde_json::from_str(&content).ok();
4322        Err(Error::ResponseError(ResponseContent {
4323            status,
4324            content,
4325            entity,
4326        }))
4327    }
4328}
4329
4330/// Get provider's sync status
4331pub async fn sources_kerberos_sync_status_retrieve(
4332    configuration: &configuration::Configuration,
4333    slug: &str,
4334) -> Result<models::SyncStatus, Error<SourcesKerberosSyncStatusRetrieveError>> {
4335    // add a prefix to parameters to efficiently prevent name collisions
4336    let p_path_slug = slug;
4337
4338    let uri_str = format!(
4339        "{}/sources/kerberos/{slug}/sync/status/",
4340        configuration.base_path,
4341        slug = crate::apis::urlencode(p_path_slug)
4342    );
4343    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4344
4345    if let Some(ref user_agent) = configuration.user_agent {
4346        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4347    }
4348    if let Some(ref token) = configuration.bearer_access_token {
4349        req_builder = req_builder.bearer_auth(token.to_owned());
4350    };
4351
4352    let req = req_builder.build()?;
4353    let resp = configuration.client.execute(req).await?;
4354
4355    let status = resp.status();
4356    let content_type = resp
4357        .headers()
4358        .get("content-type")
4359        .and_then(|v| v.to_str().ok())
4360        .unwrap_or("application/octet-stream");
4361    let content_type = super::ContentType::from(content_type);
4362
4363    if !status.is_client_error() && !status.is_server_error() {
4364        let content = resp.text().await?;
4365        match content_type {
4366            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4367            ContentType::Text => {
4368                return Err(Error::from(serde_json::Error::custom(
4369                    "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
4370                )))
4371            }
4372            ContentType::Unsupported(unknown_type) => {
4373                return Err(Error::from(serde_json::Error::custom(format!(
4374                    "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
4375                ))))
4376            }
4377        }
4378    } else {
4379        let content = resp.text().await?;
4380        let entity: Option<SourcesKerberosSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
4381        Err(Error::ResponseError(ResponseContent {
4382            status,
4383            content,
4384            entity,
4385        }))
4386    }
4387}
4388
4389/// Kerberos Source Viewset
4390pub async fn sources_kerberos_update(
4391    configuration: &configuration::Configuration,
4392    slug: &str,
4393    kerberos_source_request: models::KerberosSourceRequest,
4394) -> Result<models::KerberosSource, Error<SourcesKerberosUpdateError>> {
4395    // add a prefix to parameters to efficiently prevent name collisions
4396    let p_path_slug = slug;
4397    let p_body_kerberos_source_request = kerberos_source_request;
4398
4399    let uri_str = format!(
4400        "{}/sources/kerberos/{slug}/",
4401        configuration.base_path,
4402        slug = crate::apis::urlencode(p_path_slug)
4403    );
4404    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4405
4406    if let Some(ref user_agent) = configuration.user_agent {
4407        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4408    }
4409    if let Some(ref token) = configuration.bearer_access_token {
4410        req_builder = req_builder.bearer_auth(token.to_owned());
4411    };
4412    req_builder = req_builder.json(&p_body_kerberos_source_request);
4413
4414    let req = req_builder.build()?;
4415    let resp = configuration.client.execute(req).await?;
4416
4417    let status = resp.status();
4418    let content_type = resp
4419        .headers()
4420        .get("content-type")
4421        .and_then(|v| v.to_str().ok())
4422        .unwrap_or("application/octet-stream");
4423    let content_type = super::ContentType::from(content_type);
4424
4425    if !status.is_client_error() && !status.is_server_error() {
4426        let content = resp.text().await?;
4427        match content_type {
4428            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4429            ContentType::Text => {
4430                return Err(Error::from(serde_json::Error::custom(
4431                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4432                )))
4433            }
4434            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4435                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4436            )))),
4437        }
4438    } else {
4439        let content = resp.text().await?;
4440        let entity: Option<SourcesKerberosUpdateError> = serde_json::from_str(&content).ok();
4441        Err(Error::ResponseError(ResponseContent {
4442            status,
4443            content,
4444            entity,
4445        }))
4446    }
4447}
4448
4449/// Get a list of all objects that use this object
4450pub async fn sources_kerberos_used_by_list(
4451    configuration: &configuration::Configuration,
4452    slug: &str,
4453) -> Result<Vec<models::UsedBy>, Error<SourcesKerberosUsedByListError>> {
4454    // add a prefix to parameters to efficiently prevent name collisions
4455    let p_path_slug = slug;
4456
4457    let uri_str = format!(
4458        "{}/sources/kerberos/{slug}/used_by/",
4459        configuration.base_path,
4460        slug = crate::apis::urlencode(p_path_slug)
4461    );
4462    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4463
4464    if let Some(ref user_agent) = configuration.user_agent {
4465        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4466    }
4467    if let Some(ref token) = configuration.bearer_access_token {
4468        req_builder = req_builder.bearer_auth(token.to_owned());
4469    };
4470
4471    let req = req_builder.build()?;
4472    let resp = configuration.client.execute(req).await?;
4473
4474    let status = resp.status();
4475    let content_type = resp
4476        .headers()
4477        .get("content-type")
4478        .and_then(|v| v.to_str().ok())
4479        .unwrap_or("application/octet-stream");
4480    let content_type = super::ContentType::from(content_type);
4481
4482    if !status.is_client_error() && !status.is_server_error() {
4483        let content = resp.text().await?;
4484        match content_type {
4485            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4486            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;`"))),
4487            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;`")))),
4488        }
4489    } else {
4490        let content = resp.text().await?;
4491        let entity: Option<SourcesKerberosUsedByListError> = serde_json::from_str(&content).ok();
4492        Err(Error::ResponseError(ResponseContent {
4493            status,
4494            content,
4495            entity,
4496        }))
4497    }
4498}
4499
4500/// LDAP Source Viewset
4501pub async fn sources_ldap_create(
4502    configuration: &configuration::Configuration,
4503    ldap_source_request: models::LdapSourceRequest,
4504) -> Result<models::LdapSource, Error<SourcesLdapCreateError>> {
4505    // add a prefix to parameters to efficiently prevent name collisions
4506    let p_body_ldap_source_request = ldap_source_request;
4507
4508    let uri_str = format!("{}/sources/ldap/", configuration.base_path);
4509    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4510
4511    if let Some(ref user_agent) = configuration.user_agent {
4512        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4513    }
4514    if let Some(ref token) = configuration.bearer_access_token {
4515        req_builder = req_builder.bearer_auth(token.to_owned());
4516    };
4517    req_builder = req_builder.json(&p_body_ldap_source_request);
4518
4519    let req = req_builder.build()?;
4520    let resp = configuration.client.execute(req).await?;
4521
4522    let status = resp.status();
4523    let content_type = resp
4524        .headers()
4525        .get("content-type")
4526        .and_then(|v| v.to_str().ok())
4527        .unwrap_or("application/octet-stream");
4528    let content_type = super::ContentType::from(content_type);
4529
4530    if !status.is_client_error() && !status.is_server_error() {
4531        let content = resp.text().await?;
4532        match content_type {
4533            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4534            ContentType::Text => {
4535                return Err(Error::from(serde_json::Error::custom(
4536                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
4537                )))
4538            }
4539            ContentType::Unsupported(unknown_type) => {
4540                return Err(Error::from(serde_json::Error::custom(format!(
4541                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
4542                ))))
4543            }
4544        }
4545    } else {
4546        let content = resp.text().await?;
4547        let entity: Option<SourcesLdapCreateError> = serde_json::from_str(&content).ok();
4548        Err(Error::ResponseError(ResponseContent {
4549            status,
4550            content,
4551            entity,
4552        }))
4553    }
4554}
4555
4556/// Get raw LDAP data to debug
4557pub async fn sources_ldap_debug_retrieve(
4558    configuration: &configuration::Configuration,
4559    slug: &str,
4560) -> Result<models::LdapDebug, Error<SourcesLdapDebugRetrieveError>> {
4561    // add a prefix to parameters to efficiently prevent name collisions
4562    let p_path_slug = slug;
4563
4564    let uri_str = format!(
4565        "{}/sources/ldap/{slug}/debug/",
4566        configuration.base_path,
4567        slug = crate::apis::urlencode(p_path_slug)
4568    );
4569    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4570
4571    if let Some(ref user_agent) = configuration.user_agent {
4572        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4573    }
4574    if let Some(ref token) = configuration.bearer_access_token {
4575        req_builder = req_builder.bearer_auth(token.to_owned());
4576    };
4577
4578    let req = req_builder.build()?;
4579    let resp = configuration.client.execute(req).await?;
4580
4581    let status = resp.status();
4582    let content_type = resp
4583        .headers()
4584        .get("content-type")
4585        .and_then(|v| v.to_str().ok())
4586        .unwrap_or("application/octet-stream");
4587    let content_type = super::ContentType::from(content_type);
4588
4589    if !status.is_client_error() && !status.is_server_error() {
4590        let content = resp.text().await?;
4591        match content_type {
4592            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4593            ContentType::Text => {
4594                return Err(Error::from(serde_json::Error::custom(
4595                    "Received `text/plain` content type response that cannot be converted to `models::LdapDebug`",
4596                )))
4597            }
4598            ContentType::Unsupported(unknown_type) => {
4599                return Err(Error::from(serde_json::Error::custom(format!(
4600                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapDebug`"
4601                ))))
4602            }
4603        }
4604    } else {
4605        let content = resp.text().await?;
4606        let entity: Option<SourcesLdapDebugRetrieveError> = serde_json::from_str(&content).ok();
4607        Err(Error::ResponseError(ResponseContent {
4608            status,
4609            content,
4610            entity,
4611        }))
4612    }
4613}
4614
4615/// LDAP Source Viewset
4616pub async fn sources_ldap_destroy(
4617    configuration: &configuration::Configuration,
4618    slug: &str,
4619) -> Result<(), Error<SourcesLdapDestroyError>> {
4620    // add a prefix to parameters to efficiently prevent name collisions
4621    let p_path_slug = slug;
4622
4623    let uri_str = format!(
4624        "{}/sources/ldap/{slug}/",
4625        configuration.base_path,
4626        slug = crate::apis::urlencode(p_path_slug)
4627    );
4628    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4629
4630    if let Some(ref user_agent) = configuration.user_agent {
4631        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4632    }
4633    if let Some(ref token) = configuration.bearer_access_token {
4634        req_builder = req_builder.bearer_auth(token.to_owned());
4635    };
4636
4637    let req = req_builder.build()?;
4638    let resp = configuration.client.execute(req).await?;
4639
4640    let status = resp.status();
4641
4642    if !status.is_client_error() && !status.is_server_error() {
4643        Ok(())
4644    } else {
4645        let content = resp.text().await?;
4646        let entity: Option<SourcesLdapDestroyError> = serde_json::from_str(&content).ok();
4647        Err(Error::ResponseError(ResponseContent {
4648            status,
4649            content,
4650            entity,
4651        }))
4652    }
4653}
4654
4655/// LDAP Source Viewset
4656pub async fn sources_ldap_list(
4657    configuration: &configuration::Configuration,
4658    additional_group_dn: Option<&str>,
4659    additional_user_dn: Option<&str>,
4660    base_dn: Option<&str>,
4661    bind_cn: Option<&str>,
4662    client_certificate: Option<&str>,
4663    delete_not_found_objects: Option<bool>,
4664    enabled: Option<bool>,
4665    group_membership_field: Option<&str>,
4666    group_object_filter: Option<&str>,
4667    group_property_mappings: Option<Vec<uuid::Uuid>>,
4668    lookup_groups_from_user: Option<bool>,
4669    name: Option<&str>,
4670    object_uniqueness_field: Option<&str>,
4671    ordering: Option<&str>,
4672    page: Option<i32>,
4673    page_size: Option<i32>,
4674    password_login_update_internal_password: Option<bool>,
4675    pbm_uuid: Option<&str>,
4676    peer_certificate: Option<&str>,
4677    search: Option<&str>,
4678    server_uri: Option<&str>,
4679    slug: Option<&str>,
4680    sni: Option<bool>,
4681    start_tls: Option<bool>,
4682    sync_groups: Option<bool>,
4683    sync_parent_group: Option<&str>,
4684    sync_users: Option<bool>,
4685    sync_users_password: Option<bool>,
4686    user_membership_attribute: Option<&str>,
4687    user_object_filter: Option<&str>,
4688    user_property_mappings: Option<Vec<uuid::Uuid>>,
4689) -> Result<models::PaginatedLdapSourceList, Error<SourcesLdapListError>> {
4690    // add a prefix to parameters to efficiently prevent name collisions
4691    let p_query_additional_group_dn = additional_group_dn;
4692    let p_query_additional_user_dn = additional_user_dn;
4693    let p_query_base_dn = base_dn;
4694    let p_query_bind_cn = bind_cn;
4695    let p_query_client_certificate = client_certificate;
4696    let p_query_delete_not_found_objects = delete_not_found_objects;
4697    let p_query_enabled = enabled;
4698    let p_query_group_membership_field = group_membership_field;
4699    let p_query_group_object_filter = group_object_filter;
4700    let p_query_group_property_mappings = group_property_mappings;
4701    let p_query_lookup_groups_from_user = lookup_groups_from_user;
4702    let p_query_name = name;
4703    let p_query_object_uniqueness_field = object_uniqueness_field;
4704    let p_query_ordering = ordering;
4705    let p_query_page = page;
4706    let p_query_page_size = page_size;
4707    let p_query_password_login_update_internal_password = password_login_update_internal_password;
4708    let p_query_pbm_uuid = pbm_uuid;
4709    let p_query_peer_certificate = peer_certificate;
4710    let p_query_search = search;
4711    let p_query_server_uri = server_uri;
4712    let p_query_slug = slug;
4713    let p_query_sni = sni;
4714    let p_query_start_tls = start_tls;
4715    let p_query_sync_groups = sync_groups;
4716    let p_query_sync_parent_group = sync_parent_group;
4717    let p_query_sync_users = sync_users;
4718    let p_query_sync_users_password = sync_users_password;
4719    let p_query_user_membership_attribute = user_membership_attribute;
4720    let p_query_user_object_filter = user_object_filter;
4721    let p_query_user_property_mappings = user_property_mappings;
4722
4723    let uri_str = format!("{}/sources/ldap/", configuration.base_path);
4724    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4725
4726    if let Some(ref param_value) = p_query_additional_group_dn {
4727        req_builder = req_builder.query(&[("additional_group_dn", &param_value.to_string())]);
4728    }
4729    if let Some(ref param_value) = p_query_additional_user_dn {
4730        req_builder = req_builder.query(&[("additional_user_dn", &param_value.to_string())]);
4731    }
4732    if let Some(ref param_value) = p_query_base_dn {
4733        req_builder = req_builder.query(&[("base_dn", &param_value.to_string())]);
4734    }
4735    if let Some(ref param_value) = p_query_bind_cn {
4736        req_builder = req_builder.query(&[("bind_cn", &param_value.to_string())]);
4737    }
4738    if let Some(ref param_value) = p_query_client_certificate {
4739        req_builder = req_builder.query(&[("client_certificate", &param_value.to_string())]);
4740    }
4741    if let Some(ref param_value) = p_query_delete_not_found_objects {
4742        req_builder = req_builder.query(&[("delete_not_found_objects", &param_value.to_string())]);
4743    }
4744    if let Some(ref param_value) = p_query_enabled {
4745        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
4746    }
4747    if let Some(ref param_value) = p_query_group_membership_field {
4748        req_builder = req_builder.query(&[("group_membership_field", &param_value.to_string())]);
4749    }
4750    if let Some(ref param_value) = p_query_group_object_filter {
4751        req_builder = req_builder.query(&[("group_object_filter", &param_value.to_string())]);
4752    }
4753    if let Some(ref param_value) = p_query_group_property_mappings {
4754        req_builder = match "multi" {
4755            "multi" => req_builder.query(
4756                &param_value
4757                    .into_iter()
4758                    .map(|p| ("group_property_mappings".to_owned(), p.to_string()))
4759                    .collect::<Vec<(std::string::String, std::string::String)>>(),
4760            ),
4761            _ => req_builder.query(&[(
4762                "group_property_mappings",
4763                &param_value
4764                    .into_iter()
4765                    .map(|p| p.to_string())
4766                    .collect::<Vec<String>>()
4767                    .join(",")
4768                    .to_string(),
4769            )]),
4770        };
4771    }
4772    if let Some(ref param_value) = p_query_lookup_groups_from_user {
4773        req_builder = req_builder.query(&[("lookup_groups_from_user", &param_value.to_string())]);
4774    }
4775    if let Some(ref param_value) = p_query_name {
4776        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
4777    }
4778    if let Some(ref param_value) = p_query_object_uniqueness_field {
4779        req_builder = req_builder.query(&[("object_uniqueness_field", &param_value.to_string())]);
4780    }
4781    if let Some(ref param_value) = p_query_ordering {
4782        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4783    }
4784    if let Some(ref param_value) = p_query_page {
4785        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4786    }
4787    if let Some(ref param_value) = p_query_page_size {
4788        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4789    }
4790    if let Some(ref param_value) = p_query_password_login_update_internal_password {
4791        req_builder = req_builder.query(&[("password_login_update_internal_password", &param_value.to_string())]);
4792    }
4793    if let Some(ref param_value) = p_query_pbm_uuid {
4794        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
4795    }
4796    if let Some(ref param_value) = p_query_peer_certificate {
4797        req_builder = req_builder.query(&[("peer_certificate", &param_value.to_string())]);
4798    }
4799    if let Some(ref param_value) = p_query_search {
4800        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4801    }
4802    if let Some(ref param_value) = p_query_server_uri {
4803        req_builder = req_builder.query(&[("server_uri", &param_value.to_string())]);
4804    }
4805    if let Some(ref param_value) = p_query_slug {
4806        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
4807    }
4808    if let Some(ref param_value) = p_query_sni {
4809        req_builder = req_builder.query(&[("sni", &param_value.to_string())]);
4810    }
4811    if let Some(ref param_value) = p_query_start_tls {
4812        req_builder = req_builder.query(&[("start_tls", &param_value.to_string())]);
4813    }
4814    if let Some(ref param_value) = p_query_sync_groups {
4815        req_builder = req_builder.query(&[("sync_groups", &param_value.to_string())]);
4816    }
4817    if let Some(ref param_value) = p_query_sync_parent_group {
4818        req_builder = req_builder.query(&[("sync_parent_group", &param_value.to_string())]);
4819    }
4820    if let Some(ref param_value) = p_query_sync_users {
4821        req_builder = req_builder.query(&[("sync_users", &param_value.to_string())]);
4822    }
4823    if let Some(ref param_value) = p_query_sync_users_password {
4824        req_builder = req_builder.query(&[("sync_users_password", &param_value.to_string())]);
4825    }
4826    if let Some(ref param_value) = p_query_user_membership_attribute {
4827        req_builder = req_builder.query(&[("user_membership_attribute", &param_value.to_string())]);
4828    }
4829    if let Some(ref param_value) = p_query_user_object_filter {
4830        req_builder = req_builder.query(&[("user_object_filter", &param_value.to_string())]);
4831    }
4832    if let Some(ref param_value) = p_query_user_property_mappings {
4833        req_builder = match "multi" {
4834            "multi" => req_builder.query(
4835                &param_value
4836                    .into_iter()
4837                    .map(|p| ("user_property_mappings".to_owned(), p.to_string()))
4838                    .collect::<Vec<(std::string::String, std::string::String)>>(),
4839            ),
4840            _ => req_builder.query(&[(
4841                "user_property_mappings",
4842                &param_value
4843                    .into_iter()
4844                    .map(|p| p.to_string())
4845                    .collect::<Vec<String>>()
4846                    .join(",")
4847                    .to_string(),
4848            )]),
4849        };
4850    }
4851    if let Some(ref user_agent) = configuration.user_agent {
4852        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4853    }
4854    if let Some(ref token) = configuration.bearer_access_token {
4855        req_builder = req_builder.bearer_auth(token.to_owned());
4856    };
4857
4858    let req = req_builder.build()?;
4859    let resp = configuration.client.execute(req).await?;
4860
4861    let status = resp.status();
4862    let content_type = resp
4863        .headers()
4864        .get("content-type")
4865        .and_then(|v| v.to_str().ok())
4866        .unwrap_or("application/octet-stream");
4867    let content_type = super::ContentType::from(content_type);
4868
4869    if !status.is_client_error() && !status.is_server_error() {
4870        let content = resp.text().await?;
4871        match content_type {
4872            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4873            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapSourceList`"))),
4874            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedLdapSourceList`")))),
4875        }
4876    } else {
4877        let content = resp.text().await?;
4878        let entity: Option<SourcesLdapListError> = serde_json::from_str(&content).ok();
4879        Err(Error::ResponseError(ResponseContent {
4880            status,
4881            content,
4882            entity,
4883        }))
4884    }
4885}
4886
4887/// LDAP Source Viewset
4888pub async fn sources_ldap_partial_update(
4889    configuration: &configuration::Configuration,
4890    slug: &str,
4891    patched_ldap_source_request: Option<models::PatchedLdapSourceRequest>,
4892) -> Result<models::LdapSource, Error<SourcesLdapPartialUpdateError>> {
4893    // add a prefix to parameters to efficiently prevent name collisions
4894    let p_path_slug = slug;
4895    let p_body_patched_ldap_source_request = patched_ldap_source_request;
4896
4897    let uri_str = format!(
4898        "{}/sources/ldap/{slug}/",
4899        configuration.base_path,
4900        slug = crate::apis::urlencode(p_path_slug)
4901    );
4902    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4903
4904    if let Some(ref user_agent) = configuration.user_agent {
4905        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4906    }
4907    if let Some(ref token) = configuration.bearer_access_token {
4908        req_builder = req_builder.bearer_auth(token.to_owned());
4909    };
4910    req_builder = req_builder.json(&p_body_patched_ldap_source_request);
4911
4912    let req = req_builder.build()?;
4913    let resp = configuration.client.execute(req).await?;
4914
4915    let status = resp.status();
4916    let content_type = resp
4917        .headers()
4918        .get("content-type")
4919        .and_then(|v| v.to_str().ok())
4920        .unwrap_or("application/octet-stream");
4921    let content_type = super::ContentType::from(content_type);
4922
4923    if !status.is_client_error() && !status.is_server_error() {
4924        let content = resp.text().await?;
4925        match content_type {
4926            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4927            ContentType::Text => {
4928                return Err(Error::from(serde_json::Error::custom(
4929                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
4930                )))
4931            }
4932            ContentType::Unsupported(unknown_type) => {
4933                return Err(Error::from(serde_json::Error::custom(format!(
4934                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
4935                ))))
4936            }
4937        }
4938    } else {
4939        let content = resp.text().await?;
4940        let entity: Option<SourcesLdapPartialUpdateError> = serde_json::from_str(&content).ok();
4941        Err(Error::ResponseError(ResponseContent {
4942            status,
4943            content,
4944            entity,
4945        }))
4946    }
4947}
4948
4949/// LDAP Source Viewset
4950pub async fn sources_ldap_retrieve(
4951    configuration: &configuration::Configuration,
4952    slug: &str,
4953) -> Result<models::LdapSource, Error<SourcesLdapRetrieveError>> {
4954    // add a prefix to parameters to efficiently prevent name collisions
4955    let p_path_slug = slug;
4956
4957    let uri_str = format!(
4958        "{}/sources/ldap/{slug}/",
4959        configuration.base_path,
4960        slug = crate::apis::urlencode(p_path_slug)
4961    );
4962    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4963
4964    if let Some(ref user_agent) = configuration.user_agent {
4965        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4966    }
4967    if let Some(ref token) = configuration.bearer_access_token {
4968        req_builder = req_builder.bearer_auth(token.to_owned());
4969    };
4970
4971    let req = req_builder.build()?;
4972    let resp = configuration.client.execute(req).await?;
4973
4974    let status = resp.status();
4975    let content_type = resp
4976        .headers()
4977        .get("content-type")
4978        .and_then(|v| v.to_str().ok())
4979        .unwrap_or("application/octet-stream");
4980    let content_type = super::ContentType::from(content_type);
4981
4982    if !status.is_client_error() && !status.is_server_error() {
4983        let content = resp.text().await?;
4984        match content_type {
4985            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4986            ContentType::Text => {
4987                return Err(Error::from(serde_json::Error::custom(
4988                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
4989                )))
4990            }
4991            ContentType::Unsupported(unknown_type) => {
4992                return Err(Error::from(serde_json::Error::custom(format!(
4993                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
4994                ))))
4995            }
4996        }
4997    } else {
4998        let content = resp.text().await?;
4999        let entity: Option<SourcesLdapRetrieveError> = serde_json::from_str(&content).ok();
5000        Err(Error::ResponseError(ResponseContent {
5001            status,
5002            content,
5003            entity,
5004        }))
5005    }
5006}
5007
5008/// Get provider's sync status
5009pub async fn sources_ldap_sync_status_retrieve(
5010    configuration: &configuration::Configuration,
5011    slug: &str,
5012) -> Result<models::SyncStatus, Error<SourcesLdapSyncStatusRetrieveError>> {
5013    // add a prefix to parameters to efficiently prevent name collisions
5014    let p_path_slug = slug;
5015
5016    let uri_str = format!(
5017        "{}/sources/ldap/{slug}/sync/status/",
5018        configuration.base_path,
5019        slug = crate::apis::urlencode(p_path_slug)
5020    );
5021    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5022
5023    if let Some(ref user_agent) = configuration.user_agent {
5024        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5025    }
5026    if let Some(ref token) = configuration.bearer_access_token {
5027        req_builder = req_builder.bearer_auth(token.to_owned());
5028    };
5029
5030    let req = req_builder.build()?;
5031    let resp = configuration.client.execute(req).await?;
5032
5033    let status = resp.status();
5034    let content_type = resp
5035        .headers()
5036        .get("content-type")
5037        .and_then(|v| v.to_str().ok())
5038        .unwrap_or("application/octet-stream");
5039    let content_type = super::ContentType::from(content_type);
5040
5041    if !status.is_client_error() && !status.is_server_error() {
5042        let content = resp.text().await?;
5043        match content_type {
5044            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5045            ContentType::Text => {
5046                return Err(Error::from(serde_json::Error::custom(
5047                    "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
5048                )))
5049            }
5050            ContentType::Unsupported(unknown_type) => {
5051                return Err(Error::from(serde_json::Error::custom(format!(
5052                    "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
5053                ))))
5054            }
5055        }
5056    } else {
5057        let content = resp.text().await?;
5058        let entity: Option<SourcesLdapSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
5059        Err(Error::ResponseError(ResponseContent {
5060            status,
5061            content,
5062            entity,
5063        }))
5064    }
5065}
5066
5067/// LDAP Source Viewset
5068pub async fn sources_ldap_update(
5069    configuration: &configuration::Configuration,
5070    slug: &str,
5071    ldap_source_request: models::LdapSourceRequest,
5072) -> Result<models::LdapSource, Error<SourcesLdapUpdateError>> {
5073    // add a prefix to parameters to efficiently prevent name collisions
5074    let p_path_slug = slug;
5075    let p_body_ldap_source_request = ldap_source_request;
5076
5077    let uri_str = format!(
5078        "{}/sources/ldap/{slug}/",
5079        configuration.base_path,
5080        slug = crate::apis::urlencode(p_path_slug)
5081    );
5082    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5083
5084    if let Some(ref user_agent) = configuration.user_agent {
5085        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5086    }
5087    if let Some(ref token) = configuration.bearer_access_token {
5088        req_builder = req_builder.bearer_auth(token.to_owned());
5089    };
5090    req_builder = req_builder.json(&p_body_ldap_source_request);
5091
5092    let req = req_builder.build()?;
5093    let resp = configuration.client.execute(req).await?;
5094
5095    let status = resp.status();
5096    let content_type = resp
5097        .headers()
5098        .get("content-type")
5099        .and_then(|v| v.to_str().ok())
5100        .unwrap_or("application/octet-stream");
5101    let content_type = super::ContentType::from(content_type);
5102
5103    if !status.is_client_error() && !status.is_server_error() {
5104        let content = resp.text().await?;
5105        match content_type {
5106            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5107            ContentType::Text => {
5108                return Err(Error::from(serde_json::Error::custom(
5109                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5110                )))
5111            }
5112            ContentType::Unsupported(unknown_type) => {
5113                return Err(Error::from(serde_json::Error::custom(format!(
5114                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5115                ))))
5116            }
5117        }
5118    } else {
5119        let content = resp.text().await?;
5120        let entity: Option<SourcesLdapUpdateError> = serde_json::from_str(&content).ok();
5121        Err(Error::ResponseError(ResponseContent {
5122            status,
5123            content,
5124            entity,
5125        }))
5126    }
5127}
5128
5129/// Get a list of all objects that use this object
5130pub async fn sources_ldap_used_by_list(
5131    configuration: &configuration::Configuration,
5132    slug: &str,
5133) -> Result<Vec<models::UsedBy>, Error<SourcesLdapUsedByListError>> {
5134    // add a prefix to parameters to efficiently prevent name collisions
5135    let p_path_slug = slug;
5136
5137    let uri_str = format!(
5138        "{}/sources/ldap/{slug}/used_by/",
5139        configuration.base_path,
5140        slug = crate::apis::urlencode(p_path_slug)
5141    );
5142    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5143
5144    if let Some(ref user_agent) = configuration.user_agent {
5145        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5146    }
5147    if let Some(ref token) = configuration.bearer_access_token {
5148        req_builder = req_builder.bearer_auth(token.to_owned());
5149    };
5150
5151    let req = req_builder.build()?;
5152    let resp = configuration.client.execute(req).await?;
5153
5154    let status = resp.status();
5155    let content_type = resp
5156        .headers()
5157        .get("content-type")
5158        .and_then(|v| v.to_str().ok())
5159        .unwrap_or("application/octet-stream");
5160    let content_type = super::ContentType::from(content_type);
5161
5162    if !status.is_client_error() && !status.is_server_error() {
5163        let content = resp.text().await?;
5164        match content_type {
5165            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5166            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;`"))),
5167            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;`")))),
5168        }
5169    } else {
5170        let content = resp.text().await?;
5171        let entity: Option<SourcesLdapUsedByListError> = serde_json::from_str(&content).ok();
5172        Err(Error::ResponseError(ResponseContent {
5173            status,
5174            content,
5175            entity,
5176        }))
5177    }
5178}
5179
5180/// Source Viewset
5181pub async fn sources_oauth_create(
5182    configuration: &configuration::Configuration,
5183    o_auth_source_request: models::OAuthSourceRequest,
5184) -> Result<models::OAuthSource, Error<SourcesOauthCreateError>> {
5185    // add a prefix to parameters to efficiently prevent name collisions
5186    let p_body_o_auth_source_request = o_auth_source_request;
5187
5188    let uri_str = format!("{}/sources/oauth/", configuration.base_path);
5189    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5190
5191    if let Some(ref user_agent) = configuration.user_agent {
5192        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5193    }
5194    if let Some(ref token) = configuration.bearer_access_token {
5195        req_builder = req_builder.bearer_auth(token.to_owned());
5196    };
5197    req_builder = req_builder.json(&p_body_o_auth_source_request);
5198
5199    let req = req_builder.build()?;
5200    let resp = configuration.client.execute(req).await?;
5201
5202    let status = resp.status();
5203    let content_type = resp
5204        .headers()
5205        .get("content-type")
5206        .and_then(|v| v.to_str().ok())
5207        .unwrap_or("application/octet-stream");
5208    let content_type = super::ContentType::from(content_type);
5209
5210    if !status.is_client_error() && !status.is_server_error() {
5211        let content = resp.text().await?;
5212        match content_type {
5213            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5214            ContentType::Text => {
5215                return Err(Error::from(serde_json::Error::custom(
5216                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5217                )))
5218            }
5219            ContentType::Unsupported(unknown_type) => {
5220                return Err(Error::from(serde_json::Error::custom(format!(
5221                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5222                ))))
5223            }
5224        }
5225    } else {
5226        let content = resp.text().await?;
5227        let entity: Option<SourcesOauthCreateError> = serde_json::from_str(&content).ok();
5228        Err(Error::ResponseError(ResponseContent {
5229            status,
5230            content,
5231            entity,
5232        }))
5233    }
5234}
5235
5236/// Source Viewset
5237pub async fn sources_oauth_destroy(
5238    configuration: &configuration::Configuration,
5239    slug: &str,
5240) -> Result<(), Error<SourcesOauthDestroyError>> {
5241    // add a prefix to parameters to efficiently prevent name collisions
5242    let p_path_slug = slug;
5243
5244    let uri_str = format!(
5245        "{}/sources/oauth/{slug}/",
5246        configuration.base_path,
5247        slug = crate::apis::urlencode(p_path_slug)
5248    );
5249    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5250
5251    if let Some(ref user_agent) = configuration.user_agent {
5252        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5253    }
5254    if let Some(ref token) = configuration.bearer_access_token {
5255        req_builder = req_builder.bearer_auth(token.to_owned());
5256    };
5257
5258    let req = req_builder.build()?;
5259    let resp = configuration.client.execute(req).await?;
5260
5261    let status = resp.status();
5262
5263    if !status.is_client_error() && !status.is_server_error() {
5264        Ok(())
5265    } else {
5266        let content = resp.text().await?;
5267        let entity: Option<SourcesOauthDestroyError> = serde_json::from_str(&content).ok();
5268        Err(Error::ResponseError(ResponseContent {
5269            status,
5270            content,
5271            entity,
5272        }))
5273    }
5274}
5275
5276/// Source Viewset
5277pub async fn sources_oauth_list(
5278    configuration: &configuration::Configuration,
5279    access_token_url: Option<&str>,
5280    additional_scopes: Option<&str>,
5281    authentication_flow: Option<&str>,
5282    authorization_url: Option<&str>,
5283    consumer_key: Option<&str>,
5284    enabled: Option<bool>,
5285    enrollment_flow: Option<&str>,
5286    group_matching_mode: Option<&str>,
5287    has_jwks: Option<bool>,
5288    name: Option<&str>,
5289    ordering: Option<&str>,
5290    page: Option<i32>,
5291    page_size: Option<i32>,
5292    pbm_uuid: Option<&str>,
5293    policy_engine_mode: Option<&str>,
5294    profile_url: Option<&str>,
5295    provider_type: Option<&str>,
5296    request_token_url: Option<&str>,
5297    search: Option<&str>,
5298    slug: Option<&str>,
5299    user_matching_mode: Option<&str>,
5300) -> Result<models::PaginatedOAuthSourceList, Error<SourcesOauthListError>> {
5301    // add a prefix to parameters to efficiently prevent name collisions
5302    let p_query_access_token_url = access_token_url;
5303    let p_query_additional_scopes = additional_scopes;
5304    let p_query_authentication_flow = authentication_flow;
5305    let p_query_authorization_url = authorization_url;
5306    let p_query_consumer_key = consumer_key;
5307    let p_query_enabled = enabled;
5308    let p_query_enrollment_flow = enrollment_flow;
5309    let p_query_group_matching_mode = group_matching_mode;
5310    let p_query_has_jwks = has_jwks;
5311    let p_query_name = name;
5312    let p_query_ordering = ordering;
5313    let p_query_page = page;
5314    let p_query_page_size = page_size;
5315    let p_query_pbm_uuid = pbm_uuid;
5316    let p_query_policy_engine_mode = policy_engine_mode;
5317    let p_query_profile_url = profile_url;
5318    let p_query_provider_type = provider_type;
5319    let p_query_request_token_url = request_token_url;
5320    let p_query_search = search;
5321    let p_query_slug = slug;
5322    let p_query_user_matching_mode = user_matching_mode;
5323
5324    let uri_str = format!("{}/sources/oauth/", configuration.base_path);
5325    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5326
5327    if let Some(ref param_value) = p_query_access_token_url {
5328        req_builder = req_builder.query(&[("access_token_url", &param_value.to_string())]);
5329    }
5330    if let Some(ref param_value) = p_query_additional_scopes {
5331        req_builder = req_builder.query(&[("additional_scopes", &param_value.to_string())]);
5332    }
5333    if let Some(ref param_value) = p_query_authentication_flow {
5334        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
5335    }
5336    if let Some(ref param_value) = p_query_authorization_url {
5337        req_builder = req_builder.query(&[("authorization_url", &param_value.to_string())]);
5338    }
5339    if let Some(ref param_value) = p_query_consumer_key {
5340        req_builder = req_builder.query(&[("consumer_key", &param_value.to_string())]);
5341    }
5342    if let Some(ref param_value) = p_query_enabled {
5343        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
5344    }
5345    if let Some(ref param_value) = p_query_enrollment_flow {
5346        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
5347    }
5348    if let Some(ref param_value) = p_query_group_matching_mode {
5349        req_builder = req_builder.query(&[("group_matching_mode", &param_value.to_string())]);
5350    }
5351    if let Some(ref param_value) = p_query_has_jwks {
5352        req_builder = req_builder.query(&[("has_jwks", &param_value.to_string())]);
5353    }
5354    if let Some(ref param_value) = p_query_name {
5355        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5356    }
5357    if let Some(ref param_value) = p_query_ordering {
5358        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5359    }
5360    if let Some(ref param_value) = p_query_page {
5361        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5362    }
5363    if let Some(ref param_value) = p_query_page_size {
5364        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5365    }
5366    if let Some(ref param_value) = p_query_pbm_uuid {
5367        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
5368    }
5369    if let Some(ref param_value) = p_query_policy_engine_mode {
5370        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
5371    }
5372    if let Some(ref param_value) = p_query_profile_url {
5373        req_builder = req_builder.query(&[("profile_url", &param_value.to_string())]);
5374    }
5375    if let Some(ref param_value) = p_query_provider_type {
5376        req_builder = req_builder.query(&[("provider_type", &param_value.to_string())]);
5377    }
5378    if let Some(ref param_value) = p_query_request_token_url {
5379        req_builder = req_builder.query(&[("request_token_url", &param_value.to_string())]);
5380    }
5381    if let Some(ref param_value) = p_query_search {
5382        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5383    }
5384    if let Some(ref param_value) = p_query_slug {
5385        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
5386    }
5387    if let Some(ref param_value) = p_query_user_matching_mode {
5388        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
5389    }
5390    if let Some(ref user_agent) = configuration.user_agent {
5391        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5392    }
5393    if let Some(ref token) = configuration.bearer_access_token {
5394        req_builder = req_builder.bearer_auth(token.to_owned());
5395    };
5396
5397    let req = req_builder.build()?;
5398    let resp = configuration.client.execute(req).await?;
5399
5400    let status = resp.status();
5401    let content_type = resp
5402        .headers()
5403        .get("content-type")
5404        .and_then(|v| v.to_str().ok())
5405        .unwrap_or("application/octet-stream");
5406    let content_type = super::ContentType::from(content_type);
5407
5408    if !status.is_client_error() && !status.is_server_error() {
5409        let content = resp.text().await?;
5410        match content_type {
5411            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5412            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOAuthSourceList`"))),
5413            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedOAuthSourceList`")))),
5414        }
5415    } else {
5416        let content = resp.text().await?;
5417        let entity: Option<SourcesOauthListError> = serde_json::from_str(&content).ok();
5418        Err(Error::ResponseError(ResponseContent {
5419            status,
5420            content,
5421            entity,
5422        }))
5423    }
5424}
5425
5426/// Source Viewset
5427pub async fn sources_oauth_partial_update(
5428    configuration: &configuration::Configuration,
5429    slug: &str,
5430    patched_o_auth_source_request: Option<models::PatchedOAuthSourceRequest>,
5431) -> Result<models::OAuthSource, Error<SourcesOauthPartialUpdateError>> {
5432    // add a prefix to parameters to efficiently prevent name collisions
5433    let p_path_slug = slug;
5434    let p_body_patched_o_auth_source_request = patched_o_auth_source_request;
5435
5436    let uri_str = format!(
5437        "{}/sources/oauth/{slug}/",
5438        configuration.base_path,
5439        slug = crate::apis::urlencode(p_path_slug)
5440    );
5441    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5442
5443    if let Some(ref user_agent) = configuration.user_agent {
5444        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5445    }
5446    if let Some(ref token) = configuration.bearer_access_token {
5447        req_builder = req_builder.bearer_auth(token.to_owned());
5448    };
5449    req_builder = req_builder.json(&p_body_patched_o_auth_source_request);
5450
5451    let req = req_builder.build()?;
5452    let resp = configuration.client.execute(req).await?;
5453
5454    let status = resp.status();
5455    let content_type = resp
5456        .headers()
5457        .get("content-type")
5458        .and_then(|v| v.to_str().ok())
5459        .unwrap_or("application/octet-stream");
5460    let content_type = super::ContentType::from(content_type);
5461
5462    if !status.is_client_error() && !status.is_server_error() {
5463        let content = resp.text().await?;
5464        match content_type {
5465            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5466            ContentType::Text => {
5467                return Err(Error::from(serde_json::Error::custom(
5468                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5469                )))
5470            }
5471            ContentType::Unsupported(unknown_type) => {
5472                return Err(Error::from(serde_json::Error::custom(format!(
5473                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5474                ))))
5475            }
5476        }
5477    } else {
5478        let content = resp.text().await?;
5479        let entity: Option<SourcesOauthPartialUpdateError> = serde_json::from_str(&content).ok();
5480        Err(Error::ResponseError(ResponseContent {
5481            status,
5482            content,
5483            entity,
5484        }))
5485    }
5486}
5487
5488/// Source Viewset
5489pub async fn sources_oauth_retrieve(
5490    configuration: &configuration::Configuration,
5491    slug: &str,
5492) -> Result<models::OAuthSource, Error<SourcesOauthRetrieveError>> {
5493    // add a prefix to parameters to efficiently prevent name collisions
5494    let p_path_slug = slug;
5495
5496    let uri_str = format!(
5497        "{}/sources/oauth/{slug}/",
5498        configuration.base_path,
5499        slug = crate::apis::urlencode(p_path_slug)
5500    );
5501    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5502
5503    if let Some(ref user_agent) = configuration.user_agent {
5504        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5505    }
5506    if let Some(ref token) = configuration.bearer_access_token {
5507        req_builder = req_builder.bearer_auth(token.to_owned());
5508    };
5509
5510    let req = req_builder.build()?;
5511    let resp = configuration.client.execute(req).await?;
5512
5513    let status = resp.status();
5514    let content_type = resp
5515        .headers()
5516        .get("content-type")
5517        .and_then(|v| v.to_str().ok())
5518        .unwrap_or("application/octet-stream");
5519    let content_type = super::ContentType::from(content_type);
5520
5521    if !status.is_client_error() && !status.is_server_error() {
5522        let content = resp.text().await?;
5523        match content_type {
5524            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5525            ContentType::Text => {
5526                return Err(Error::from(serde_json::Error::custom(
5527                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5528                )))
5529            }
5530            ContentType::Unsupported(unknown_type) => {
5531                return Err(Error::from(serde_json::Error::custom(format!(
5532                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5533                ))))
5534            }
5535        }
5536    } else {
5537        let content = resp.text().await?;
5538        let entity: Option<SourcesOauthRetrieveError> = serde_json::from_str(&content).ok();
5539        Err(Error::ResponseError(ResponseContent {
5540            status,
5541            content,
5542            entity,
5543        }))
5544    }
5545}
5546
5547/// Get all creatable source types. If ?name is set, only returns the type for <name>. If <name> isn't found, returns the default type.
5548pub async fn sources_oauth_source_types_list(
5549    configuration: &configuration::Configuration,
5550    name: Option<&str>,
5551) -> Result<Vec<models::SourceType>, Error<SourcesOauthSourceTypesListError>> {
5552    // add a prefix to parameters to efficiently prevent name collisions
5553    let p_query_name = name;
5554
5555    let uri_str = format!("{}/sources/oauth/source_types/", configuration.base_path);
5556    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5557
5558    if let Some(ref param_value) = p_query_name {
5559        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5560    }
5561    if let Some(ref user_agent) = configuration.user_agent {
5562        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5563    }
5564    if let Some(ref token) = configuration.bearer_access_token {
5565        req_builder = req_builder.bearer_auth(token.to_owned());
5566    };
5567
5568    let req = req_builder.build()?;
5569    let resp = configuration.client.execute(req).await?;
5570
5571    let status = resp.status();
5572    let content_type = resp
5573        .headers()
5574        .get("content-type")
5575        .and_then(|v| v.to_str().ok())
5576        .unwrap_or("application/octet-stream");
5577    let content_type = super::ContentType::from(content_type);
5578
5579    if !status.is_client_error() && !status.is_server_error() {
5580        let content = resp.text().await?;
5581        match content_type {
5582            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5583            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::SourceType&gt;`"))),
5584            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::SourceType&gt;`")))),
5585        }
5586    } else {
5587        let content = resp.text().await?;
5588        let entity: Option<SourcesOauthSourceTypesListError> = serde_json::from_str(&content).ok();
5589        Err(Error::ResponseError(ResponseContent {
5590            status,
5591            content,
5592            entity,
5593        }))
5594    }
5595}
5596
5597/// Source Viewset
5598pub async fn sources_oauth_update(
5599    configuration: &configuration::Configuration,
5600    slug: &str,
5601    o_auth_source_request: models::OAuthSourceRequest,
5602) -> Result<models::OAuthSource, Error<SourcesOauthUpdateError>> {
5603    // add a prefix to parameters to efficiently prevent name collisions
5604    let p_path_slug = slug;
5605    let p_body_o_auth_source_request = o_auth_source_request;
5606
5607    let uri_str = format!(
5608        "{}/sources/oauth/{slug}/",
5609        configuration.base_path,
5610        slug = crate::apis::urlencode(p_path_slug)
5611    );
5612    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5613
5614    if let Some(ref user_agent) = configuration.user_agent {
5615        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5616    }
5617    if let Some(ref token) = configuration.bearer_access_token {
5618        req_builder = req_builder.bearer_auth(token.to_owned());
5619    };
5620    req_builder = req_builder.json(&p_body_o_auth_source_request);
5621
5622    let req = req_builder.build()?;
5623    let resp = configuration.client.execute(req).await?;
5624
5625    let status = resp.status();
5626    let content_type = resp
5627        .headers()
5628        .get("content-type")
5629        .and_then(|v| v.to_str().ok())
5630        .unwrap_or("application/octet-stream");
5631    let content_type = super::ContentType::from(content_type);
5632
5633    if !status.is_client_error() && !status.is_server_error() {
5634        let content = resp.text().await?;
5635        match content_type {
5636            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5637            ContentType::Text => {
5638                return Err(Error::from(serde_json::Error::custom(
5639                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5640                )))
5641            }
5642            ContentType::Unsupported(unknown_type) => {
5643                return Err(Error::from(serde_json::Error::custom(format!(
5644                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5645                ))))
5646            }
5647        }
5648    } else {
5649        let content = resp.text().await?;
5650        let entity: Option<SourcesOauthUpdateError> = serde_json::from_str(&content).ok();
5651        Err(Error::ResponseError(ResponseContent {
5652            status,
5653            content,
5654            entity,
5655        }))
5656    }
5657}
5658
5659/// Get a list of all objects that use this object
5660pub async fn sources_oauth_used_by_list(
5661    configuration: &configuration::Configuration,
5662    slug: &str,
5663) -> Result<Vec<models::UsedBy>, Error<SourcesOauthUsedByListError>> {
5664    // add a prefix to parameters to efficiently prevent name collisions
5665    let p_path_slug = slug;
5666
5667    let uri_str = format!(
5668        "{}/sources/oauth/{slug}/used_by/",
5669        configuration.base_path,
5670        slug = crate::apis::urlencode(p_path_slug)
5671    );
5672    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5673
5674    if let Some(ref user_agent) = configuration.user_agent {
5675        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5676    }
5677    if let Some(ref token) = configuration.bearer_access_token {
5678        req_builder = req_builder.bearer_auth(token.to_owned());
5679    };
5680
5681    let req = req_builder.build()?;
5682    let resp = configuration.client.execute(req).await?;
5683
5684    let status = resp.status();
5685    let content_type = resp
5686        .headers()
5687        .get("content-type")
5688        .and_then(|v| v.to_str().ok())
5689        .unwrap_or("application/octet-stream");
5690    let content_type = super::ContentType::from(content_type);
5691
5692    if !status.is_client_error() && !status.is_server_error() {
5693        let content = resp.text().await?;
5694        match content_type {
5695            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5696            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;`"))),
5697            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;`")))),
5698        }
5699    } else {
5700        let content = resp.text().await?;
5701        let entity: Option<SourcesOauthUsedByListError> = serde_json::from_str(&content).ok();
5702        Err(Error::ResponseError(ResponseContent {
5703            status,
5704            content,
5705            entity,
5706        }))
5707    }
5708}
5709
5710/// Plex source Viewset
5711pub async fn sources_plex_create(
5712    configuration: &configuration::Configuration,
5713    plex_source_request: models::PlexSourceRequest,
5714) -> Result<models::PlexSource, Error<SourcesPlexCreateError>> {
5715    // add a prefix to parameters to efficiently prevent name collisions
5716    let p_body_plex_source_request = plex_source_request;
5717
5718    let uri_str = format!("{}/sources/plex/", configuration.base_path);
5719    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5720
5721    if let Some(ref user_agent) = configuration.user_agent {
5722        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5723    }
5724    if let Some(ref token) = configuration.bearer_access_token {
5725        req_builder = req_builder.bearer_auth(token.to_owned());
5726    };
5727    req_builder = req_builder.json(&p_body_plex_source_request);
5728
5729    let req = req_builder.build()?;
5730    let resp = configuration.client.execute(req).await?;
5731
5732    let status = resp.status();
5733    let content_type = resp
5734        .headers()
5735        .get("content-type")
5736        .and_then(|v| v.to_str().ok())
5737        .unwrap_or("application/octet-stream");
5738    let content_type = super::ContentType::from(content_type);
5739
5740    if !status.is_client_error() && !status.is_server_error() {
5741        let content = resp.text().await?;
5742        match content_type {
5743            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5744            ContentType::Text => {
5745                return Err(Error::from(serde_json::Error::custom(
5746                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
5747                )))
5748            }
5749            ContentType::Unsupported(unknown_type) => {
5750                return Err(Error::from(serde_json::Error::custom(format!(
5751                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
5752                ))))
5753            }
5754        }
5755    } else {
5756        let content = resp.text().await?;
5757        let entity: Option<SourcesPlexCreateError> = serde_json::from_str(&content).ok();
5758        Err(Error::ResponseError(ResponseContent {
5759            status,
5760            content,
5761            entity,
5762        }))
5763    }
5764}
5765
5766/// Plex source Viewset
5767pub async fn sources_plex_destroy(
5768    configuration: &configuration::Configuration,
5769    slug: &str,
5770) -> Result<(), Error<SourcesPlexDestroyError>> {
5771    // add a prefix to parameters to efficiently prevent name collisions
5772    let p_path_slug = slug;
5773
5774    let uri_str = format!(
5775        "{}/sources/plex/{slug}/",
5776        configuration.base_path,
5777        slug = crate::apis::urlencode(p_path_slug)
5778    );
5779    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5780
5781    if let Some(ref user_agent) = configuration.user_agent {
5782        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5783    }
5784    if let Some(ref token) = configuration.bearer_access_token {
5785        req_builder = req_builder.bearer_auth(token.to_owned());
5786    };
5787
5788    let req = req_builder.build()?;
5789    let resp = configuration.client.execute(req).await?;
5790
5791    let status = resp.status();
5792
5793    if !status.is_client_error() && !status.is_server_error() {
5794        Ok(())
5795    } else {
5796        let content = resp.text().await?;
5797        let entity: Option<SourcesPlexDestroyError> = serde_json::from_str(&content).ok();
5798        Err(Error::ResponseError(ResponseContent {
5799            status,
5800            content,
5801            entity,
5802        }))
5803    }
5804}
5805
5806/// Plex source Viewset
5807pub async fn sources_plex_list(
5808    configuration: &configuration::Configuration,
5809    allow_friends: Option<bool>,
5810    authentication_flow: Option<&str>,
5811    client_id: Option<&str>,
5812    enabled: Option<bool>,
5813    enrollment_flow: Option<&str>,
5814    group_matching_mode: Option<&str>,
5815    name: Option<&str>,
5816    ordering: Option<&str>,
5817    page: Option<i32>,
5818    page_size: Option<i32>,
5819    pbm_uuid: Option<&str>,
5820    policy_engine_mode: Option<&str>,
5821    search: Option<&str>,
5822    slug: Option<&str>,
5823    user_matching_mode: Option<&str>,
5824) -> Result<models::PaginatedPlexSourceList, Error<SourcesPlexListError>> {
5825    // add a prefix to parameters to efficiently prevent name collisions
5826    let p_query_allow_friends = allow_friends;
5827    let p_query_authentication_flow = authentication_flow;
5828    let p_query_client_id = client_id;
5829    let p_query_enabled = enabled;
5830    let p_query_enrollment_flow = enrollment_flow;
5831    let p_query_group_matching_mode = group_matching_mode;
5832    let p_query_name = name;
5833    let p_query_ordering = ordering;
5834    let p_query_page = page;
5835    let p_query_page_size = page_size;
5836    let p_query_pbm_uuid = pbm_uuid;
5837    let p_query_policy_engine_mode = policy_engine_mode;
5838    let p_query_search = search;
5839    let p_query_slug = slug;
5840    let p_query_user_matching_mode = user_matching_mode;
5841
5842    let uri_str = format!("{}/sources/plex/", configuration.base_path);
5843    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5844
5845    if let Some(ref param_value) = p_query_allow_friends {
5846        req_builder = req_builder.query(&[("allow_friends", &param_value.to_string())]);
5847    }
5848    if let Some(ref param_value) = p_query_authentication_flow {
5849        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
5850    }
5851    if let Some(ref param_value) = p_query_client_id {
5852        req_builder = req_builder.query(&[("client_id", &param_value.to_string())]);
5853    }
5854    if let Some(ref param_value) = p_query_enabled {
5855        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
5856    }
5857    if let Some(ref param_value) = p_query_enrollment_flow {
5858        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
5859    }
5860    if let Some(ref param_value) = p_query_group_matching_mode {
5861        req_builder = req_builder.query(&[("group_matching_mode", &param_value.to_string())]);
5862    }
5863    if let Some(ref param_value) = p_query_name {
5864        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5865    }
5866    if let Some(ref param_value) = p_query_ordering {
5867        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5868    }
5869    if let Some(ref param_value) = p_query_page {
5870        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5871    }
5872    if let Some(ref param_value) = p_query_page_size {
5873        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5874    }
5875    if let Some(ref param_value) = p_query_pbm_uuid {
5876        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
5877    }
5878    if let Some(ref param_value) = p_query_policy_engine_mode {
5879        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
5880    }
5881    if let Some(ref param_value) = p_query_search {
5882        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5883    }
5884    if let Some(ref param_value) = p_query_slug {
5885        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
5886    }
5887    if let Some(ref param_value) = p_query_user_matching_mode {
5888        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
5889    }
5890    if let Some(ref user_agent) = configuration.user_agent {
5891        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5892    }
5893    if let Some(ref token) = configuration.bearer_access_token {
5894        req_builder = req_builder.bearer_auth(token.to_owned());
5895    };
5896
5897    let req = req_builder.build()?;
5898    let resp = configuration.client.execute(req).await?;
5899
5900    let status = resp.status();
5901    let content_type = resp
5902        .headers()
5903        .get("content-type")
5904        .and_then(|v| v.to_str().ok())
5905        .unwrap_or("application/octet-stream");
5906    let content_type = super::ContentType::from(content_type);
5907
5908    if !status.is_client_error() && !status.is_server_error() {
5909        let content = resp.text().await?;
5910        match content_type {
5911            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5912            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPlexSourceList`"))),
5913            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPlexSourceList`")))),
5914        }
5915    } else {
5916        let content = resp.text().await?;
5917        let entity: Option<SourcesPlexListError> = serde_json::from_str(&content).ok();
5918        Err(Error::ResponseError(ResponseContent {
5919            status,
5920            content,
5921            entity,
5922        }))
5923    }
5924}
5925
5926/// Plex source Viewset
5927pub async fn sources_plex_partial_update(
5928    configuration: &configuration::Configuration,
5929    slug: &str,
5930    patched_plex_source_request: Option<models::PatchedPlexSourceRequest>,
5931) -> Result<models::PlexSource, Error<SourcesPlexPartialUpdateError>> {
5932    // add a prefix to parameters to efficiently prevent name collisions
5933    let p_path_slug = slug;
5934    let p_body_patched_plex_source_request = patched_plex_source_request;
5935
5936    let uri_str = format!(
5937        "{}/sources/plex/{slug}/",
5938        configuration.base_path,
5939        slug = crate::apis::urlencode(p_path_slug)
5940    );
5941    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5942
5943    if let Some(ref user_agent) = configuration.user_agent {
5944        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5945    }
5946    if let Some(ref token) = configuration.bearer_access_token {
5947        req_builder = req_builder.bearer_auth(token.to_owned());
5948    };
5949    req_builder = req_builder.json(&p_body_patched_plex_source_request);
5950
5951    let req = req_builder.build()?;
5952    let resp = configuration.client.execute(req).await?;
5953
5954    let status = resp.status();
5955    let content_type = resp
5956        .headers()
5957        .get("content-type")
5958        .and_then(|v| v.to_str().ok())
5959        .unwrap_or("application/octet-stream");
5960    let content_type = super::ContentType::from(content_type);
5961
5962    if !status.is_client_error() && !status.is_server_error() {
5963        let content = resp.text().await?;
5964        match content_type {
5965            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5966            ContentType::Text => {
5967                return Err(Error::from(serde_json::Error::custom(
5968                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
5969                )))
5970            }
5971            ContentType::Unsupported(unknown_type) => {
5972                return Err(Error::from(serde_json::Error::custom(format!(
5973                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
5974                ))))
5975            }
5976        }
5977    } else {
5978        let content = resp.text().await?;
5979        let entity: Option<SourcesPlexPartialUpdateError> = serde_json::from_str(&content).ok();
5980        Err(Error::ResponseError(ResponseContent {
5981            status,
5982            content,
5983            entity,
5984        }))
5985    }
5986}
5987
5988/// Redeem a plex token for an authenticated user, creating a connection
5989pub async fn sources_plex_redeem_token_authenticated_create(
5990    configuration: &configuration::Configuration,
5991    plex_token_redeem_request: models::PlexTokenRedeemRequest,
5992    slug: Option<&str>,
5993) -> Result<(), Error<SourcesPlexRedeemTokenAuthenticatedCreateError>> {
5994    // add a prefix to parameters to efficiently prevent name collisions
5995    let p_body_plex_token_redeem_request = plex_token_redeem_request;
5996    let p_query_slug = slug;
5997
5998    let uri_str = format!("{}/sources/plex/redeem_token_authenticated/", configuration.base_path);
5999    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6000
6001    if let Some(ref param_value) = p_query_slug {
6002        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
6003    }
6004    if let Some(ref user_agent) = configuration.user_agent {
6005        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6006    }
6007    if let Some(ref token) = configuration.bearer_access_token {
6008        req_builder = req_builder.bearer_auth(token.to_owned());
6009    };
6010    req_builder = req_builder.json(&p_body_plex_token_redeem_request);
6011
6012    let req = req_builder.build()?;
6013    let resp = configuration.client.execute(req).await?;
6014
6015    let status = resp.status();
6016
6017    if !status.is_client_error() && !status.is_server_error() {
6018        Ok(())
6019    } else {
6020        let content = resp.text().await?;
6021        let entity: Option<SourcesPlexRedeemTokenAuthenticatedCreateError> = serde_json::from_str(&content).ok();
6022        Err(Error::ResponseError(ResponseContent {
6023            status,
6024            content,
6025            entity,
6026        }))
6027    }
6028}
6029
6030/// Redeem a plex token, check it's access to resources against what's allowed for the source, and redirect to an authentication/enrollment flow.
6031pub async fn sources_plex_redeem_token_create(
6032    configuration: &configuration::Configuration,
6033    plex_token_redeem_request: models::PlexTokenRedeemRequest,
6034    slug: Option<&str>,
6035) -> Result<models::RedirectChallenge, Error<SourcesPlexRedeemTokenCreateError>> {
6036    // add a prefix to parameters to efficiently prevent name collisions
6037    let p_body_plex_token_redeem_request = plex_token_redeem_request;
6038    let p_query_slug = slug;
6039
6040    let uri_str = format!("{}/sources/plex/redeem_token/", configuration.base_path);
6041    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6042
6043    if let Some(ref param_value) = p_query_slug {
6044        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
6045    }
6046    if let Some(ref user_agent) = configuration.user_agent {
6047        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6048    }
6049    if let Some(ref token) = configuration.bearer_access_token {
6050        req_builder = req_builder.bearer_auth(token.to_owned());
6051    };
6052    req_builder = req_builder.json(&p_body_plex_token_redeem_request);
6053
6054    let req = req_builder.build()?;
6055    let resp = configuration.client.execute(req).await?;
6056
6057    let status = resp.status();
6058    let content_type = resp
6059        .headers()
6060        .get("content-type")
6061        .and_then(|v| v.to_str().ok())
6062        .unwrap_or("application/octet-stream");
6063    let content_type = super::ContentType::from(content_type);
6064
6065    if !status.is_client_error() && !status.is_server_error() {
6066        let content = resp.text().await?;
6067        match content_type {
6068            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6069            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RedirectChallenge`"))),
6070            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RedirectChallenge`")))),
6071        }
6072    } else {
6073        let content = resp.text().await?;
6074        let entity: Option<SourcesPlexRedeemTokenCreateError> = serde_json::from_str(&content).ok();
6075        Err(Error::ResponseError(ResponseContent {
6076            status,
6077            content,
6078            entity,
6079        }))
6080    }
6081}
6082
6083/// Plex source Viewset
6084pub async fn sources_plex_retrieve(
6085    configuration: &configuration::Configuration,
6086    slug: &str,
6087) -> Result<models::PlexSource, Error<SourcesPlexRetrieveError>> {
6088    // add a prefix to parameters to efficiently prevent name collisions
6089    let p_path_slug = slug;
6090
6091    let uri_str = format!(
6092        "{}/sources/plex/{slug}/",
6093        configuration.base_path,
6094        slug = crate::apis::urlencode(p_path_slug)
6095    );
6096    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6097
6098    if let Some(ref user_agent) = configuration.user_agent {
6099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6100    }
6101    if let Some(ref token) = configuration.bearer_access_token {
6102        req_builder = req_builder.bearer_auth(token.to_owned());
6103    };
6104
6105    let req = req_builder.build()?;
6106    let resp = configuration.client.execute(req).await?;
6107
6108    let status = resp.status();
6109    let content_type = resp
6110        .headers()
6111        .get("content-type")
6112        .and_then(|v| v.to_str().ok())
6113        .unwrap_or("application/octet-stream");
6114    let content_type = super::ContentType::from(content_type);
6115
6116    if !status.is_client_error() && !status.is_server_error() {
6117        let content = resp.text().await?;
6118        match content_type {
6119            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6120            ContentType::Text => {
6121                return Err(Error::from(serde_json::Error::custom(
6122                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6123                )))
6124            }
6125            ContentType::Unsupported(unknown_type) => {
6126                return Err(Error::from(serde_json::Error::custom(format!(
6127                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6128                ))))
6129            }
6130        }
6131    } else {
6132        let content = resp.text().await?;
6133        let entity: Option<SourcesPlexRetrieveError> = serde_json::from_str(&content).ok();
6134        Err(Error::ResponseError(ResponseContent {
6135            status,
6136            content,
6137            entity,
6138        }))
6139    }
6140}
6141
6142/// Plex source Viewset
6143pub async fn sources_plex_update(
6144    configuration: &configuration::Configuration,
6145    slug: &str,
6146    plex_source_request: models::PlexSourceRequest,
6147) -> Result<models::PlexSource, Error<SourcesPlexUpdateError>> {
6148    // add a prefix to parameters to efficiently prevent name collisions
6149    let p_path_slug = slug;
6150    let p_body_plex_source_request = plex_source_request;
6151
6152    let uri_str = format!(
6153        "{}/sources/plex/{slug}/",
6154        configuration.base_path,
6155        slug = crate::apis::urlencode(p_path_slug)
6156    );
6157    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6158
6159    if let Some(ref user_agent) = configuration.user_agent {
6160        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6161    }
6162    if let Some(ref token) = configuration.bearer_access_token {
6163        req_builder = req_builder.bearer_auth(token.to_owned());
6164    };
6165    req_builder = req_builder.json(&p_body_plex_source_request);
6166
6167    let req = req_builder.build()?;
6168    let resp = configuration.client.execute(req).await?;
6169
6170    let status = resp.status();
6171    let content_type = resp
6172        .headers()
6173        .get("content-type")
6174        .and_then(|v| v.to_str().ok())
6175        .unwrap_or("application/octet-stream");
6176    let content_type = super::ContentType::from(content_type);
6177
6178    if !status.is_client_error() && !status.is_server_error() {
6179        let content = resp.text().await?;
6180        match content_type {
6181            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6182            ContentType::Text => {
6183                return Err(Error::from(serde_json::Error::custom(
6184                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6185                )))
6186            }
6187            ContentType::Unsupported(unknown_type) => {
6188                return Err(Error::from(serde_json::Error::custom(format!(
6189                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6190                ))))
6191            }
6192        }
6193    } else {
6194        let content = resp.text().await?;
6195        let entity: Option<SourcesPlexUpdateError> = serde_json::from_str(&content).ok();
6196        Err(Error::ResponseError(ResponseContent {
6197            status,
6198            content,
6199            entity,
6200        }))
6201    }
6202}
6203
6204/// Get a list of all objects that use this object
6205pub async fn sources_plex_used_by_list(
6206    configuration: &configuration::Configuration,
6207    slug: &str,
6208) -> Result<Vec<models::UsedBy>, Error<SourcesPlexUsedByListError>> {
6209    // add a prefix to parameters to efficiently prevent name collisions
6210    let p_path_slug = slug;
6211
6212    let uri_str = format!(
6213        "{}/sources/plex/{slug}/used_by/",
6214        configuration.base_path,
6215        slug = crate::apis::urlencode(p_path_slug)
6216    );
6217    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6218
6219    if let Some(ref user_agent) = configuration.user_agent {
6220        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6221    }
6222    if let Some(ref token) = configuration.bearer_access_token {
6223        req_builder = req_builder.bearer_auth(token.to_owned());
6224    };
6225
6226    let req = req_builder.build()?;
6227    let resp = configuration.client.execute(req).await?;
6228
6229    let status = resp.status();
6230    let content_type = resp
6231        .headers()
6232        .get("content-type")
6233        .and_then(|v| v.to_str().ok())
6234        .unwrap_or("application/octet-stream");
6235    let content_type = super::ContentType::from(content_type);
6236
6237    if !status.is_client_error() && !status.is_server_error() {
6238        let content = resp.text().await?;
6239        match content_type {
6240            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6241            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;`"))),
6242            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;`")))),
6243        }
6244    } else {
6245        let content = resp.text().await?;
6246        let entity: Option<SourcesPlexUsedByListError> = serde_json::from_str(&content).ok();
6247        Err(Error::ResponseError(ResponseContent {
6248            status,
6249            content,
6250            entity,
6251        }))
6252    }
6253}
6254
6255/// SAMLSource Viewset
6256pub async fn sources_saml_create(
6257    configuration: &configuration::Configuration,
6258    saml_source_request: models::SamlSourceRequest,
6259) -> Result<models::SamlSource, Error<SourcesSamlCreateError>> {
6260    // add a prefix to parameters to efficiently prevent name collisions
6261    let p_body_saml_source_request = saml_source_request;
6262
6263    let uri_str = format!("{}/sources/saml/", configuration.base_path);
6264    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6265
6266    if let Some(ref user_agent) = configuration.user_agent {
6267        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6268    }
6269    if let Some(ref token) = configuration.bearer_access_token {
6270        req_builder = req_builder.bearer_auth(token.to_owned());
6271    };
6272    req_builder = req_builder.json(&p_body_saml_source_request);
6273
6274    let req = req_builder.build()?;
6275    let resp = configuration.client.execute(req).await?;
6276
6277    let status = resp.status();
6278    let content_type = resp
6279        .headers()
6280        .get("content-type")
6281        .and_then(|v| v.to_str().ok())
6282        .unwrap_or("application/octet-stream");
6283    let content_type = super::ContentType::from(content_type);
6284
6285    if !status.is_client_error() && !status.is_server_error() {
6286        let content = resp.text().await?;
6287        match content_type {
6288            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6289            ContentType::Text => {
6290                return Err(Error::from(serde_json::Error::custom(
6291                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
6292                )))
6293            }
6294            ContentType::Unsupported(unknown_type) => {
6295                return Err(Error::from(serde_json::Error::custom(format!(
6296                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
6297                ))))
6298            }
6299        }
6300    } else {
6301        let content = resp.text().await?;
6302        let entity: Option<SourcesSamlCreateError> = serde_json::from_str(&content).ok();
6303        Err(Error::ResponseError(ResponseContent {
6304            status,
6305            content,
6306            entity,
6307        }))
6308    }
6309}
6310
6311/// SAMLSource Viewset
6312pub async fn sources_saml_destroy(
6313    configuration: &configuration::Configuration,
6314    slug: &str,
6315) -> Result<(), Error<SourcesSamlDestroyError>> {
6316    // add a prefix to parameters to efficiently prevent name collisions
6317    let p_path_slug = slug;
6318
6319    let uri_str = format!(
6320        "{}/sources/saml/{slug}/",
6321        configuration.base_path,
6322        slug = crate::apis::urlencode(p_path_slug)
6323    );
6324    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6325
6326    if let Some(ref user_agent) = configuration.user_agent {
6327        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6328    }
6329    if let Some(ref token) = configuration.bearer_access_token {
6330        req_builder = req_builder.bearer_auth(token.to_owned());
6331    };
6332
6333    let req = req_builder.build()?;
6334    let resp = configuration.client.execute(req).await?;
6335
6336    let status = resp.status();
6337
6338    if !status.is_client_error() && !status.is_server_error() {
6339        Ok(())
6340    } else {
6341        let content = resp.text().await?;
6342        let entity: Option<SourcesSamlDestroyError> = serde_json::from_str(&content).ok();
6343        Err(Error::ResponseError(ResponseContent {
6344            status,
6345            content,
6346            entity,
6347        }))
6348    }
6349}
6350
6351/// SAMLSource Viewset
6352pub async fn sources_saml_list(
6353    configuration: &configuration::Configuration,
6354    allow_idp_initiated: Option<bool>,
6355    authentication_flow: Option<&str>,
6356    binding_type: Option<&str>,
6357    digest_algorithm: Option<&str>,
6358    enabled: Option<bool>,
6359    enrollment_flow: Option<&str>,
6360    issuer: Option<&str>,
6361    managed: Option<&str>,
6362    name: Option<&str>,
6363    name_id_policy: Option<&str>,
6364    ordering: Option<&str>,
6365    page: Option<i32>,
6366    page_size: Option<i32>,
6367    pbm_uuid: Option<&str>,
6368    policy_engine_mode: Option<&str>,
6369    pre_authentication_flow: Option<&str>,
6370    search: Option<&str>,
6371    signature_algorithm: Option<&str>,
6372    signing_kp: Option<&str>,
6373    slo_url: Option<&str>,
6374    slug: Option<&str>,
6375    sso_url: Option<&str>,
6376    temporary_user_delete_after: Option<&str>,
6377    user_matching_mode: Option<&str>,
6378    verification_kp: Option<&str>,
6379) -> Result<models::PaginatedSamlSourceList, Error<SourcesSamlListError>> {
6380    // add a prefix to parameters to efficiently prevent name collisions
6381    let p_query_allow_idp_initiated = allow_idp_initiated;
6382    let p_query_authentication_flow = authentication_flow;
6383    let p_query_binding_type = binding_type;
6384    let p_query_digest_algorithm = digest_algorithm;
6385    let p_query_enabled = enabled;
6386    let p_query_enrollment_flow = enrollment_flow;
6387    let p_query_issuer = issuer;
6388    let p_query_managed = managed;
6389    let p_query_name = name;
6390    let p_query_name_id_policy = name_id_policy;
6391    let p_query_ordering = ordering;
6392    let p_query_page = page;
6393    let p_query_page_size = page_size;
6394    let p_query_pbm_uuid = pbm_uuid;
6395    let p_query_policy_engine_mode = policy_engine_mode;
6396    let p_query_pre_authentication_flow = pre_authentication_flow;
6397    let p_query_search = search;
6398    let p_query_signature_algorithm = signature_algorithm;
6399    let p_query_signing_kp = signing_kp;
6400    let p_query_slo_url = slo_url;
6401    let p_query_slug = slug;
6402    let p_query_sso_url = sso_url;
6403    let p_query_temporary_user_delete_after = temporary_user_delete_after;
6404    let p_query_user_matching_mode = user_matching_mode;
6405    let p_query_verification_kp = verification_kp;
6406
6407    let uri_str = format!("{}/sources/saml/", configuration.base_path);
6408    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6409
6410    if let Some(ref param_value) = p_query_allow_idp_initiated {
6411        req_builder = req_builder.query(&[("allow_idp_initiated", &param_value.to_string())]);
6412    }
6413    if let Some(ref param_value) = p_query_authentication_flow {
6414        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
6415    }
6416    if let Some(ref param_value) = p_query_binding_type {
6417        req_builder = req_builder.query(&[("binding_type", &param_value.to_string())]);
6418    }
6419    if let Some(ref param_value) = p_query_digest_algorithm {
6420        req_builder = req_builder.query(&[("digest_algorithm", &param_value.to_string())]);
6421    }
6422    if let Some(ref param_value) = p_query_enabled {
6423        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
6424    }
6425    if let Some(ref param_value) = p_query_enrollment_flow {
6426        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
6427    }
6428    if let Some(ref param_value) = p_query_issuer {
6429        req_builder = req_builder.query(&[("issuer", &param_value.to_string())]);
6430    }
6431    if let Some(ref param_value) = p_query_managed {
6432        req_builder = req_builder.query(&[("managed", &param_value.to_string())]);
6433    }
6434    if let Some(ref param_value) = p_query_name {
6435        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
6436    }
6437    if let Some(ref param_value) = p_query_name_id_policy {
6438        req_builder = req_builder.query(&[("name_id_policy", &param_value.to_string())]);
6439    }
6440    if let Some(ref param_value) = p_query_ordering {
6441        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
6442    }
6443    if let Some(ref param_value) = p_query_page {
6444        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
6445    }
6446    if let Some(ref param_value) = p_query_page_size {
6447        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
6448    }
6449    if let Some(ref param_value) = p_query_pbm_uuid {
6450        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
6451    }
6452    if let Some(ref param_value) = p_query_policy_engine_mode {
6453        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
6454    }
6455    if let Some(ref param_value) = p_query_pre_authentication_flow {
6456        req_builder = req_builder.query(&[("pre_authentication_flow", &param_value.to_string())]);
6457    }
6458    if let Some(ref param_value) = p_query_search {
6459        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
6460    }
6461    if let Some(ref param_value) = p_query_signature_algorithm {
6462        req_builder = req_builder.query(&[("signature_algorithm", &param_value.to_string())]);
6463    }
6464    if let Some(ref param_value) = p_query_signing_kp {
6465        req_builder = req_builder.query(&[("signing_kp", &param_value.to_string())]);
6466    }
6467    if let Some(ref param_value) = p_query_slo_url {
6468        req_builder = req_builder.query(&[("slo_url", &param_value.to_string())]);
6469    }
6470    if let Some(ref param_value) = p_query_slug {
6471        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
6472    }
6473    if let Some(ref param_value) = p_query_sso_url {
6474        req_builder = req_builder.query(&[("sso_url", &param_value.to_string())]);
6475    }
6476    if let Some(ref param_value) = p_query_temporary_user_delete_after {
6477        req_builder = req_builder.query(&[("temporary_user_delete_after", &param_value.to_string())]);
6478    }
6479    if let Some(ref param_value) = p_query_user_matching_mode {
6480        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
6481    }
6482    if let Some(ref param_value) = p_query_verification_kp {
6483        req_builder = req_builder.query(&[("verification_kp", &param_value.to_string())]);
6484    }
6485    if let Some(ref user_agent) = configuration.user_agent {
6486        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6487    }
6488    if let Some(ref token) = configuration.bearer_access_token {
6489        req_builder = req_builder.bearer_auth(token.to_owned());
6490    };
6491
6492    let req = req_builder.build()?;
6493    let resp = configuration.client.execute(req).await?;
6494
6495    let status = resp.status();
6496    let content_type = resp
6497        .headers()
6498        .get("content-type")
6499        .and_then(|v| v.to_str().ok())
6500        .unwrap_or("application/octet-stream");
6501    let content_type = super::ContentType::from(content_type);
6502
6503    if !status.is_client_error() && !status.is_server_error() {
6504        let content = resp.text().await?;
6505        match content_type {
6506            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6507            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlSourceList`"))),
6508            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSamlSourceList`")))),
6509        }
6510    } else {
6511        let content = resp.text().await?;
6512        let entity: Option<SourcesSamlListError> = serde_json::from_str(&content).ok();
6513        Err(Error::ResponseError(ResponseContent {
6514            status,
6515            content,
6516            entity,
6517        }))
6518    }
6519}
6520
6521/// Return metadata as XML string
6522pub async fn sources_saml_metadata_retrieve(
6523    configuration: &configuration::Configuration,
6524    slug: &str,
6525) -> Result<models::SamlMetadata, Error<SourcesSamlMetadataRetrieveError>> {
6526    // add a prefix to parameters to efficiently prevent name collisions
6527    let p_path_slug = slug;
6528
6529    let uri_str = format!(
6530        "{}/sources/saml/{slug}/metadata/",
6531        configuration.base_path,
6532        slug = crate::apis::urlencode(p_path_slug)
6533    );
6534    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6535
6536    if let Some(ref user_agent) = configuration.user_agent {
6537        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6538    }
6539    if let Some(ref token) = configuration.bearer_access_token {
6540        req_builder = req_builder.bearer_auth(token.to_owned());
6541    };
6542
6543    let req = req_builder.build()?;
6544    let resp = configuration.client.execute(req).await?;
6545
6546    let status = resp.status();
6547    let content_type = resp
6548        .headers()
6549        .get("content-type")
6550        .and_then(|v| v.to_str().ok())
6551        .unwrap_or("application/octet-stream");
6552    let content_type = super::ContentType::from(content_type);
6553
6554    if !status.is_client_error() && !status.is_server_error() {
6555        let content = resp.text().await?;
6556        match content_type {
6557            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6558            ContentType::Text => {
6559                return Err(Error::from(serde_json::Error::custom(
6560                    "Received `text/plain` content type response that cannot be converted to `models::SamlMetadata`",
6561                )))
6562            }
6563            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6564                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlMetadata`"
6565            )))),
6566        }
6567    } else {
6568        let content = resp.text().await?;
6569        let entity: Option<SourcesSamlMetadataRetrieveError> = serde_json::from_str(&content).ok();
6570        Err(Error::ResponseError(ResponseContent {
6571            status,
6572            content,
6573            entity,
6574        }))
6575    }
6576}
6577
6578/// SAMLSource Viewset
6579pub async fn sources_saml_partial_update(
6580    configuration: &configuration::Configuration,
6581    slug: &str,
6582    patched_saml_source_request: Option<models::PatchedSamlSourceRequest>,
6583) -> Result<models::SamlSource, Error<SourcesSamlPartialUpdateError>> {
6584    // add a prefix to parameters to efficiently prevent name collisions
6585    let p_path_slug = slug;
6586    let p_body_patched_saml_source_request = patched_saml_source_request;
6587
6588    let uri_str = format!(
6589        "{}/sources/saml/{slug}/",
6590        configuration.base_path,
6591        slug = crate::apis::urlencode(p_path_slug)
6592    );
6593    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6594
6595    if let Some(ref user_agent) = configuration.user_agent {
6596        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6597    }
6598    if let Some(ref token) = configuration.bearer_access_token {
6599        req_builder = req_builder.bearer_auth(token.to_owned());
6600    };
6601    req_builder = req_builder.json(&p_body_patched_saml_source_request);
6602
6603    let req = req_builder.build()?;
6604    let resp = configuration.client.execute(req).await?;
6605
6606    let status = resp.status();
6607    let content_type = resp
6608        .headers()
6609        .get("content-type")
6610        .and_then(|v| v.to_str().ok())
6611        .unwrap_or("application/octet-stream");
6612    let content_type = super::ContentType::from(content_type);
6613
6614    if !status.is_client_error() && !status.is_server_error() {
6615        let content = resp.text().await?;
6616        match content_type {
6617            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6618            ContentType::Text => {
6619                return Err(Error::from(serde_json::Error::custom(
6620                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
6621                )))
6622            }
6623            ContentType::Unsupported(unknown_type) => {
6624                return Err(Error::from(serde_json::Error::custom(format!(
6625                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
6626                ))))
6627            }
6628        }
6629    } else {
6630        let content = resp.text().await?;
6631        let entity: Option<SourcesSamlPartialUpdateError> = serde_json::from_str(&content).ok();
6632        Err(Error::ResponseError(ResponseContent {
6633            status,
6634            content,
6635            entity,
6636        }))
6637    }
6638}
6639
6640/// SAMLSource Viewset
6641pub async fn sources_saml_retrieve(
6642    configuration: &configuration::Configuration,
6643    slug: &str,
6644) -> Result<models::SamlSource, Error<SourcesSamlRetrieveError>> {
6645    // add a prefix to parameters to efficiently prevent name collisions
6646    let p_path_slug = slug;
6647
6648    let uri_str = format!(
6649        "{}/sources/saml/{slug}/",
6650        configuration.base_path,
6651        slug = crate::apis::urlencode(p_path_slug)
6652    );
6653    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6654
6655    if let Some(ref user_agent) = configuration.user_agent {
6656        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6657    }
6658    if let Some(ref token) = configuration.bearer_access_token {
6659        req_builder = req_builder.bearer_auth(token.to_owned());
6660    };
6661
6662    let req = req_builder.build()?;
6663    let resp = configuration.client.execute(req).await?;
6664
6665    let status = resp.status();
6666    let content_type = resp
6667        .headers()
6668        .get("content-type")
6669        .and_then(|v| v.to_str().ok())
6670        .unwrap_or("application/octet-stream");
6671    let content_type = super::ContentType::from(content_type);
6672
6673    if !status.is_client_error() && !status.is_server_error() {
6674        let content = resp.text().await?;
6675        match content_type {
6676            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6677            ContentType::Text => {
6678                return Err(Error::from(serde_json::Error::custom(
6679                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
6680                )))
6681            }
6682            ContentType::Unsupported(unknown_type) => {
6683                return Err(Error::from(serde_json::Error::custom(format!(
6684                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
6685                ))))
6686            }
6687        }
6688    } else {
6689        let content = resp.text().await?;
6690        let entity: Option<SourcesSamlRetrieveError> = serde_json::from_str(&content).ok();
6691        Err(Error::ResponseError(ResponseContent {
6692            status,
6693            content,
6694            entity,
6695        }))
6696    }
6697}
6698
6699/// SAMLSource Viewset
6700pub async fn sources_saml_update(
6701    configuration: &configuration::Configuration,
6702    slug: &str,
6703    saml_source_request: models::SamlSourceRequest,
6704) -> Result<models::SamlSource, Error<SourcesSamlUpdateError>> {
6705    // add a prefix to parameters to efficiently prevent name collisions
6706    let p_path_slug = slug;
6707    let p_body_saml_source_request = saml_source_request;
6708
6709    let uri_str = format!(
6710        "{}/sources/saml/{slug}/",
6711        configuration.base_path,
6712        slug = crate::apis::urlencode(p_path_slug)
6713    );
6714    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6715
6716    if let Some(ref user_agent) = configuration.user_agent {
6717        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6718    }
6719    if let Some(ref token) = configuration.bearer_access_token {
6720        req_builder = req_builder.bearer_auth(token.to_owned());
6721    };
6722    req_builder = req_builder.json(&p_body_saml_source_request);
6723
6724    let req = req_builder.build()?;
6725    let resp = configuration.client.execute(req).await?;
6726
6727    let status = resp.status();
6728    let content_type = resp
6729        .headers()
6730        .get("content-type")
6731        .and_then(|v| v.to_str().ok())
6732        .unwrap_or("application/octet-stream");
6733    let content_type = super::ContentType::from(content_type);
6734
6735    if !status.is_client_error() && !status.is_server_error() {
6736        let content = resp.text().await?;
6737        match content_type {
6738            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6739            ContentType::Text => {
6740                return Err(Error::from(serde_json::Error::custom(
6741                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
6742                )))
6743            }
6744            ContentType::Unsupported(unknown_type) => {
6745                return Err(Error::from(serde_json::Error::custom(format!(
6746                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
6747                ))))
6748            }
6749        }
6750    } else {
6751        let content = resp.text().await?;
6752        let entity: Option<SourcesSamlUpdateError> = serde_json::from_str(&content).ok();
6753        Err(Error::ResponseError(ResponseContent {
6754            status,
6755            content,
6756            entity,
6757        }))
6758    }
6759}
6760
6761/// Get a list of all objects that use this object
6762pub async fn sources_saml_used_by_list(
6763    configuration: &configuration::Configuration,
6764    slug: &str,
6765) -> Result<Vec<models::UsedBy>, Error<SourcesSamlUsedByListError>> {
6766    // add a prefix to parameters to efficiently prevent name collisions
6767    let p_path_slug = slug;
6768
6769    let uri_str = format!(
6770        "{}/sources/saml/{slug}/used_by/",
6771        configuration.base_path,
6772        slug = crate::apis::urlencode(p_path_slug)
6773    );
6774    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6775
6776    if let Some(ref user_agent) = configuration.user_agent {
6777        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6778    }
6779    if let Some(ref token) = configuration.bearer_access_token {
6780        req_builder = req_builder.bearer_auth(token.to_owned());
6781    };
6782
6783    let req = req_builder.build()?;
6784    let resp = configuration.client.execute(req).await?;
6785
6786    let status = resp.status();
6787    let content_type = resp
6788        .headers()
6789        .get("content-type")
6790        .and_then(|v| v.to_str().ok())
6791        .unwrap_or("application/octet-stream");
6792    let content_type = super::ContentType::from(content_type);
6793
6794    if !status.is_client_error() && !status.is_server_error() {
6795        let content = resp.text().await?;
6796        match content_type {
6797            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6798            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;`"))),
6799            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;`")))),
6800        }
6801    } else {
6802        let content = resp.text().await?;
6803        let entity: Option<SourcesSamlUsedByListError> = serde_json::from_str(&content).ok();
6804        Err(Error::ResponseError(ResponseContent {
6805            status,
6806            content,
6807            entity,
6808        }))
6809    }
6810}
6811
6812/// SCIMSource Viewset
6813pub async fn sources_scim_create(
6814    configuration: &configuration::Configuration,
6815    scim_source_request: models::ScimSourceRequest,
6816) -> Result<models::ScimSource, Error<SourcesScimCreateError>> {
6817    // add a prefix to parameters to efficiently prevent name collisions
6818    let p_body_scim_source_request = scim_source_request;
6819
6820    let uri_str = format!("{}/sources/scim/", configuration.base_path);
6821    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6822
6823    if let Some(ref user_agent) = configuration.user_agent {
6824        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6825    }
6826    if let Some(ref token) = configuration.bearer_access_token {
6827        req_builder = req_builder.bearer_auth(token.to_owned());
6828    };
6829    req_builder = req_builder.json(&p_body_scim_source_request);
6830
6831    let req = req_builder.build()?;
6832    let resp = configuration.client.execute(req).await?;
6833
6834    let status = resp.status();
6835    let content_type = resp
6836        .headers()
6837        .get("content-type")
6838        .and_then(|v| v.to_str().ok())
6839        .unwrap_or("application/octet-stream");
6840    let content_type = super::ContentType::from(content_type);
6841
6842    if !status.is_client_error() && !status.is_server_error() {
6843        let content = resp.text().await?;
6844        match content_type {
6845            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6846            ContentType::Text => {
6847                return Err(Error::from(serde_json::Error::custom(
6848                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
6849                )))
6850            }
6851            ContentType::Unsupported(unknown_type) => {
6852                return Err(Error::from(serde_json::Error::custom(format!(
6853                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
6854                ))))
6855            }
6856        }
6857    } else {
6858        let content = resp.text().await?;
6859        let entity: Option<SourcesScimCreateError> = serde_json::from_str(&content).ok();
6860        Err(Error::ResponseError(ResponseContent {
6861            status,
6862            content,
6863            entity,
6864        }))
6865    }
6866}
6867
6868/// SCIMSource Viewset
6869pub async fn sources_scim_destroy(
6870    configuration: &configuration::Configuration,
6871    slug: &str,
6872) -> Result<(), Error<SourcesScimDestroyError>> {
6873    // add a prefix to parameters to efficiently prevent name collisions
6874    let p_path_slug = slug;
6875
6876    let uri_str = format!(
6877        "{}/sources/scim/{slug}/",
6878        configuration.base_path,
6879        slug = crate::apis::urlencode(p_path_slug)
6880    );
6881    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6882
6883    if let Some(ref user_agent) = configuration.user_agent {
6884        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6885    }
6886    if let Some(ref token) = configuration.bearer_access_token {
6887        req_builder = req_builder.bearer_auth(token.to_owned());
6888    };
6889
6890    let req = req_builder.build()?;
6891    let resp = configuration.client.execute(req).await?;
6892
6893    let status = resp.status();
6894
6895    if !status.is_client_error() && !status.is_server_error() {
6896        Ok(())
6897    } else {
6898        let content = resp.text().await?;
6899        let entity: Option<SourcesScimDestroyError> = serde_json::from_str(&content).ok();
6900        Err(Error::ResponseError(ResponseContent {
6901            status,
6902            content,
6903            entity,
6904        }))
6905    }
6906}
6907
6908/// SCIMSourceGroup Viewset
6909pub async fn sources_scim_groups_create(
6910    configuration: &configuration::Configuration,
6911    scim_source_group_request: models::ScimSourceGroupRequest,
6912) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsCreateError>> {
6913    // add a prefix to parameters to efficiently prevent name collisions
6914    let p_body_scim_source_group_request = scim_source_group_request;
6915
6916    let uri_str = format!("{}/sources/scim_groups/", configuration.base_path);
6917    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6918
6919    if let Some(ref user_agent) = configuration.user_agent {
6920        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6921    }
6922    if let Some(ref token) = configuration.bearer_access_token {
6923        req_builder = req_builder.bearer_auth(token.to_owned());
6924    };
6925    req_builder = req_builder.json(&p_body_scim_source_group_request);
6926
6927    let req = req_builder.build()?;
6928    let resp = configuration.client.execute(req).await?;
6929
6930    let status = resp.status();
6931    let content_type = resp
6932        .headers()
6933        .get("content-type")
6934        .and_then(|v| v.to_str().ok())
6935        .unwrap_or("application/octet-stream");
6936    let content_type = super::ContentType::from(content_type);
6937
6938    if !status.is_client_error() && !status.is_server_error() {
6939        let content = resp.text().await?;
6940        match content_type {
6941            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6942            ContentType::Text => {
6943                return Err(Error::from(serde_json::Error::custom(
6944                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
6945                )))
6946            }
6947            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6948                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
6949            )))),
6950        }
6951    } else {
6952        let content = resp.text().await?;
6953        let entity: Option<SourcesScimGroupsCreateError> = serde_json::from_str(&content).ok();
6954        Err(Error::ResponseError(ResponseContent {
6955            status,
6956            content,
6957            entity,
6958        }))
6959    }
6960}
6961
6962/// SCIMSourceGroup Viewset
6963pub async fn sources_scim_groups_destroy(
6964    configuration: &configuration::Configuration,
6965    id: &str,
6966) -> Result<(), Error<SourcesScimGroupsDestroyError>> {
6967    // add a prefix to parameters to efficiently prevent name collisions
6968    let p_path_id = id;
6969
6970    let uri_str = format!(
6971        "{}/sources/scim_groups/{id}/",
6972        configuration.base_path,
6973        id = crate::apis::urlencode(p_path_id)
6974    );
6975    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6976
6977    if let Some(ref user_agent) = configuration.user_agent {
6978        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6979    }
6980    if let Some(ref token) = configuration.bearer_access_token {
6981        req_builder = req_builder.bearer_auth(token.to_owned());
6982    };
6983
6984    let req = req_builder.build()?;
6985    let resp = configuration.client.execute(req).await?;
6986
6987    let status = resp.status();
6988
6989    if !status.is_client_error() && !status.is_server_error() {
6990        Ok(())
6991    } else {
6992        let content = resp.text().await?;
6993        let entity: Option<SourcesScimGroupsDestroyError> = serde_json::from_str(&content).ok();
6994        Err(Error::ResponseError(ResponseContent {
6995            status,
6996            content,
6997            entity,
6998        }))
6999    }
7000}
7001
7002/// SCIMSourceGroup Viewset
7003pub async fn sources_scim_groups_list(
7004    configuration: &configuration::Configuration,
7005    group__group_uuid: Option<&str>,
7006    group__name: Option<&str>,
7007    ordering: Option<&str>,
7008    page: Option<i32>,
7009    page_size: Option<i32>,
7010    search: Option<&str>,
7011    source__slug: Option<&str>,
7012) -> Result<models::PaginatedScimSourceGroupList, Error<SourcesScimGroupsListError>> {
7013    // add a prefix to parameters to efficiently prevent name collisions
7014    let p_query_group__group_uuid = group__group_uuid;
7015    let p_query_group__name = group__name;
7016    let p_query_ordering = ordering;
7017    let p_query_page = page;
7018    let p_query_page_size = page_size;
7019    let p_query_search = search;
7020    let p_query_source__slug = source__slug;
7021
7022    let uri_str = format!("{}/sources/scim_groups/", configuration.base_path);
7023    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7024
7025    if let Some(ref param_value) = p_query_group__group_uuid {
7026        req_builder = req_builder.query(&[("group__group_uuid", &param_value.to_string())]);
7027    }
7028    if let Some(ref param_value) = p_query_group__name {
7029        req_builder = req_builder.query(&[("group__name", &param_value.to_string())]);
7030    }
7031    if let Some(ref param_value) = p_query_ordering {
7032        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7033    }
7034    if let Some(ref param_value) = p_query_page {
7035        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7036    }
7037    if let Some(ref param_value) = p_query_page_size {
7038        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7039    }
7040    if let Some(ref param_value) = p_query_search {
7041        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7042    }
7043    if let Some(ref param_value) = p_query_source__slug {
7044        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
7045    }
7046    if let Some(ref user_agent) = configuration.user_agent {
7047        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7048    }
7049    if let Some(ref token) = configuration.bearer_access_token {
7050        req_builder = req_builder.bearer_auth(token.to_owned());
7051    };
7052
7053    let req = req_builder.build()?;
7054    let resp = configuration.client.execute(req).await?;
7055
7056    let status = resp.status();
7057    let content_type = resp
7058        .headers()
7059        .get("content-type")
7060        .and_then(|v| v.to_str().ok())
7061        .unwrap_or("application/octet-stream");
7062    let content_type = super::ContentType::from(content_type);
7063
7064    if !status.is_client_error() && !status.is_server_error() {
7065        let content = resp.text().await?;
7066        match content_type {
7067            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7068            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceGroupList`"))),
7069            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourceGroupList`")))),
7070        }
7071    } else {
7072        let content = resp.text().await?;
7073        let entity: Option<SourcesScimGroupsListError> = serde_json::from_str(&content).ok();
7074        Err(Error::ResponseError(ResponseContent {
7075            status,
7076            content,
7077            entity,
7078        }))
7079    }
7080}
7081
7082/// SCIMSourceGroup Viewset
7083pub async fn sources_scim_groups_partial_update(
7084    configuration: &configuration::Configuration,
7085    id: &str,
7086    patched_scim_source_group_request: Option<models::PatchedScimSourceGroupRequest>,
7087) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsPartialUpdateError>> {
7088    // add a prefix to parameters to efficiently prevent name collisions
7089    let p_path_id = id;
7090    let p_body_patched_scim_source_group_request = patched_scim_source_group_request;
7091
7092    let uri_str = format!(
7093        "{}/sources/scim_groups/{id}/",
7094        configuration.base_path,
7095        id = crate::apis::urlencode(p_path_id)
7096    );
7097    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7098
7099    if let Some(ref user_agent) = configuration.user_agent {
7100        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7101    }
7102    if let Some(ref token) = configuration.bearer_access_token {
7103        req_builder = req_builder.bearer_auth(token.to_owned());
7104    };
7105    req_builder = req_builder.json(&p_body_patched_scim_source_group_request);
7106
7107    let req = req_builder.build()?;
7108    let resp = configuration.client.execute(req).await?;
7109
7110    let status = resp.status();
7111    let content_type = resp
7112        .headers()
7113        .get("content-type")
7114        .and_then(|v| v.to_str().ok())
7115        .unwrap_or("application/octet-stream");
7116    let content_type = super::ContentType::from(content_type);
7117
7118    if !status.is_client_error() && !status.is_server_error() {
7119        let content = resp.text().await?;
7120        match content_type {
7121            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7122            ContentType::Text => {
7123                return Err(Error::from(serde_json::Error::custom(
7124                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7125                )))
7126            }
7127            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7128                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7129            )))),
7130        }
7131    } else {
7132        let content = resp.text().await?;
7133        let entity: Option<SourcesScimGroupsPartialUpdateError> = serde_json::from_str(&content).ok();
7134        Err(Error::ResponseError(ResponseContent {
7135            status,
7136            content,
7137            entity,
7138        }))
7139    }
7140}
7141
7142/// SCIMSourceGroup Viewset
7143pub async fn sources_scim_groups_retrieve(
7144    configuration: &configuration::Configuration,
7145    id: &str,
7146) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsRetrieveError>> {
7147    // add a prefix to parameters to efficiently prevent name collisions
7148    let p_path_id = id;
7149
7150    let uri_str = format!(
7151        "{}/sources/scim_groups/{id}/",
7152        configuration.base_path,
7153        id = crate::apis::urlencode(p_path_id)
7154    );
7155    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7156
7157    if let Some(ref user_agent) = configuration.user_agent {
7158        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7159    }
7160    if let Some(ref token) = configuration.bearer_access_token {
7161        req_builder = req_builder.bearer_auth(token.to_owned());
7162    };
7163
7164    let req = req_builder.build()?;
7165    let resp = configuration.client.execute(req).await?;
7166
7167    let status = resp.status();
7168    let content_type = resp
7169        .headers()
7170        .get("content-type")
7171        .and_then(|v| v.to_str().ok())
7172        .unwrap_or("application/octet-stream");
7173    let content_type = super::ContentType::from(content_type);
7174
7175    if !status.is_client_error() && !status.is_server_error() {
7176        let content = resp.text().await?;
7177        match content_type {
7178            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7179            ContentType::Text => {
7180                return Err(Error::from(serde_json::Error::custom(
7181                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7182                )))
7183            }
7184            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7185                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7186            )))),
7187        }
7188    } else {
7189        let content = resp.text().await?;
7190        let entity: Option<SourcesScimGroupsRetrieveError> = serde_json::from_str(&content).ok();
7191        Err(Error::ResponseError(ResponseContent {
7192            status,
7193            content,
7194            entity,
7195        }))
7196    }
7197}
7198
7199/// SCIMSourceGroup Viewset
7200pub async fn sources_scim_groups_update(
7201    configuration: &configuration::Configuration,
7202    id: &str,
7203    scim_source_group_request: models::ScimSourceGroupRequest,
7204) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsUpdateError>> {
7205    // add a prefix to parameters to efficiently prevent name collisions
7206    let p_path_id = id;
7207    let p_body_scim_source_group_request = scim_source_group_request;
7208
7209    let uri_str = format!(
7210        "{}/sources/scim_groups/{id}/",
7211        configuration.base_path,
7212        id = crate::apis::urlencode(p_path_id)
7213    );
7214    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7215
7216    if let Some(ref user_agent) = configuration.user_agent {
7217        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7218    }
7219    if let Some(ref token) = configuration.bearer_access_token {
7220        req_builder = req_builder.bearer_auth(token.to_owned());
7221    };
7222    req_builder = req_builder.json(&p_body_scim_source_group_request);
7223
7224    let req = req_builder.build()?;
7225    let resp = configuration.client.execute(req).await?;
7226
7227    let status = resp.status();
7228    let content_type = resp
7229        .headers()
7230        .get("content-type")
7231        .and_then(|v| v.to_str().ok())
7232        .unwrap_or("application/octet-stream");
7233    let content_type = super::ContentType::from(content_type);
7234
7235    if !status.is_client_error() && !status.is_server_error() {
7236        let content = resp.text().await?;
7237        match content_type {
7238            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7239            ContentType::Text => {
7240                return Err(Error::from(serde_json::Error::custom(
7241                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7242                )))
7243            }
7244            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7245                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7246            )))),
7247        }
7248    } else {
7249        let content = resp.text().await?;
7250        let entity: Option<SourcesScimGroupsUpdateError> = serde_json::from_str(&content).ok();
7251        Err(Error::ResponseError(ResponseContent {
7252            status,
7253            content,
7254            entity,
7255        }))
7256    }
7257}
7258
7259/// Get a list of all objects that use this object
7260pub async fn sources_scim_groups_used_by_list(
7261    configuration: &configuration::Configuration,
7262    id: &str,
7263) -> Result<Vec<models::UsedBy>, Error<SourcesScimGroupsUsedByListError>> {
7264    // add a prefix to parameters to efficiently prevent name collisions
7265    let p_path_id = id;
7266
7267    let uri_str = format!(
7268        "{}/sources/scim_groups/{id}/used_by/",
7269        configuration.base_path,
7270        id = crate::apis::urlencode(p_path_id)
7271    );
7272    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7273
7274    if let Some(ref user_agent) = configuration.user_agent {
7275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7276    }
7277    if let Some(ref token) = configuration.bearer_access_token {
7278        req_builder = req_builder.bearer_auth(token.to_owned());
7279    };
7280
7281    let req = req_builder.build()?;
7282    let resp = configuration.client.execute(req).await?;
7283
7284    let status = resp.status();
7285    let content_type = resp
7286        .headers()
7287        .get("content-type")
7288        .and_then(|v| v.to_str().ok())
7289        .unwrap_or("application/octet-stream");
7290    let content_type = super::ContentType::from(content_type);
7291
7292    if !status.is_client_error() && !status.is_server_error() {
7293        let content = resp.text().await?;
7294        match content_type {
7295            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7296            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;`"))),
7297            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;`")))),
7298        }
7299    } else {
7300        let content = resp.text().await?;
7301        let entity: Option<SourcesScimGroupsUsedByListError> = serde_json::from_str(&content).ok();
7302        Err(Error::ResponseError(ResponseContent {
7303            status,
7304            content,
7305            entity,
7306        }))
7307    }
7308}
7309
7310/// SCIMSource Viewset
7311pub async fn sources_scim_list(
7312    configuration: &configuration::Configuration,
7313    name: Option<&str>,
7314    ordering: Option<&str>,
7315    page: Option<i32>,
7316    page_size: Option<i32>,
7317    pbm_uuid: Option<&str>,
7318    search: Option<&str>,
7319    slug: Option<&str>,
7320) -> Result<models::PaginatedScimSourceList, Error<SourcesScimListError>> {
7321    // add a prefix to parameters to efficiently prevent name collisions
7322    let p_query_name = name;
7323    let p_query_ordering = ordering;
7324    let p_query_page = page;
7325    let p_query_page_size = page_size;
7326    let p_query_pbm_uuid = pbm_uuid;
7327    let p_query_search = search;
7328    let p_query_slug = slug;
7329
7330    let uri_str = format!("{}/sources/scim/", configuration.base_path);
7331    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7332
7333    if let Some(ref param_value) = p_query_name {
7334        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
7335    }
7336    if let Some(ref param_value) = p_query_ordering {
7337        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7338    }
7339    if let Some(ref param_value) = p_query_page {
7340        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7341    }
7342    if let Some(ref param_value) = p_query_page_size {
7343        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7344    }
7345    if let Some(ref param_value) = p_query_pbm_uuid {
7346        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
7347    }
7348    if let Some(ref param_value) = p_query_search {
7349        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7350    }
7351    if let Some(ref param_value) = p_query_slug {
7352        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
7353    }
7354    if let Some(ref user_agent) = configuration.user_agent {
7355        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7356    }
7357    if let Some(ref token) = configuration.bearer_access_token {
7358        req_builder = req_builder.bearer_auth(token.to_owned());
7359    };
7360
7361    let req = req_builder.build()?;
7362    let resp = configuration.client.execute(req).await?;
7363
7364    let status = resp.status();
7365    let content_type = resp
7366        .headers()
7367        .get("content-type")
7368        .and_then(|v| v.to_str().ok())
7369        .unwrap_or("application/octet-stream");
7370    let content_type = super::ContentType::from(content_type);
7371
7372    if !status.is_client_error() && !status.is_server_error() {
7373        let content = resp.text().await?;
7374        match content_type {
7375            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7376            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceList`"))),
7377            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourceList`")))),
7378        }
7379    } else {
7380        let content = resp.text().await?;
7381        let entity: Option<SourcesScimListError> = serde_json::from_str(&content).ok();
7382        Err(Error::ResponseError(ResponseContent {
7383            status,
7384            content,
7385            entity,
7386        }))
7387    }
7388}
7389
7390/// SCIMSource Viewset
7391pub async fn sources_scim_partial_update(
7392    configuration: &configuration::Configuration,
7393    slug: &str,
7394    patched_scim_source_request: Option<models::PatchedScimSourceRequest>,
7395) -> Result<models::ScimSource, Error<SourcesScimPartialUpdateError>> {
7396    // add a prefix to parameters to efficiently prevent name collisions
7397    let p_path_slug = slug;
7398    let p_body_patched_scim_source_request = patched_scim_source_request;
7399
7400    let uri_str = format!(
7401        "{}/sources/scim/{slug}/",
7402        configuration.base_path,
7403        slug = crate::apis::urlencode(p_path_slug)
7404    );
7405    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7406
7407    if let Some(ref user_agent) = configuration.user_agent {
7408        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7409    }
7410    if let Some(ref token) = configuration.bearer_access_token {
7411        req_builder = req_builder.bearer_auth(token.to_owned());
7412    };
7413    req_builder = req_builder.json(&p_body_patched_scim_source_request);
7414
7415    let req = req_builder.build()?;
7416    let resp = configuration.client.execute(req).await?;
7417
7418    let status = resp.status();
7419    let content_type = resp
7420        .headers()
7421        .get("content-type")
7422        .and_then(|v| v.to_str().ok())
7423        .unwrap_or("application/octet-stream");
7424    let content_type = super::ContentType::from(content_type);
7425
7426    if !status.is_client_error() && !status.is_server_error() {
7427        let content = resp.text().await?;
7428        match content_type {
7429            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7430            ContentType::Text => {
7431                return Err(Error::from(serde_json::Error::custom(
7432                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7433                )))
7434            }
7435            ContentType::Unsupported(unknown_type) => {
7436                return Err(Error::from(serde_json::Error::custom(format!(
7437                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7438                ))))
7439            }
7440        }
7441    } else {
7442        let content = resp.text().await?;
7443        let entity: Option<SourcesScimPartialUpdateError> = serde_json::from_str(&content).ok();
7444        Err(Error::ResponseError(ResponseContent {
7445            status,
7446            content,
7447            entity,
7448        }))
7449    }
7450}
7451
7452/// SCIMSource Viewset
7453pub async fn sources_scim_retrieve(
7454    configuration: &configuration::Configuration,
7455    slug: &str,
7456) -> Result<models::ScimSource, Error<SourcesScimRetrieveError>> {
7457    // add a prefix to parameters to efficiently prevent name collisions
7458    let p_path_slug = slug;
7459
7460    let uri_str = format!(
7461        "{}/sources/scim/{slug}/",
7462        configuration.base_path,
7463        slug = crate::apis::urlencode(p_path_slug)
7464    );
7465    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7466
7467    if let Some(ref user_agent) = configuration.user_agent {
7468        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7469    }
7470    if let Some(ref token) = configuration.bearer_access_token {
7471        req_builder = req_builder.bearer_auth(token.to_owned());
7472    };
7473
7474    let req = req_builder.build()?;
7475    let resp = configuration.client.execute(req).await?;
7476
7477    let status = resp.status();
7478    let content_type = resp
7479        .headers()
7480        .get("content-type")
7481        .and_then(|v| v.to_str().ok())
7482        .unwrap_or("application/octet-stream");
7483    let content_type = super::ContentType::from(content_type);
7484
7485    if !status.is_client_error() && !status.is_server_error() {
7486        let content = resp.text().await?;
7487        match content_type {
7488            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7489            ContentType::Text => {
7490                return Err(Error::from(serde_json::Error::custom(
7491                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7492                )))
7493            }
7494            ContentType::Unsupported(unknown_type) => {
7495                return Err(Error::from(serde_json::Error::custom(format!(
7496                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7497                ))))
7498            }
7499        }
7500    } else {
7501        let content = resp.text().await?;
7502        let entity: Option<SourcesScimRetrieveError> = serde_json::from_str(&content).ok();
7503        Err(Error::ResponseError(ResponseContent {
7504            status,
7505            content,
7506            entity,
7507        }))
7508    }
7509}
7510
7511/// SCIMSource Viewset
7512pub async fn sources_scim_update(
7513    configuration: &configuration::Configuration,
7514    slug: &str,
7515    scim_source_request: models::ScimSourceRequest,
7516) -> Result<models::ScimSource, Error<SourcesScimUpdateError>> {
7517    // add a prefix to parameters to efficiently prevent name collisions
7518    let p_path_slug = slug;
7519    let p_body_scim_source_request = scim_source_request;
7520
7521    let uri_str = format!(
7522        "{}/sources/scim/{slug}/",
7523        configuration.base_path,
7524        slug = crate::apis::urlencode(p_path_slug)
7525    );
7526    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7527
7528    if let Some(ref user_agent) = configuration.user_agent {
7529        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7530    }
7531    if let Some(ref token) = configuration.bearer_access_token {
7532        req_builder = req_builder.bearer_auth(token.to_owned());
7533    };
7534    req_builder = req_builder.json(&p_body_scim_source_request);
7535
7536    let req = req_builder.build()?;
7537    let resp = configuration.client.execute(req).await?;
7538
7539    let status = resp.status();
7540    let content_type = resp
7541        .headers()
7542        .get("content-type")
7543        .and_then(|v| v.to_str().ok())
7544        .unwrap_or("application/octet-stream");
7545    let content_type = super::ContentType::from(content_type);
7546
7547    if !status.is_client_error() && !status.is_server_error() {
7548        let content = resp.text().await?;
7549        match content_type {
7550            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7551            ContentType::Text => {
7552                return Err(Error::from(serde_json::Error::custom(
7553                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7554                )))
7555            }
7556            ContentType::Unsupported(unknown_type) => {
7557                return Err(Error::from(serde_json::Error::custom(format!(
7558                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7559                ))))
7560            }
7561        }
7562    } else {
7563        let content = resp.text().await?;
7564        let entity: Option<SourcesScimUpdateError> = serde_json::from_str(&content).ok();
7565        Err(Error::ResponseError(ResponseContent {
7566            status,
7567            content,
7568            entity,
7569        }))
7570    }
7571}
7572
7573/// Get a list of all objects that use this object
7574pub async fn sources_scim_used_by_list(
7575    configuration: &configuration::Configuration,
7576    slug: &str,
7577) -> Result<Vec<models::UsedBy>, Error<SourcesScimUsedByListError>> {
7578    // add a prefix to parameters to efficiently prevent name collisions
7579    let p_path_slug = slug;
7580
7581    let uri_str = format!(
7582        "{}/sources/scim/{slug}/used_by/",
7583        configuration.base_path,
7584        slug = crate::apis::urlencode(p_path_slug)
7585    );
7586    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7587
7588    if let Some(ref user_agent) = configuration.user_agent {
7589        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7590    }
7591    if let Some(ref token) = configuration.bearer_access_token {
7592        req_builder = req_builder.bearer_auth(token.to_owned());
7593    };
7594
7595    let req = req_builder.build()?;
7596    let resp = configuration.client.execute(req).await?;
7597
7598    let status = resp.status();
7599    let content_type = resp
7600        .headers()
7601        .get("content-type")
7602        .and_then(|v| v.to_str().ok())
7603        .unwrap_or("application/octet-stream");
7604    let content_type = super::ContentType::from(content_type);
7605
7606    if !status.is_client_error() && !status.is_server_error() {
7607        let content = resp.text().await?;
7608        match content_type {
7609            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7610            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;`"))),
7611            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;`")))),
7612        }
7613    } else {
7614        let content = resp.text().await?;
7615        let entity: Option<SourcesScimUsedByListError> = serde_json::from_str(&content).ok();
7616        Err(Error::ResponseError(ResponseContent {
7617            status,
7618            content,
7619            entity,
7620        }))
7621    }
7622}
7623
7624/// SCIMSourceUser Viewset
7625pub async fn sources_scim_users_create(
7626    configuration: &configuration::Configuration,
7627    scim_source_user_request: models::ScimSourceUserRequest,
7628) -> Result<models::ScimSourceUser, Error<SourcesScimUsersCreateError>> {
7629    // add a prefix to parameters to efficiently prevent name collisions
7630    let p_body_scim_source_user_request = scim_source_user_request;
7631
7632    let uri_str = format!("{}/sources/scim_users/", configuration.base_path);
7633    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7634
7635    if let Some(ref user_agent) = configuration.user_agent {
7636        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7637    }
7638    if let Some(ref token) = configuration.bearer_access_token {
7639        req_builder = req_builder.bearer_auth(token.to_owned());
7640    };
7641    req_builder = req_builder.json(&p_body_scim_source_user_request);
7642
7643    let req = req_builder.build()?;
7644    let resp = configuration.client.execute(req).await?;
7645
7646    let status = resp.status();
7647    let content_type = resp
7648        .headers()
7649        .get("content-type")
7650        .and_then(|v| v.to_str().ok())
7651        .unwrap_or("application/octet-stream");
7652    let content_type = super::ContentType::from(content_type);
7653
7654    if !status.is_client_error() && !status.is_server_error() {
7655        let content = resp.text().await?;
7656        match content_type {
7657            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7658            ContentType::Text => {
7659                return Err(Error::from(serde_json::Error::custom(
7660                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
7661                )))
7662            }
7663            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7664                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
7665            )))),
7666        }
7667    } else {
7668        let content = resp.text().await?;
7669        let entity: Option<SourcesScimUsersCreateError> = serde_json::from_str(&content).ok();
7670        Err(Error::ResponseError(ResponseContent {
7671            status,
7672            content,
7673            entity,
7674        }))
7675    }
7676}
7677
7678/// SCIMSourceUser Viewset
7679pub async fn sources_scim_users_destroy(
7680    configuration: &configuration::Configuration,
7681    id: &str,
7682) -> Result<(), Error<SourcesScimUsersDestroyError>> {
7683    // add a prefix to parameters to efficiently prevent name collisions
7684    let p_path_id = id;
7685
7686    let uri_str = format!(
7687        "{}/sources/scim_users/{id}/",
7688        configuration.base_path,
7689        id = crate::apis::urlencode(p_path_id)
7690    );
7691    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7692
7693    if let Some(ref user_agent) = configuration.user_agent {
7694        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7695    }
7696    if let Some(ref token) = configuration.bearer_access_token {
7697        req_builder = req_builder.bearer_auth(token.to_owned());
7698    };
7699
7700    let req = req_builder.build()?;
7701    let resp = configuration.client.execute(req).await?;
7702
7703    let status = resp.status();
7704
7705    if !status.is_client_error() && !status.is_server_error() {
7706        Ok(())
7707    } else {
7708        let content = resp.text().await?;
7709        let entity: Option<SourcesScimUsersDestroyError> = serde_json::from_str(&content).ok();
7710        Err(Error::ResponseError(ResponseContent {
7711            status,
7712            content,
7713            entity,
7714        }))
7715    }
7716}
7717
7718/// SCIMSourceUser Viewset
7719pub async fn sources_scim_users_list(
7720    configuration: &configuration::Configuration,
7721    ordering: Option<&str>,
7722    page: Option<i32>,
7723    page_size: Option<i32>,
7724    search: Option<&str>,
7725    source__slug: Option<&str>,
7726    user__id: Option<i32>,
7727    user__username: Option<&str>,
7728) -> Result<models::PaginatedScimSourceUserList, Error<SourcesScimUsersListError>> {
7729    // add a prefix to parameters to efficiently prevent name collisions
7730    let p_query_ordering = ordering;
7731    let p_query_page = page;
7732    let p_query_page_size = page_size;
7733    let p_query_search = search;
7734    let p_query_source__slug = source__slug;
7735    let p_query_user__id = user__id;
7736    let p_query_user__username = user__username;
7737
7738    let uri_str = format!("{}/sources/scim_users/", configuration.base_path);
7739    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7740
7741    if let Some(ref param_value) = p_query_ordering {
7742        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7743    }
7744    if let Some(ref param_value) = p_query_page {
7745        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7746    }
7747    if let Some(ref param_value) = p_query_page_size {
7748        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7749    }
7750    if let Some(ref param_value) = p_query_search {
7751        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7752    }
7753    if let Some(ref param_value) = p_query_source__slug {
7754        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
7755    }
7756    if let Some(ref param_value) = p_query_user__id {
7757        req_builder = req_builder.query(&[("user__id", &param_value.to_string())]);
7758    }
7759    if let Some(ref param_value) = p_query_user__username {
7760        req_builder = req_builder.query(&[("user__username", &param_value.to_string())]);
7761    }
7762    if let Some(ref user_agent) = configuration.user_agent {
7763        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7764    }
7765    if let Some(ref token) = configuration.bearer_access_token {
7766        req_builder = req_builder.bearer_auth(token.to_owned());
7767    };
7768
7769    let req = req_builder.build()?;
7770    let resp = configuration.client.execute(req).await?;
7771
7772    let status = resp.status();
7773    let content_type = resp
7774        .headers()
7775        .get("content-type")
7776        .and_then(|v| v.to_str().ok())
7777        .unwrap_or("application/octet-stream");
7778    let content_type = super::ContentType::from(content_type);
7779
7780    if !status.is_client_error() && !status.is_server_error() {
7781        let content = resp.text().await?;
7782        match content_type {
7783            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7784            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceUserList`"))),
7785            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourceUserList`")))),
7786        }
7787    } else {
7788        let content = resp.text().await?;
7789        let entity: Option<SourcesScimUsersListError> = serde_json::from_str(&content).ok();
7790        Err(Error::ResponseError(ResponseContent {
7791            status,
7792            content,
7793            entity,
7794        }))
7795    }
7796}
7797
7798/// SCIMSourceUser Viewset
7799pub async fn sources_scim_users_partial_update(
7800    configuration: &configuration::Configuration,
7801    id: &str,
7802    patched_scim_source_user_request: Option<models::PatchedScimSourceUserRequest>,
7803) -> Result<models::ScimSourceUser, Error<SourcesScimUsersPartialUpdateError>> {
7804    // add a prefix to parameters to efficiently prevent name collisions
7805    let p_path_id = id;
7806    let p_body_patched_scim_source_user_request = patched_scim_source_user_request;
7807
7808    let uri_str = format!(
7809        "{}/sources/scim_users/{id}/",
7810        configuration.base_path,
7811        id = crate::apis::urlencode(p_path_id)
7812    );
7813    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7814
7815    if let Some(ref user_agent) = configuration.user_agent {
7816        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7817    }
7818    if let Some(ref token) = configuration.bearer_access_token {
7819        req_builder = req_builder.bearer_auth(token.to_owned());
7820    };
7821    req_builder = req_builder.json(&p_body_patched_scim_source_user_request);
7822
7823    let req = req_builder.build()?;
7824    let resp = configuration.client.execute(req).await?;
7825
7826    let status = resp.status();
7827    let content_type = resp
7828        .headers()
7829        .get("content-type")
7830        .and_then(|v| v.to_str().ok())
7831        .unwrap_or("application/octet-stream");
7832    let content_type = super::ContentType::from(content_type);
7833
7834    if !status.is_client_error() && !status.is_server_error() {
7835        let content = resp.text().await?;
7836        match content_type {
7837            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7838            ContentType::Text => {
7839                return Err(Error::from(serde_json::Error::custom(
7840                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
7841                )))
7842            }
7843            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7844                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
7845            )))),
7846        }
7847    } else {
7848        let content = resp.text().await?;
7849        let entity: Option<SourcesScimUsersPartialUpdateError> = serde_json::from_str(&content).ok();
7850        Err(Error::ResponseError(ResponseContent {
7851            status,
7852            content,
7853            entity,
7854        }))
7855    }
7856}
7857
7858/// SCIMSourceUser Viewset
7859pub async fn sources_scim_users_retrieve(
7860    configuration: &configuration::Configuration,
7861    id: &str,
7862) -> Result<models::ScimSourceUser, Error<SourcesScimUsersRetrieveError>> {
7863    // add a prefix to parameters to efficiently prevent name collisions
7864    let p_path_id = id;
7865
7866    let uri_str = format!(
7867        "{}/sources/scim_users/{id}/",
7868        configuration.base_path,
7869        id = crate::apis::urlencode(p_path_id)
7870    );
7871    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7872
7873    if let Some(ref user_agent) = configuration.user_agent {
7874        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7875    }
7876    if let Some(ref token) = configuration.bearer_access_token {
7877        req_builder = req_builder.bearer_auth(token.to_owned());
7878    };
7879
7880    let req = req_builder.build()?;
7881    let resp = configuration.client.execute(req).await?;
7882
7883    let status = resp.status();
7884    let content_type = resp
7885        .headers()
7886        .get("content-type")
7887        .and_then(|v| v.to_str().ok())
7888        .unwrap_or("application/octet-stream");
7889    let content_type = super::ContentType::from(content_type);
7890
7891    if !status.is_client_error() && !status.is_server_error() {
7892        let content = resp.text().await?;
7893        match content_type {
7894            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7895            ContentType::Text => {
7896                return Err(Error::from(serde_json::Error::custom(
7897                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
7898                )))
7899            }
7900            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7901                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
7902            )))),
7903        }
7904    } else {
7905        let content = resp.text().await?;
7906        let entity: Option<SourcesScimUsersRetrieveError> = serde_json::from_str(&content).ok();
7907        Err(Error::ResponseError(ResponseContent {
7908            status,
7909            content,
7910            entity,
7911        }))
7912    }
7913}
7914
7915/// SCIMSourceUser Viewset
7916pub async fn sources_scim_users_update(
7917    configuration: &configuration::Configuration,
7918    id: &str,
7919    scim_source_user_request: models::ScimSourceUserRequest,
7920) -> Result<models::ScimSourceUser, Error<SourcesScimUsersUpdateError>> {
7921    // add a prefix to parameters to efficiently prevent name collisions
7922    let p_path_id = id;
7923    let p_body_scim_source_user_request = scim_source_user_request;
7924
7925    let uri_str = format!(
7926        "{}/sources/scim_users/{id}/",
7927        configuration.base_path,
7928        id = crate::apis::urlencode(p_path_id)
7929    );
7930    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7931
7932    if let Some(ref user_agent) = configuration.user_agent {
7933        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7934    }
7935    if let Some(ref token) = configuration.bearer_access_token {
7936        req_builder = req_builder.bearer_auth(token.to_owned());
7937    };
7938    req_builder = req_builder.json(&p_body_scim_source_user_request);
7939
7940    let req = req_builder.build()?;
7941    let resp = configuration.client.execute(req).await?;
7942
7943    let status = resp.status();
7944    let content_type = resp
7945        .headers()
7946        .get("content-type")
7947        .and_then(|v| v.to_str().ok())
7948        .unwrap_or("application/octet-stream");
7949    let content_type = super::ContentType::from(content_type);
7950
7951    if !status.is_client_error() && !status.is_server_error() {
7952        let content = resp.text().await?;
7953        match content_type {
7954            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7955            ContentType::Text => {
7956                return Err(Error::from(serde_json::Error::custom(
7957                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
7958                )))
7959            }
7960            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7961                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
7962            )))),
7963        }
7964    } else {
7965        let content = resp.text().await?;
7966        let entity: Option<SourcesScimUsersUpdateError> = serde_json::from_str(&content).ok();
7967        Err(Error::ResponseError(ResponseContent {
7968            status,
7969            content,
7970            entity,
7971        }))
7972    }
7973}
7974
7975/// Get a list of all objects that use this object
7976pub async fn sources_scim_users_used_by_list(
7977    configuration: &configuration::Configuration,
7978    id: &str,
7979) -> Result<Vec<models::UsedBy>, Error<SourcesScimUsersUsedByListError>> {
7980    // add a prefix to parameters to efficiently prevent name collisions
7981    let p_path_id = id;
7982
7983    let uri_str = format!(
7984        "{}/sources/scim_users/{id}/used_by/",
7985        configuration.base_path,
7986        id = crate::apis::urlencode(p_path_id)
7987    );
7988    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7989
7990    if let Some(ref user_agent) = configuration.user_agent {
7991        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7992    }
7993    if let Some(ref token) = configuration.bearer_access_token {
7994        req_builder = req_builder.bearer_auth(token.to_owned());
7995    };
7996
7997    let req = req_builder.build()?;
7998    let resp = configuration.client.execute(req).await?;
7999
8000    let status = resp.status();
8001    let content_type = resp
8002        .headers()
8003        .get("content-type")
8004        .and_then(|v| v.to_str().ok())
8005        .unwrap_or("application/octet-stream");
8006    let content_type = super::ContentType::from(content_type);
8007
8008    if !status.is_client_error() && !status.is_server_error() {
8009        let content = resp.text().await?;
8010        match content_type {
8011            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8012            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;`"))),
8013            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;`")))),
8014        }
8015    } else {
8016        let content = resp.text().await?;
8017        let entity: Option<SourcesScimUsersUsedByListError> = serde_json::from_str(&content).ok();
8018        Err(Error::ResponseError(ResponseContent {
8019            status,
8020            content,
8021            entity,
8022        }))
8023    }
8024}
8025
8026/// User-source connection Viewset
8027pub async fn sources_user_connections_all_destroy(
8028    configuration: &configuration::Configuration,
8029    id: i32,
8030) -> Result<(), Error<SourcesUserConnectionsAllDestroyError>> {
8031    // add a prefix to parameters to efficiently prevent name collisions
8032    let p_path_id = id;
8033
8034    let uri_str = format!(
8035        "{}/sources/user_connections/all/{id}/",
8036        configuration.base_path,
8037        id = p_path_id
8038    );
8039    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8040
8041    if let Some(ref user_agent) = configuration.user_agent {
8042        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8043    }
8044    if let Some(ref token) = configuration.bearer_access_token {
8045        req_builder = req_builder.bearer_auth(token.to_owned());
8046    };
8047
8048    let req = req_builder.build()?;
8049    let resp = configuration.client.execute(req).await?;
8050
8051    let status = resp.status();
8052
8053    if !status.is_client_error() && !status.is_server_error() {
8054        Ok(())
8055    } else {
8056        let content = resp.text().await?;
8057        let entity: Option<SourcesUserConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
8058        Err(Error::ResponseError(ResponseContent {
8059            status,
8060            content,
8061            entity,
8062        }))
8063    }
8064}
8065
8066/// User-source connection Viewset
8067pub async fn sources_user_connections_all_list(
8068    configuration: &configuration::Configuration,
8069    ordering: Option<&str>,
8070    page: Option<i32>,
8071    page_size: Option<i32>,
8072    search: Option<&str>,
8073    source__slug: Option<&str>,
8074    user: Option<i32>,
8075) -> Result<models::PaginatedUserSourceConnectionList, Error<SourcesUserConnectionsAllListError>> {
8076    // add a prefix to parameters to efficiently prevent name collisions
8077    let p_query_ordering = ordering;
8078    let p_query_page = page;
8079    let p_query_page_size = page_size;
8080    let p_query_search = search;
8081    let p_query_source__slug = source__slug;
8082    let p_query_user = user;
8083
8084    let uri_str = format!("{}/sources/user_connections/all/", configuration.base_path);
8085    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8086
8087    if let Some(ref param_value) = p_query_ordering {
8088        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
8089    }
8090    if let Some(ref param_value) = p_query_page {
8091        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
8092    }
8093    if let Some(ref param_value) = p_query_page_size {
8094        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
8095    }
8096    if let Some(ref param_value) = p_query_search {
8097        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
8098    }
8099    if let Some(ref param_value) = p_query_source__slug {
8100        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
8101    }
8102    if let Some(ref param_value) = p_query_user {
8103        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
8104    }
8105    if let Some(ref user_agent) = configuration.user_agent {
8106        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8107    }
8108    if let Some(ref token) = configuration.bearer_access_token {
8109        req_builder = req_builder.bearer_auth(token.to_owned());
8110    };
8111
8112    let req = req_builder.build()?;
8113    let resp = configuration.client.execute(req).await?;
8114
8115    let status = resp.status();
8116    let content_type = resp
8117        .headers()
8118        .get("content-type")
8119        .and_then(|v| v.to_str().ok())
8120        .unwrap_or("application/octet-stream");
8121    let content_type = super::ContentType::from(content_type);
8122
8123    if !status.is_client_error() && !status.is_server_error() {
8124        let content = resp.text().await?;
8125        match content_type {
8126            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8127            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserSourceConnectionList`"))),
8128            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserSourceConnectionList`")))),
8129        }
8130    } else {
8131        let content = resp.text().await?;
8132        let entity: Option<SourcesUserConnectionsAllListError> = serde_json::from_str(&content).ok();
8133        Err(Error::ResponseError(ResponseContent {
8134            status,
8135            content,
8136            entity,
8137        }))
8138    }
8139}
8140
8141/// User-source connection Viewset
8142pub async fn sources_user_connections_all_partial_update(
8143    configuration: &configuration::Configuration,
8144    id: i32,
8145    patched_user_source_connection_request: Option<models::PatchedUserSourceConnectionRequest>,
8146) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllPartialUpdateError>> {
8147    // add a prefix to parameters to efficiently prevent name collisions
8148    let p_path_id = id;
8149    let p_body_patched_user_source_connection_request = patched_user_source_connection_request;
8150
8151    let uri_str = format!(
8152        "{}/sources/user_connections/all/{id}/",
8153        configuration.base_path,
8154        id = p_path_id
8155    );
8156    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8157
8158    if let Some(ref user_agent) = configuration.user_agent {
8159        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8160    }
8161    if let Some(ref token) = configuration.bearer_access_token {
8162        req_builder = req_builder.bearer_auth(token.to_owned());
8163    };
8164    req_builder = req_builder.json(&p_body_patched_user_source_connection_request);
8165
8166    let req = req_builder.build()?;
8167    let resp = configuration.client.execute(req).await?;
8168
8169    let status = resp.status();
8170    let content_type = resp
8171        .headers()
8172        .get("content-type")
8173        .and_then(|v| v.to_str().ok())
8174        .unwrap_or("application/octet-stream");
8175    let content_type = super::ContentType::from(content_type);
8176
8177    if !status.is_client_error() && !status.is_server_error() {
8178        let content = resp.text().await?;
8179        match content_type {
8180            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8181            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
8182            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSourceConnection`")))),
8183        }
8184    } else {
8185        let content = resp.text().await?;
8186        let entity: Option<SourcesUserConnectionsAllPartialUpdateError> = serde_json::from_str(&content).ok();
8187        Err(Error::ResponseError(ResponseContent {
8188            status,
8189            content,
8190            entity,
8191        }))
8192    }
8193}
8194
8195/// User-source connection Viewset
8196pub async fn sources_user_connections_all_retrieve(
8197    configuration: &configuration::Configuration,
8198    id: i32,
8199) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllRetrieveError>> {
8200    // add a prefix to parameters to efficiently prevent name collisions
8201    let p_path_id = id;
8202
8203    let uri_str = format!(
8204        "{}/sources/user_connections/all/{id}/",
8205        configuration.base_path,
8206        id = p_path_id
8207    );
8208    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8209
8210    if let Some(ref user_agent) = configuration.user_agent {
8211        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8212    }
8213    if let Some(ref token) = configuration.bearer_access_token {
8214        req_builder = req_builder.bearer_auth(token.to_owned());
8215    };
8216
8217    let req = req_builder.build()?;
8218    let resp = configuration.client.execute(req).await?;
8219
8220    let status = resp.status();
8221    let content_type = resp
8222        .headers()
8223        .get("content-type")
8224        .and_then(|v| v.to_str().ok())
8225        .unwrap_or("application/octet-stream");
8226    let content_type = super::ContentType::from(content_type);
8227
8228    if !status.is_client_error() && !status.is_server_error() {
8229        let content = resp.text().await?;
8230        match content_type {
8231            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8232            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
8233            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSourceConnection`")))),
8234        }
8235    } else {
8236        let content = resp.text().await?;
8237        let entity: Option<SourcesUserConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
8238        Err(Error::ResponseError(ResponseContent {
8239            status,
8240            content,
8241            entity,
8242        }))
8243    }
8244}
8245
8246/// User-source connection Viewset
8247pub async fn sources_user_connections_all_update(
8248    configuration: &configuration::Configuration,
8249    id: i32,
8250    user_source_connection_request: models::UserSourceConnectionRequest,
8251) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllUpdateError>> {
8252    // add a prefix to parameters to efficiently prevent name collisions
8253    let p_path_id = id;
8254    let p_body_user_source_connection_request = user_source_connection_request;
8255
8256    let uri_str = format!(
8257        "{}/sources/user_connections/all/{id}/",
8258        configuration.base_path,
8259        id = p_path_id
8260    );
8261    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8262
8263    if let Some(ref user_agent) = configuration.user_agent {
8264        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8265    }
8266    if let Some(ref token) = configuration.bearer_access_token {
8267        req_builder = req_builder.bearer_auth(token.to_owned());
8268    };
8269    req_builder = req_builder.json(&p_body_user_source_connection_request);
8270
8271    let req = req_builder.build()?;
8272    let resp = configuration.client.execute(req).await?;
8273
8274    let status = resp.status();
8275    let content_type = resp
8276        .headers()
8277        .get("content-type")
8278        .and_then(|v| v.to_str().ok())
8279        .unwrap_or("application/octet-stream");
8280    let content_type = super::ContentType::from(content_type);
8281
8282    if !status.is_client_error() && !status.is_server_error() {
8283        let content = resp.text().await?;
8284        match content_type {
8285            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8286            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
8287            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSourceConnection`")))),
8288        }
8289    } else {
8290        let content = resp.text().await?;
8291        let entity: Option<SourcesUserConnectionsAllUpdateError> = serde_json::from_str(&content).ok();
8292        Err(Error::ResponseError(ResponseContent {
8293            status,
8294            content,
8295            entity,
8296        }))
8297    }
8298}
8299
8300/// Get a list of all objects that use this object
8301pub async fn sources_user_connections_all_used_by_list(
8302    configuration: &configuration::Configuration,
8303    id: i32,
8304) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsAllUsedByListError>> {
8305    // add a prefix to parameters to efficiently prevent name collisions
8306    let p_path_id = id;
8307
8308    let uri_str = format!(
8309        "{}/sources/user_connections/all/{id}/used_by/",
8310        configuration.base_path,
8311        id = p_path_id
8312    );
8313    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8314
8315    if let Some(ref user_agent) = configuration.user_agent {
8316        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8317    }
8318    if let Some(ref token) = configuration.bearer_access_token {
8319        req_builder = req_builder.bearer_auth(token.to_owned());
8320    };
8321
8322    let req = req_builder.build()?;
8323    let resp = configuration.client.execute(req).await?;
8324
8325    let status = resp.status();
8326    let content_type = resp
8327        .headers()
8328        .get("content-type")
8329        .and_then(|v| v.to_str().ok())
8330        .unwrap_or("application/octet-stream");
8331    let content_type = super::ContentType::from(content_type);
8332
8333    if !status.is_client_error() && !status.is_server_error() {
8334        let content = resp.text().await?;
8335        match content_type {
8336            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8337            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;`"))),
8338            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;`")))),
8339        }
8340    } else {
8341        let content = resp.text().await?;
8342        let entity: Option<SourcesUserConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
8343        Err(Error::ResponseError(ResponseContent {
8344            status,
8345            content,
8346            entity,
8347        }))
8348    }
8349}
8350
8351/// User-source connection Viewset
8352pub async fn sources_user_connections_kerberos_create(
8353    configuration: &configuration::Configuration,
8354    user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest,
8355) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosCreateError>> {
8356    // add a prefix to parameters to efficiently prevent name collisions
8357    let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request;
8358
8359    let uri_str = format!("{}/sources/user_connections/kerberos/", configuration.base_path);
8360    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8361
8362    if let Some(ref user_agent) = configuration.user_agent {
8363        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8364    }
8365    if let Some(ref token) = configuration.bearer_access_token {
8366        req_builder = req_builder.bearer_auth(token.to_owned());
8367    };
8368    req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request);
8369
8370    let req = req_builder.build()?;
8371    let resp = configuration.client.execute(req).await?;
8372
8373    let status = resp.status();
8374    let content_type = resp
8375        .headers()
8376        .get("content-type")
8377        .and_then(|v| v.to_str().ok())
8378        .unwrap_or("application/octet-stream");
8379    let content_type = super::ContentType::from(content_type);
8380
8381    if !status.is_client_error() && !status.is_server_error() {
8382        let content = resp.text().await?;
8383        match content_type {
8384            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8385            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
8386            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
8387        }
8388    } else {
8389        let content = resp.text().await?;
8390        let entity: Option<SourcesUserConnectionsKerberosCreateError> = serde_json::from_str(&content).ok();
8391        Err(Error::ResponseError(ResponseContent {
8392            status,
8393            content,
8394            entity,
8395        }))
8396    }
8397}
8398
8399/// User-source connection Viewset
8400pub async fn sources_user_connections_kerberos_destroy(
8401    configuration: &configuration::Configuration,
8402    id: i32,
8403) -> Result<(), Error<SourcesUserConnectionsKerberosDestroyError>> {
8404    // add a prefix to parameters to efficiently prevent name collisions
8405    let p_path_id = id;
8406
8407    let uri_str = format!(
8408        "{}/sources/user_connections/kerberos/{id}/",
8409        configuration.base_path,
8410        id = p_path_id
8411    );
8412    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8413
8414    if let Some(ref user_agent) = configuration.user_agent {
8415        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8416    }
8417    if let Some(ref token) = configuration.bearer_access_token {
8418        req_builder = req_builder.bearer_auth(token.to_owned());
8419    };
8420
8421    let req = req_builder.build()?;
8422    let resp = configuration.client.execute(req).await?;
8423
8424    let status = resp.status();
8425
8426    if !status.is_client_error() && !status.is_server_error() {
8427        Ok(())
8428    } else {
8429        let content = resp.text().await?;
8430        let entity: Option<SourcesUserConnectionsKerberosDestroyError> = serde_json::from_str(&content).ok();
8431        Err(Error::ResponseError(ResponseContent {
8432            status,
8433            content,
8434            entity,
8435        }))
8436    }
8437}
8438
8439/// User-source connection Viewset
8440pub async fn sources_user_connections_kerberos_list(
8441    configuration: &configuration::Configuration,
8442    ordering: Option<&str>,
8443    page: Option<i32>,
8444    page_size: Option<i32>,
8445    search: Option<&str>,
8446    source__slug: Option<&str>,
8447    user: Option<i32>,
8448) -> Result<models::PaginatedUserKerberosSourceConnectionList, Error<SourcesUserConnectionsKerberosListError>> {
8449    // add a prefix to parameters to efficiently prevent name collisions
8450    let p_query_ordering = ordering;
8451    let p_query_page = page;
8452    let p_query_page_size = page_size;
8453    let p_query_search = search;
8454    let p_query_source__slug = source__slug;
8455    let p_query_user = user;
8456
8457    let uri_str = format!("{}/sources/user_connections/kerberos/", configuration.base_path);
8458    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8459
8460    if let Some(ref param_value) = p_query_ordering {
8461        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
8462    }
8463    if let Some(ref param_value) = p_query_page {
8464        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
8465    }
8466    if let Some(ref param_value) = p_query_page_size {
8467        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
8468    }
8469    if let Some(ref param_value) = p_query_search {
8470        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
8471    }
8472    if let Some(ref param_value) = p_query_source__slug {
8473        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
8474    }
8475    if let Some(ref param_value) = p_query_user {
8476        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
8477    }
8478    if let Some(ref user_agent) = configuration.user_agent {
8479        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8480    }
8481    if let Some(ref token) = configuration.bearer_access_token {
8482        req_builder = req_builder.bearer_auth(token.to_owned());
8483    };
8484
8485    let req = req_builder.build()?;
8486    let resp = configuration.client.execute(req).await?;
8487
8488    let status = resp.status();
8489    let content_type = resp
8490        .headers()
8491        .get("content-type")
8492        .and_then(|v| v.to_str().ok())
8493        .unwrap_or("application/octet-stream");
8494    let content_type = super::ContentType::from(content_type);
8495
8496    if !status.is_client_error() && !status.is_server_error() {
8497        let content = resp.text().await?;
8498        match content_type {
8499            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8500            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserKerberosSourceConnectionList`"))),
8501            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserKerberosSourceConnectionList`")))),
8502        }
8503    } else {
8504        let content = resp.text().await?;
8505        let entity: Option<SourcesUserConnectionsKerberosListError> = serde_json::from_str(&content).ok();
8506        Err(Error::ResponseError(ResponseContent {
8507            status,
8508            content,
8509            entity,
8510        }))
8511    }
8512}
8513
8514/// User-source connection Viewset
8515pub async fn sources_user_connections_kerberos_partial_update(
8516    configuration: &configuration::Configuration,
8517    id: i32,
8518    patched_user_kerberos_source_connection_request: Option<models::PatchedUserKerberosSourceConnectionRequest>,
8519) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosPartialUpdateError>> {
8520    // add a prefix to parameters to efficiently prevent name collisions
8521    let p_path_id = id;
8522    let p_body_patched_user_kerberos_source_connection_request = patched_user_kerberos_source_connection_request;
8523
8524    let uri_str = format!(
8525        "{}/sources/user_connections/kerberos/{id}/",
8526        configuration.base_path,
8527        id = p_path_id
8528    );
8529    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8530
8531    if let Some(ref user_agent) = configuration.user_agent {
8532        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8533    }
8534    if let Some(ref token) = configuration.bearer_access_token {
8535        req_builder = req_builder.bearer_auth(token.to_owned());
8536    };
8537    req_builder = req_builder.json(&p_body_patched_user_kerberos_source_connection_request);
8538
8539    let req = req_builder.build()?;
8540    let resp = configuration.client.execute(req).await?;
8541
8542    let status = resp.status();
8543    let content_type = resp
8544        .headers()
8545        .get("content-type")
8546        .and_then(|v| v.to_str().ok())
8547        .unwrap_or("application/octet-stream");
8548    let content_type = super::ContentType::from(content_type);
8549
8550    if !status.is_client_error() && !status.is_server_error() {
8551        let content = resp.text().await?;
8552        match content_type {
8553            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8554            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
8555            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
8556        }
8557    } else {
8558        let content = resp.text().await?;
8559        let entity: Option<SourcesUserConnectionsKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
8560        Err(Error::ResponseError(ResponseContent {
8561            status,
8562            content,
8563            entity,
8564        }))
8565    }
8566}
8567
8568/// User-source connection Viewset
8569pub async fn sources_user_connections_kerberos_retrieve(
8570    configuration: &configuration::Configuration,
8571    id: i32,
8572) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosRetrieveError>> {
8573    // add a prefix to parameters to efficiently prevent name collisions
8574    let p_path_id = id;
8575
8576    let uri_str = format!(
8577        "{}/sources/user_connections/kerberos/{id}/",
8578        configuration.base_path,
8579        id = p_path_id
8580    );
8581    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8582
8583    if let Some(ref user_agent) = configuration.user_agent {
8584        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8585    }
8586    if let Some(ref token) = configuration.bearer_access_token {
8587        req_builder = req_builder.bearer_auth(token.to_owned());
8588    };
8589
8590    let req = req_builder.build()?;
8591    let resp = configuration.client.execute(req).await?;
8592
8593    let status = resp.status();
8594    let content_type = resp
8595        .headers()
8596        .get("content-type")
8597        .and_then(|v| v.to_str().ok())
8598        .unwrap_or("application/octet-stream");
8599    let content_type = super::ContentType::from(content_type);
8600
8601    if !status.is_client_error() && !status.is_server_error() {
8602        let content = resp.text().await?;
8603        match content_type {
8604            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8605            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
8606            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
8607        }
8608    } else {
8609        let content = resp.text().await?;
8610        let entity: Option<SourcesUserConnectionsKerberosRetrieveError> = serde_json::from_str(&content).ok();
8611        Err(Error::ResponseError(ResponseContent {
8612            status,
8613            content,
8614            entity,
8615        }))
8616    }
8617}
8618
8619/// User-source connection Viewset
8620pub async fn sources_user_connections_kerberos_update(
8621    configuration: &configuration::Configuration,
8622    id: i32,
8623    user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest,
8624) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosUpdateError>> {
8625    // add a prefix to parameters to efficiently prevent name collisions
8626    let p_path_id = id;
8627    let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request;
8628
8629    let uri_str = format!(
8630        "{}/sources/user_connections/kerberos/{id}/",
8631        configuration.base_path,
8632        id = p_path_id
8633    );
8634    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8635
8636    if let Some(ref user_agent) = configuration.user_agent {
8637        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8638    }
8639    if let Some(ref token) = configuration.bearer_access_token {
8640        req_builder = req_builder.bearer_auth(token.to_owned());
8641    };
8642    req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request);
8643
8644    let req = req_builder.build()?;
8645    let resp = configuration.client.execute(req).await?;
8646
8647    let status = resp.status();
8648    let content_type = resp
8649        .headers()
8650        .get("content-type")
8651        .and_then(|v| v.to_str().ok())
8652        .unwrap_or("application/octet-stream");
8653    let content_type = super::ContentType::from(content_type);
8654
8655    if !status.is_client_error() && !status.is_server_error() {
8656        let content = resp.text().await?;
8657        match content_type {
8658            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8659            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
8660            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
8661        }
8662    } else {
8663        let content = resp.text().await?;
8664        let entity: Option<SourcesUserConnectionsKerberosUpdateError> = serde_json::from_str(&content).ok();
8665        Err(Error::ResponseError(ResponseContent {
8666            status,
8667            content,
8668            entity,
8669        }))
8670    }
8671}
8672
8673/// Get a list of all objects that use this object
8674pub async fn sources_user_connections_kerberos_used_by_list(
8675    configuration: &configuration::Configuration,
8676    id: i32,
8677) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsKerberosUsedByListError>> {
8678    // add a prefix to parameters to efficiently prevent name collisions
8679    let p_path_id = id;
8680
8681    let uri_str = format!(
8682        "{}/sources/user_connections/kerberos/{id}/used_by/",
8683        configuration.base_path,
8684        id = p_path_id
8685    );
8686    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8687
8688    if let Some(ref user_agent) = configuration.user_agent {
8689        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8690    }
8691    if let Some(ref token) = configuration.bearer_access_token {
8692        req_builder = req_builder.bearer_auth(token.to_owned());
8693    };
8694
8695    let req = req_builder.build()?;
8696    let resp = configuration.client.execute(req).await?;
8697
8698    let status = resp.status();
8699    let content_type = resp
8700        .headers()
8701        .get("content-type")
8702        .and_then(|v| v.to_str().ok())
8703        .unwrap_or("application/octet-stream");
8704    let content_type = super::ContentType::from(content_type);
8705
8706    if !status.is_client_error() && !status.is_server_error() {
8707        let content = resp.text().await?;
8708        match content_type {
8709            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8710            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;`"))),
8711            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;`")))),
8712        }
8713    } else {
8714        let content = resp.text().await?;
8715        let entity: Option<SourcesUserConnectionsKerberosUsedByListError> = serde_json::from_str(&content).ok();
8716        Err(Error::ResponseError(ResponseContent {
8717            status,
8718            content,
8719            entity,
8720        }))
8721    }
8722}
8723
8724/// User-source connection Viewset
8725pub async fn sources_user_connections_ldap_create(
8726    configuration: &configuration::Configuration,
8727    user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest,
8728) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapCreateError>> {
8729    // add a prefix to parameters to efficiently prevent name collisions
8730    let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request;
8731
8732    let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path);
8733    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8734
8735    if let Some(ref user_agent) = configuration.user_agent {
8736        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8737    }
8738    if let Some(ref token) = configuration.bearer_access_token {
8739        req_builder = req_builder.bearer_auth(token.to_owned());
8740    };
8741    req_builder = req_builder.json(&p_body_user_ldap_source_connection_request);
8742
8743    let req = req_builder.build()?;
8744    let resp = configuration.client.execute(req).await?;
8745
8746    let status = resp.status();
8747    let content_type = resp
8748        .headers()
8749        .get("content-type")
8750        .and_then(|v| v.to_str().ok())
8751        .unwrap_or("application/octet-stream");
8752    let content_type = super::ContentType::from(content_type);
8753
8754    if !status.is_client_error() && !status.is_server_error() {
8755        let content = resp.text().await?;
8756        match content_type {
8757            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8758            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
8759            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
8760        }
8761    } else {
8762        let content = resp.text().await?;
8763        let entity: Option<SourcesUserConnectionsLdapCreateError> = serde_json::from_str(&content).ok();
8764        Err(Error::ResponseError(ResponseContent {
8765            status,
8766            content,
8767            entity,
8768        }))
8769    }
8770}
8771
8772/// User-source connection Viewset
8773pub async fn sources_user_connections_ldap_destroy(
8774    configuration: &configuration::Configuration,
8775    id: i32,
8776) -> Result<(), Error<SourcesUserConnectionsLdapDestroyError>> {
8777    // add a prefix to parameters to efficiently prevent name collisions
8778    let p_path_id = id;
8779
8780    let uri_str = format!(
8781        "{}/sources/user_connections/ldap/{id}/",
8782        configuration.base_path,
8783        id = p_path_id
8784    );
8785    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8786
8787    if let Some(ref user_agent) = configuration.user_agent {
8788        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8789    }
8790    if let Some(ref token) = configuration.bearer_access_token {
8791        req_builder = req_builder.bearer_auth(token.to_owned());
8792    };
8793
8794    let req = req_builder.build()?;
8795    let resp = configuration.client.execute(req).await?;
8796
8797    let status = resp.status();
8798
8799    if !status.is_client_error() && !status.is_server_error() {
8800        Ok(())
8801    } else {
8802        let content = resp.text().await?;
8803        let entity: Option<SourcesUserConnectionsLdapDestroyError> = serde_json::from_str(&content).ok();
8804        Err(Error::ResponseError(ResponseContent {
8805            status,
8806            content,
8807            entity,
8808        }))
8809    }
8810}
8811
8812/// User-source connection Viewset
8813pub async fn sources_user_connections_ldap_list(
8814    configuration: &configuration::Configuration,
8815    ordering: Option<&str>,
8816    page: Option<i32>,
8817    page_size: Option<i32>,
8818    search: Option<&str>,
8819    source__slug: Option<&str>,
8820    user: Option<i32>,
8821) -> Result<models::PaginatedUserLdapSourceConnectionList, Error<SourcesUserConnectionsLdapListError>> {
8822    // add a prefix to parameters to efficiently prevent name collisions
8823    let p_query_ordering = ordering;
8824    let p_query_page = page;
8825    let p_query_page_size = page_size;
8826    let p_query_search = search;
8827    let p_query_source__slug = source__slug;
8828    let p_query_user = user;
8829
8830    let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path);
8831    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8832
8833    if let Some(ref param_value) = p_query_ordering {
8834        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
8835    }
8836    if let Some(ref param_value) = p_query_page {
8837        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
8838    }
8839    if let Some(ref param_value) = p_query_page_size {
8840        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
8841    }
8842    if let Some(ref param_value) = p_query_search {
8843        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
8844    }
8845    if let Some(ref param_value) = p_query_source__slug {
8846        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
8847    }
8848    if let Some(ref param_value) = p_query_user {
8849        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
8850    }
8851    if let Some(ref user_agent) = configuration.user_agent {
8852        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8853    }
8854    if let Some(ref token) = configuration.bearer_access_token {
8855        req_builder = req_builder.bearer_auth(token.to_owned());
8856    };
8857
8858    let req = req_builder.build()?;
8859    let resp = configuration.client.execute(req).await?;
8860
8861    let status = resp.status();
8862    let content_type = resp
8863        .headers()
8864        .get("content-type")
8865        .and_then(|v| v.to_str().ok())
8866        .unwrap_or("application/octet-stream");
8867    let content_type = super::ContentType::from(content_type);
8868
8869    if !status.is_client_error() && !status.is_server_error() {
8870        let content = resp.text().await?;
8871        match content_type {
8872            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8873            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserLdapSourceConnectionList`"))),
8874            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserLdapSourceConnectionList`")))),
8875        }
8876    } else {
8877        let content = resp.text().await?;
8878        let entity: Option<SourcesUserConnectionsLdapListError> = serde_json::from_str(&content).ok();
8879        Err(Error::ResponseError(ResponseContent {
8880            status,
8881            content,
8882            entity,
8883        }))
8884    }
8885}
8886
8887/// User-source connection Viewset
8888pub async fn sources_user_connections_ldap_partial_update(
8889    configuration: &configuration::Configuration,
8890    id: i32,
8891    patched_user_ldap_source_connection_request: Option<models::PatchedUserLdapSourceConnectionRequest>,
8892) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapPartialUpdateError>> {
8893    // add a prefix to parameters to efficiently prevent name collisions
8894    let p_path_id = id;
8895    let p_body_patched_user_ldap_source_connection_request = patched_user_ldap_source_connection_request;
8896
8897    let uri_str = format!(
8898        "{}/sources/user_connections/ldap/{id}/",
8899        configuration.base_path,
8900        id = p_path_id
8901    );
8902    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8903
8904    if let Some(ref user_agent) = configuration.user_agent {
8905        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8906    }
8907    if let Some(ref token) = configuration.bearer_access_token {
8908        req_builder = req_builder.bearer_auth(token.to_owned());
8909    };
8910    req_builder = req_builder.json(&p_body_patched_user_ldap_source_connection_request);
8911
8912    let req = req_builder.build()?;
8913    let resp = configuration.client.execute(req).await?;
8914
8915    let status = resp.status();
8916    let content_type = resp
8917        .headers()
8918        .get("content-type")
8919        .and_then(|v| v.to_str().ok())
8920        .unwrap_or("application/octet-stream");
8921    let content_type = super::ContentType::from(content_type);
8922
8923    if !status.is_client_error() && !status.is_server_error() {
8924        let content = resp.text().await?;
8925        match content_type {
8926            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8927            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
8928            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
8929        }
8930    } else {
8931        let content = resp.text().await?;
8932        let entity: Option<SourcesUserConnectionsLdapPartialUpdateError> = serde_json::from_str(&content).ok();
8933        Err(Error::ResponseError(ResponseContent {
8934            status,
8935            content,
8936            entity,
8937        }))
8938    }
8939}
8940
8941/// User-source connection Viewset
8942pub async fn sources_user_connections_ldap_retrieve(
8943    configuration: &configuration::Configuration,
8944    id: i32,
8945) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapRetrieveError>> {
8946    // add a prefix to parameters to efficiently prevent name collisions
8947    let p_path_id = id;
8948
8949    let uri_str = format!(
8950        "{}/sources/user_connections/ldap/{id}/",
8951        configuration.base_path,
8952        id = p_path_id
8953    );
8954    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8955
8956    if let Some(ref user_agent) = configuration.user_agent {
8957        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8958    }
8959    if let Some(ref token) = configuration.bearer_access_token {
8960        req_builder = req_builder.bearer_auth(token.to_owned());
8961    };
8962
8963    let req = req_builder.build()?;
8964    let resp = configuration.client.execute(req).await?;
8965
8966    let status = resp.status();
8967    let content_type = resp
8968        .headers()
8969        .get("content-type")
8970        .and_then(|v| v.to_str().ok())
8971        .unwrap_or("application/octet-stream");
8972    let content_type = super::ContentType::from(content_type);
8973
8974    if !status.is_client_error() && !status.is_server_error() {
8975        let content = resp.text().await?;
8976        match content_type {
8977            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8978            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
8979            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
8980        }
8981    } else {
8982        let content = resp.text().await?;
8983        let entity: Option<SourcesUserConnectionsLdapRetrieveError> = serde_json::from_str(&content).ok();
8984        Err(Error::ResponseError(ResponseContent {
8985            status,
8986            content,
8987            entity,
8988        }))
8989    }
8990}
8991
8992/// User-source connection Viewset
8993pub async fn sources_user_connections_ldap_update(
8994    configuration: &configuration::Configuration,
8995    id: i32,
8996    user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest,
8997) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapUpdateError>> {
8998    // add a prefix to parameters to efficiently prevent name collisions
8999    let p_path_id = id;
9000    let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request;
9001
9002    let uri_str = format!(
9003        "{}/sources/user_connections/ldap/{id}/",
9004        configuration.base_path,
9005        id = p_path_id
9006    );
9007    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9008
9009    if let Some(ref user_agent) = configuration.user_agent {
9010        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9011    }
9012    if let Some(ref token) = configuration.bearer_access_token {
9013        req_builder = req_builder.bearer_auth(token.to_owned());
9014    };
9015    req_builder = req_builder.json(&p_body_user_ldap_source_connection_request);
9016
9017    let req = req_builder.build()?;
9018    let resp = configuration.client.execute(req).await?;
9019
9020    let status = resp.status();
9021    let content_type = resp
9022        .headers()
9023        .get("content-type")
9024        .and_then(|v| v.to_str().ok())
9025        .unwrap_or("application/octet-stream");
9026    let content_type = super::ContentType::from(content_type);
9027
9028    if !status.is_client_error() && !status.is_server_error() {
9029        let content = resp.text().await?;
9030        match content_type {
9031            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9032            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9033            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
9034        }
9035    } else {
9036        let content = resp.text().await?;
9037        let entity: Option<SourcesUserConnectionsLdapUpdateError> = serde_json::from_str(&content).ok();
9038        Err(Error::ResponseError(ResponseContent {
9039            status,
9040            content,
9041            entity,
9042        }))
9043    }
9044}
9045
9046/// Get a list of all objects that use this object
9047pub async fn sources_user_connections_ldap_used_by_list(
9048    configuration: &configuration::Configuration,
9049    id: i32,
9050) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsLdapUsedByListError>> {
9051    // add a prefix to parameters to efficiently prevent name collisions
9052    let p_path_id = id;
9053
9054    let uri_str = format!(
9055        "{}/sources/user_connections/ldap/{id}/used_by/",
9056        configuration.base_path,
9057        id = p_path_id
9058    );
9059    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9060
9061    if let Some(ref user_agent) = configuration.user_agent {
9062        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9063    }
9064    if let Some(ref token) = configuration.bearer_access_token {
9065        req_builder = req_builder.bearer_auth(token.to_owned());
9066    };
9067
9068    let req = req_builder.build()?;
9069    let resp = configuration.client.execute(req).await?;
9070
9071    let status = resp.status();
9072    let content_type = resp
9073        .headers()
9074        .get("content-type")
9075        .and_then(|v| v.to_str().ok())
9076        .unwrap_or("application/octet-stream");
9077    let content_type = super::ContentType::from(content_type);
9078
9079    if !status.is_client_error() && !status.is_server_error() {
9080        let content = resp.text().await?;
9081        match content_type {
9082            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9083            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;`"))),
9084            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;`")))),
9085        }
9086    } else {
9087        let content = resp.text().await?;
9088        let entity: Option<SourcesUserConnectionsLdapUsedByListError> = serde_json::from_str(&content).ok();
9089        Err(Error::ResponseError(ResponseContent {
9090            status,
9091            content,
9092            entity,
9093        }))
9094    }
9095}
9096
9097/// User-source connection Viewset
9098pub async fn sources_user_connections_oauth_create(
9099    configuration: &configuration::Configuration,
9100    user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest,
9101) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthCreateError>> {
9102    // add a prefix to parameters to efficiently prevent name collisions
9103    let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request;
9104
9105    let uri_str = format!("{}/sources/user_connections/oauth/", configuration.base_path);
9106    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9107
9108    if let Some(ref user_agent) = configuration.user_agent {
9109        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9110    }
9111    if let Some(ref token) = configuration.bearer_access_token {
9112        req_builder = req_builder.bearer_auth(token.to_owned());
9113    };
9114    req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request);
9115
9116    let req = req_builder.build()?;
9117    let resp = configuration.client.execute(req).await?;
9118
9119    let status = resp.status();
9120    let content_type = resp
9121        .headers()
9122        .get("content-type")
9123        .and_then(|v| v.to_str().ok())
9124        .unwrap_or("application/octet-stream");
9125    let content_type = super::ContentType::from(content_type);
9126
9127    if !status.is_client_error() && !status.is_server_error() {
9128        let content = resp.text().await?;
9129        match content_type {
9130            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9131            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
9132            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
9133        }
9134    } else {
9135        let content = resp.text().await?;
9136        let entity: Option<SourcesUserConnectionsOauthCreateError> = serde_json::from_str(&content).ok();
9137        Err(Error::ResponseError(ResponseContent {
9138            status,
9139            content,
9140            entity,
9141        }))
9142    }
9143}
9144
9145/// User-source connection Viewset
9146pub async fn sources_user_connections_oauth_destroy(
9147    configuration: &configuration::Configuration,
9148    id: i32,
9149) -> Result<(), Error<SourcesUserConnectionsOauthDestroyError>> {
9150    // add a prefix to parameters to efficiently prevent name collisions
9151    let p_path_id = id;
9152
9153    let uri_str = format!(
9154        "{}/sources/user_connections/oauth/{id}/",
9155        configuration.base_path,
9156        id = p_path_id
9157    );
9158    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9159
9160    if let Some(ref user_agent) = configuration.user_agent {
9161        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9162    }
9163    if let Some(ref token) = configuration.bearer_access_token {
9164        req_builder = req_builder.bearer_auth(token.to_owned());
9165    };
9166
9167    let req = req_builder.build()?;
9168    let resp = configuration.client.execute(req).await?;
9169
9170    let status = resp.status();
9171
9172    if !status.is_client_error() && !status.is_server_error() {
9173        Ok(())
9174    } else {
9175        let content = resp.text().await?;
9176        let entity: Option<SourcesUserConnectionsOauthDestroyError> = serde_json::from_str(&content).ok();
9177        Err(Error::ResponseError(ResponseContent {
9178            status,
9179            content,
9180            entity,
9181        }))
9182    }
9183}
9184
9185/// User-source connection Viewset
9186pub async fn sources_user_connections_oauth_list(
9187    configuration: &configuration::Configuration,
9188    ordering: Option<&str>,
9189    page: Option<i32>,
9190    page_size: Option<i32>,
9191    search: Option<&str>,
9192    source__slug: Option<&str>,
9193    user: Option<i32>,
9194) -> Result<models::PaginatedUserOAuthSourceConnectionList, Error<SourcesUserConnectionsOauthListError>> {
9195    // add a prefix to parameters to efficiently prevent name collisions
9196    let p_query_ordering = ordering;
9197    let p_query_page = page;
9198    let p_query_page_size = page_size;
9199    let p_query_search = search;
9200    let p_query_source__slug = source__slug;
9201    let p_query_user = user;
9202
9203    let uri_str = format!("{}/sources/user_connections/oauth/", configuration.base_path);
9204    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9205
9206    if let Some(ref param_value) = p_query_ordering {
9207        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
9208    }
9209    if let Some(ref param_value) = p_query_page {
9210        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
9211    }
9212    if let Some(ref param_value) = p_query_page_size {
9213        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
9214    }
9215    if let Some(ref param_value) = p_query_search {
9216        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
9217    }
9218    if let Some(ref param_value) = p_query_source__slug {
9219        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
9220    }
9221    if let Some(ref param_value) = p_query_user {
9222        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
9223    }
9224    if let Some(ref user_agent) = configuration.user_agent {
9225        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9226    }
9227    if let Some(ref token) = configuration.bearer_access_token {
9228        req_builder = req_builder.bearer_auth(token.to_owned());
9229    };
9230
9231    let req = req_builder.build()?;
9232    let resp = configuration.client.execute(req).await?;
9233
9234    let status = resp.status();
9235    let content_type = resp
9236        .headers()
9237        .get("content-type")
9238        .and_then(|v| v.to_str().ok())
9239        .unwrap_or("application/octet-stream");
9240    let content_type = super::ContentType::from(content_type);
9241
9242    if !status.is_client_error() && !status.is_server_error() {
9243        let content = resp.text().await?;
9244        match content_type {
9245            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9246            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserOAuthSourceConnectionList`"))),
9247            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserOAuthSourceConnectionList`")))),
9248        }
9249    } else {
9250        let content = resp.text().await?;
9251        let entity: Option<SourcesUserConnectionsOauthListError> = serde_json::from_str(&content).ok();
9252        Err(Error::ResponseError(ResponseContent {
9253            status,
9254            content,
9255            entity,
9256        }))
9257    }
9258}
9259
9260/// User-source connection Viewset
9261pub async fn sources_user_connections_oauth_partial_update(
9262    configuration: &configuration::Configuration,
9263    id: i32,
9264    patched_user_o_auth_source_connection_request: Option<models::PatchedUserOAuthSourceConnectionRequest>,
9265) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthPartialUpdateError>> {
9266    // add a prefix to parameters to efficiently prevent name collisions
9267    let p_path_id = id;
9268    let p_body_patched_user_o_auth_source_connection_request = patched_user_o_auth_source_connection_request;
9269
9270    let uri_str = format!(
9271        "{}/sources/user_connections/oauth/{id}/",
9272        configuration.base_path,
9273        id = p_path_id
9274    );
9275    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9276
9277    if let Some(ref user_agent) = configuration.user_agent {
9278        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9279    }
9280    if let Some(ref token) = configuration.bearer_access_token {
9281        req_builder = req_builder.bearer_auth(token.to_owned());
9282    };
9283    req_builder = req_builder.json(&p_body_patched_user_o_auth_source_connection_request);
9284
9285    let req = req_builder.build()?;
9286    let resp = configuration.client.execute(req).await?;
9287
9288    let status = resp.status();
9289    let content_type = resp
9290        .headers()
9291        .get("content-type")
9292        .and_then(|v| v.to_str().ok())
9293        .unwrap_or("application/octet-stream");
9294    let content_type = super::ContentType::from(content_type);
9295
9296    if !status.is_client_error() && !status.is_server_error() {
9297        let content = resp.text().await?;
9298        match content_type {
9299            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9300            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
9301            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
9302        }
9303    } else {
9304        let content = resp.text().await?;
9305        let entity: Option<SourcesUserConnectionsOauthPartialUpdateError> = serde_json::from_str(&content).ok();
9306        Err(Error::ResponseError(ResponseContent {
9307            status,
9308            content,
9309            entity,
9310        }))
9311    }
9312}
9313
9314/// User-source connection Viewset
9315pub async fn sources_user_connections_oauth_retrieve(
9316    configuration: &configuration::Configuration,
9317    id: i32,
9318) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthRetrieveError>> {
9319    // add a prefix to parameters to efficiently prevent name collisions
9320    let p_path_id = id;
9321
9322    let uri_str = format!(
9323        "{}/sources/user_connections/oauth/{id}/",
9324        configuration.base_path,
9325        id = p_path_id
9326    );
9327    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9328
9329    if let Some(ref user_agent) = configuration.user_agent {
9330        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9331    }
9332    if let Some(ref token) = configuration.bearer_access_token {
9333        req_builder = req_builder.bearer_auth(token.to_owned());
9334    };
9335
9336    let req = req_builder.build()?;
9337    let resp = configuration.client.execute(req).await?;
9338
9339    let status = resp.status();
9340    let content_type = resp
9341        .headers()
9342        .get("content-type")
9343        .and_then(|v| v.to_str().ok())
9344        .unwrap_or("application/octet-stream");
9345    let content_type = super::ContentType::from(content_type);
9346
9347    if !status.is_client_error() && !status.is_server_error() {
9348        let content = resp.text().await?;
9349        match content_type {
9350            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9351            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
9352            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
9353        }
9354    } else {
9355        let content = resp.text().await?;
9356        let entity: Option<SourcesUserConnectionsOauthRetrieveError> = serde_json::from_str(&content).ok();
9357        Err(Error::ResponseError(ResponseContent {
9358            status,
9359            content,
9360            entity,
9361        }))
9362    }
9363}
9364
9365/// User-source connection Viewset
9366pub async fn sources_user_connections_oauth_update(
9367    configuration: &configuration::Configuration,
9368    id: i32,
9369    user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest,
9370) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthUpdateError>> {
9371    // add a prefix to parameters to efficiently prevent name collisions
9372    let p_path_id = id;
9373    let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request;
9374
9375    let uri_str = format!(
9376        "{}/sources/user_connections/oauth/{id}/",
9377        configuration.base_path,
9378        id = p_path_id
9379    );
9380    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9381
9382    if let Some(ref user_agent) = configuration.user_agent {
9383        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9384    }
9385    if let Some(ref token) = configuration.bearer_access_token {
9386        req_builder = req_builder.bearer_auth(token.to_owned());
9387    };
9388    req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request);
9389
9390    let req = req_builder.build()?;
9391    let resp = configuration.client.execute(req).await?;
9392
9393    let status = resp.status();
9394    let content_type = resp
9395        .headers()
9396        .get("content-type")
9397        .and_then(|v| v.to_str().ok())
9398        .unwrap_or("application/octet-stream");
9399    let content_type = super::ContentType::from(content_type);
9400
9401    if !status.is_client_error() && !status.is_server_error() {
9402        let content = resp.text().await?;
9403        match content_type {
9404            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9405            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
9406            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
9407        }
9408    } else {
9409        let content = resp.text().await?;
9410        let entity: Option<SourcesUserConnectionsOauthUpdateError> = serde_json::from_str(&content).ok();
9411        Err(Error::ResponseError(ResponseContent {
9412            status,
9413            content,
9414            entity,
9415        }))
9416    }
9417}
9418
9419/// Get a list of all objects that use this object
9420pub async fn sources_user_connections_oauth_used_by_list(
9421    configuration: &configuration::Configuration,
9422    id: i32,
9423) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsOauthUsedByListError>> {
9424    // add a prefix to parameters to efficiently prevent name collisions
9425    let p_path_id = id;
9426
9427    let uri_str = format!(
9428        "{}/sources/user_connections/oauth/{id}/used_by/",
9429        configuration.base_path,
9430        id = p_path_id
9431    );
9432    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9433
9434    if let Some(ref user_agent) = configuration.user_agent {
9435        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9436    }
9437    if let Some(ref token) = configuration.bearer_access_token {
9438        req_builder = req_builder.bearer_auth(token.to_owned());
9439    };
9440
9441    let req = req_builder.build()?;
9442    let resp = configuration.client.execute(req).await?;
9443
9444    let status = resp.status();
9445    let content_type = resp
9446        .headers()
9447        .get("content-type")
9448        .and_then(|v| v.to_str().ok())
9449        .unwrap_or("application/octet-stream");
9450    let content_type = super::ContentType::from(content_type);
9451
9452    if !status.is_client_error() && !status.is_server_error() {
9453        let content = resp.text().await?;
9454        match content_type {
9455            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9456            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;`"))),
9457            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;`")))),
9458        }
9459    } else {
9460        let content = resp.text().await?;
9461        let entity: Option<SourcesUserConnectionsOauthUsedByListError> = serde_json::from_str(&content).ok();
9462        Err(Error::ResponseError(ResponseContent {
9463            status,
9464            content,
9465            entity,
9466        }))
9467    }
9468}
9469
9470/// User-source connection Viewset
9471pub async fn sources_user_connections_plex_create(
9472    configuration: &configuration::Configuration,
9473    user_plex_source_connection_request: models::UserPlexSourceConnectionRequest,
9474) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexCreateError>> {
9475    // add a prefix to parameters to efficiently prevent name collisions
9476    let p_body_user_plex_source_connection_request = user_plex_source_connection_request;
9477
9478    let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path);
9479    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9480
9481    if let Some(ref user_agent) = configuration.user_agent {
9482        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9483    }
9484    if let Some(ref token) = configuration.bearer_access_token {
9485        req_builder = req_builder.bearer_auth(token.to_owned());
9486    };
9487    req_builder = req_builder.json(&p_body_user_plex_source_connection_request);
9488
9489    let req = req_builder.build()?;
9490    let resp = configuration.client.execute(req).await?;
9491
9492    let status = resp.status();
9493    let content_type = resp
9494        .headers()
9495        .get("content-type")
9496        .and_then(|v| v.to_str().ok())
9497        .unwrap_or("application/octet-stream");
9498    let content_type = super::ContentType::from(content_type);
9499
9500    if !status.is_client_error() && !status.is_server_error() {
9501        let content = resp.text().await?;
9502        match content_type {
9503            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9504            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
9505            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
9506        }
9507    } else {
9508        let content = resp.text().await?;
9509        let entity: Option<SourcesUserConnectionsPlexCreateError> = serde_json::from_str(&content).ok();
9510        Err(Error::ResponseError(ResponseContent {
9511            status,
9512            content,
9513            entity,
9514        }))
9515    }
9516}
9517
9518/// User-source connection Viewset
9519pub async fn sources_user_connections_plex_destroy(
9520    configuration: &configuration::Configuration,
9521    id: i32,
9522) -> Result<(), Error<SourcesUserConnectionsPlexDestroyError>> {
9523    // add a prefix to parameters to efficiently prevent name collisions
9524    let p_path_id = id;
9525
9526    let uri_str = format!(
9527        "{}/sources/user_connections/plex/{id}/",
9528        configuration.base_path,
9529        id = p_path_id
9530    );
9531    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9532
9533    if let Some(ref user_agent) = configuration.user_agent {
9534        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9535    }
9536    if let Some(ref token) = configuration.bearer_access_token {
9537        req_builder = req_builder.bearer_auth(token.to_owned());
9538    };
9539
9540    let req = req_builder.build()?;
9541    let resp = configuration.client.execute(req).await?;
9542
9543    let status = resp.status();
9544
9545    if !status.is_client_error() && !status.is_server_error() {
9546        Ok(())
9547    } else {
9548        let content = resp.text().await?;
9549        let entity: Option<SourcesUserConnectionsPlexDestroyError> = serde_json::from_str(&content).ok();
9550        Err(Error::ResponseError(ResponseContent {
9551            status,
9552            content,
9553            entity,
9554        }))
9555    }
9556}
9557
9558/// User-source connection Viewset
9559pub async fn sources_user_connections_plex_list(
9560    configuration: &configuration::Configuration,
9561    ordering: Option<&str>,
9562    page: Option<i32>,
9563    page_size: Option<i32>,
9564    search: Option<&str>,
9565    source__slug: Option<&str>,
9566    user: Option<i32>,
9567) -> Result<models::PaginatedUserPlexSourceConnectionList, Error<SourcesUserConnectionsPlexListError>> {
9568    // add a prefix to parameters to efficiently prevent name collisions
9569    let p_query_ordering = ordering;
9570    let p_query_page = page;
9571    let p_query_page_size = page_size;
9572    let p_query_search = search;
9573    let p_query_source__slug = source__slug;
9574    let p_query_user = user;
9575
9576    let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path);
9577    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9578
9579    if let Some(ref param_value) = p_query_ordering {
9580        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
9581    }
9582    if let Some(ref param_value) = p_query_page {
9583        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
9584    }
9585    if let Some(ref param_value) = p_query_page_size {
9586        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
9587    }
9588    if let Some(ref param_value) = p_query_search {
9589        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
9590    }
9591    if let Some(ref param_value) = p_query_source__slug {
9592        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
9593    }
9594    if let Some(ref param_value) = p_query_user {
9595        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
9596    }
9597    if let Some(ref user_agent) = configuration.user_agent {
9598        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9599    }
9600    if let Some(ref token) = configuration.bearer_access_token {
9601        req_builder = req_builder.bearer_auth(token.to_owned());
9602    };
9603
9604    let req = req_builder.build()?;
9605    let resp = configuration.client.execute(req).await?;
9606
9607    let status = resp.status();
9608    let content_type = resp
9609        .headers()
9610        .get("content-type")
9611        .and_then(|v| v.to_str().ok())
9612        .unwrap_or("application/octet-stream");
9613    let content_type = super::ContentType::from(content_type);
9614
9615    if !status.is_client_error() && !status.is_server_error() {
9616        let content = resp.text().await?;
9617        match content_type {
9618            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9619            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserPlexSourceConnectionList`"))),
9620            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserPlexSourceConnectionList`")))),
9621        }
9622    } else {
9623        let content = resp.text().await?;
9624        let entity: Option<SourcesUserConnectionsPlexListError> = serde_json::from_str(&content).ok();
9625        Err(Error::ResponseError(ResponseContent {
9626            status,
9627            content,
9628            entity,
9629        }))
9630    }
9631}
9632
9633/// User-source connection Viewset
9634pub async fn sources_user_connections_plex_partial_update(
9635    configuration: &configuration::Configuration,
9636    id: i32,
9637    patched_user_plex_source_connection_request: Option<models::PatchedUserPlexSourceConnectionRequest>,
9638) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexPartialUpdateError>> {
9639    // add a prefix to parameters to efficiently prevent name collisions
9640    let p_path_id = id;
9641    let p_body_patched_user_plex_source_connection_request = patched_user_plex_source_connection_request;
9642
9643    let uri_str = format!(
9644        "{}/sources/user_connections/plex/{id}/",
9645        configuration.base_path,
9646        id = p_path_id
9647    );
9648    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9649
9650    if let Some(ref user_agent) = configuration.user_agent {
9651        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9652    }
9653    if let Some(ref token) = configuration.bearer_access_token {
9654        req_builder = req_builder.bearer_auth(token.to_owned());
9655    };
9656    req_builder = req_builder.json(&p_body_patched_user_plex_source_connection_request);
9657
9658    let req = req_builder.build()?;
9659    let resp = configuration.client.execute(req).await?;
9660
9661    let status = resp.status();
9662    let content_type = resp
9663        .headers()
9664        .get("content-type")
9665        .and_then(|v| v.to_str().ok())
9666        .unwrap_or("application/octet-stream");
9667    let content_type = super::ContentType::from(content_type);
9668
9669    if !status.is_client_error() && !status.is_server_error() {
9670        let content = resp.text().await?;
9671        match content_type {
9672            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9673            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
9674            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
9675        }
9676    } else {
9677        let content = resp.text().await?;
9678        let entity: Option<SourcesUserConnectionsPlexPartialUpdateError> = serde_json::from_str(&content).ok();
9679        Err(Error::ResponseError(ResponseContent {
9680            status,
9681            content,
9682            entity,
9683        }))
9684    }
9685}
9686
9687/// User-source connection Viewset
9688pub async fn sources_user_connections_plex_retrieve(
9689    configuration: &configuration::Configuration,
9690    id: i32,
9691) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexRetrieveError>> {
9692    // add a prefix to parameters to efficiently prevent name collisions
9693    let p_path_id = id;
9694
9695    let uri_str = format!(
9696        "{}/sources/user_connections/plex/{id}/",
9697        configuration.base_path,
9698        id = p_path_id
9699    );
9700    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9701
9702    if let Some(ref user_agent) = configuration.user_agent {
9703        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9704    }
9705    if let Some(ref token) = configuration.bearer_access_token {
9706        req_builder = req_builder.bearer_auth(token.to_owned());
9707    };
9708
9709    let req = req_builder.build()?;
9710    let resp = configuration.client.execute(req).await?;
9711
9712    let status = resp.status();
9713    let content_type = resp
9714        .headers()
9715        .get("content-type")
9716        .and_then(|v| v.to_str().ok())
9717        .unwrap_or("application/octet-stream");
9718    let content_type = super::ContentType::from(content_type);
9719
9720    if !status.is_client_error() && !status.is_server_error() {
9721        let content = resp.text().await?;
9722        match content_type {
9723            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9724            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
9725            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
9726        }
9727    } else {
9728        let content = resp.text().await?;
9729        let entity: Option<SourcesUserConnectionsPlexRetrieveError> = serde_json::from_str(&content).ok();
9730        Err(Error::ResponseError(ResponseContent {
9731            status,
9732            content,
9733            entity,
9734        }))
9735    }
9736}
9737
9738/// User-source connection Viewset
9739pub async fn sources_user_connections_plex_update(
9740    configuration: &configuration::Configuration,
9741    id: i32,
9742    user_plex_source_connection_request: models::UserPlexSourceConnectionRequest,
9743) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexUpdateError>> {
9744    // add a prefix to parameters to efficiently prevent name collisions
9745    let p_path_id = id;
9746    let p_body_user_plex_source_connection_request = user_plex_source_connection_request;
9747
9748    let uri_str = format!(
9749        "{}/sources/user_connections/plex/{id}/",
9750        configuration.base_path,
9751        id = p_path_id
9752    );
9753    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9754
9755    if let Some(ref user_agent) = configuration.user_agent {
9756        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9757    }
9758    if let Some(ref token) = configuration.bearer_access_token {
9759        req_builder = req_builder.bearer_auth(token.to_owned());
9760    };
9761    req_builder = req_builder.json(&p_body_user_plex_source_connection_request);
9762
9763    let req = req_builder.build()?;
9764    let resp = configuration.client.execute(req).await?;
9765
9766    let status = resp.status();
9767    let content_type = resp
9768        .headers()
9769        .get("content-type")
9770        .and_then(|v| v.to_str().ok())
9771        .unwrap_or("application/octet-stream");
9772    let content_type = super::ContentType::from(content_type);
9773
9774    if !status.is_client_error() && !status.is_server_error() {
9775        let content = resp.text().await?;
9776        match content_type {
9777            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9778            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
9779            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
9780        }
9781    } else {
9782        let content = resp.text().await?;
9783        let entity: Option<SourcesUserConnectionsPlexUpdateError> = serde_json::from_str(&content).ok();
9784        Err(Error::ResponseError(ResponseContent {
9785            status,
9786            content,
9787            entity,
9788        }))
9789    }
9790}
9791
9792/// Get a list of all objects that use this object
9793pub async fn sources_user_connections_plex_used_by_list(
9794    configuration: &configuration::Configuration,
9795    id: i32,
9796) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsPlexUsedByListError>> {
9797    // add a prefix to parameters to efficiently prevent name collisions
9798    let p_path_id = id;
9799
9800    let uri_str = format!(
9801        "{}/sources/user_connections/plex/{id}/used_by/",
9802        configuration.base_path,
9803        id = p_path_id
9804    );
9805    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9806
9807    if let Some(ref user_agent) = configuration.user_agent {
9808        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9809    }
9810    if let Some(ref token) = configuration.bearer_access_token {
9811        req_builder = req_builder.bearer_auth(token.to_owned());
9812    };
9813
9814    let req = req_builder.build()?;
9815    let resp = configuration.client.execute(req).await?;
9816
9817    let status = resp.status();
9818    let content_type = resp
9819        .headers()
9820        .get("content-type")
9821        .and_then(|v| v.to_str().ok())
9822        .unwrap_or("application/octet-stream");
9823    let content_type = super::ContentType::from(content_type);
9824
9825    if !status.is_client_error() && !status.is_server_error() {
9826        let content = resp.text().await?;
9827        match content_type {
9828            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9829            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;`"))),
9830            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;`")))),
9831        }
9832    } else {
9833        let content = resp.text().await?;
9834        let entity: Option<SourcesUserConnectionsPlexUsedByListError> = serde_json::from_str(&content).ok();
9835        Err(Error::ResponseError(ResponseContent {
9836            status,
9837            content,
9838            entity,
9839        }))
9840    }
9841}
9842
9843/// User-source connection Viewset
9844pub async fn sources_user_connections_saml_create(
9845    configuration: &configuration::Configuration,
9846    user_saml_source_connection_request: models::UserSamlSourceConnectionRequest,
9847) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlCreateError>> {
9848    // add a prefix to parameters to efficiently prevent name collisions
9849    let p_body_user_saml_source_connection_request = user_saml_source_connection_request;
9850
9851    let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path);
9852    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9853
9854    if let Some(ref user_agent) = configuration.user_agent {
9855        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9856    }
9857    if let Some(ref token) = configuration.bearer_access_token {
9858        req_builder = req_builder.bearer_auth(token.to_owned());
9859    };
9860    req_builder = req_builder.json(&p_body_user_saml_source_connection_request);
9861
9862    let req = req_builder.build()?;
9863    let resp = configuration.client.execute(req).await?;
9864
9865    let status = resp.status();
9866    let content_type = resp
9867        .headers()
9868        .get("content-type")
9869        .and_then(|v| v.to_str().ok())
9870        .unwrap_or("application/octet-stream");
9871    let content_type = super::ContentType::from(content_type);
9872
9873    if !status.is_client_error() && !status.is_server_error() {
9874        let content = resp.text().await?;
9875        match content_type {
9876            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9877            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
9878            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
9879        }
9880    } else {
9881        let content = resp.text().await?;
9882        let entity: Option<SourcesUserConnectionsSamlCreateError> = serde_json::from_str(&content).ok();
9883        Err(Error::ResponseError(ResponseContent {
9884            status,
9885            content,
9886            entity,
9887        }))
9888    }
9889}
9890
9891/// User-source connection Viewset
9892pub async fn sources_user_connections_saml_destroy(
9893    configuration: &configuration::Configuration,
9894    id: i32,
9895) -> Result<(), Error<SourcesUserConnectionsSamlDestroyError>> {
9896    // add a prefix to parameters to efficiently prevent name collisions
9897    let p_path_id = id;
9898
9899    let uri_str = format!(
9900        "{}/sources/user_connections/saml/{id}/",
9901        configuration.base_path,
9902        id = p_path_id
9903    );
9904    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9905
9906    if let Some(ref user_agent) = configuration.user_agent {
9907        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9908    }
9909    if let Some(ref token) = configuration.bearer_access_token {
9910        req_builder = req_builder.bearer_auth(token.to_owned());
9911    };
9912
9913    let req = req_builder.build()?;
9914    let resp = configuration.client.execute(req).await?;
9915
9916    let status = resp.status();
9917
9918    if !status.is_client_error() && !status.is_server_error() {
9919        Ok(())
9920    } else {
9921        let content = resp.text().await?;
9922        let entity: Option<SourcesUserConnectionsSamlDestroyError> = serde_json::from_str(&content).ok();
9923        Err(Error::ResponseError(ResponseContent {
9924            status,
9925            content,
9926            entity,
9927        }))
9928    }
9929}
9930
9931/// User-source connection Viewset
9932pub async fn sources_user_connections_saml_list(
9933    configuration: &configuration::Configuration,
9934    ordering: Option<&str>,
9935    page: Option<i32>,
9936    page_size: Option<i32>,
9937    search: Option<&str>,
9938    source__slug: Option<&str>,
9939    user: Option<i32>,
9940) -> Result<models::PaginatedUserSamlSourceConnectionList, Error<SourcesUserConnectionsSamlListError>> {
9941    // add a prefix to parameters to efficiently prevent name collisions
9942    let p_query_ordering = ordering;
9943    let p_query_page = page;
9944    let p_query_page_size = page_size;
9945    let p_query_search = search;
9946    let p_query_source__slug = source__slug;
9947    let p_query_user = user;
9948
9949    let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path);
9950    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9951
9952    if let Some(ref param_value) = p_query_ordering {
9953        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
9954    }
9955    if let Some(ref param_value) = p_query_page {
9956        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
9957    }
9958    if let Some(ref param_value) = p_query_page_size {
9959        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
9960    }
9961    if let Some(ref param_value) = p_query_search {
9962        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
9963    }
9964    if let Some(ref param_value) = p_query_source__slug {
9965        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
9966    }
9967    if let Some(ref param_value) = p_query_user {
9968        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
9969    }
9970    if let Some(ref user_agent) = configuration.user_agent {
9971        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9972    }
9973    if let Some(ref token) = configuration.bearer_access_token {
9974        req_builder = req_builder.bearer_auth(token.to_owned());
9975    };
9976
9977    let req = req_builder.build()?;
9978    let resp = configuration.client.execute(req).await?;
9979
9980    let status = resp.status();
9981    let content_type = resp
9982        .headers()
9983        .get("content-type")
9984        .and_then(|v| v.to_str().ok())
9985        .unwrap_or("application/octet-stream");
9986    let content_type = super::ContentType::from(content_type);
9987
9988    if !status.is_client_error() && !status.is_server_error() {
9989        let content = resp.text().await?;
9990        match content_type {
9991            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9992            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserSamlSourceConnectionList`"))),
9993            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserSamlSourceConnectionList`")))),
9994        }
9995    } else {
9996        let content = resp.text().await?;
9997        let entity: Option<SourcesUserConnectionsSamlListError> = serde_json::from_str(&content).ok();
9998        Err(Error::ResponseError(ResponseContent {
9999            status,
10000            content,
10001            entity,
10002        }))
10003    }
10004}
10005
10006/// User-source connection Viewset
10007pub async fn sources_user_connections_saml_partial_update(
10008    configuration: &configuration::Configuration,
10009    id: i32,
10010    patched_user_saml_source_connection_request: Option<models::PatchedUserSamlSourceConnectionRequest>,
10011) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlPartialUpdateError>> {
10012    // add a prefix to parameters to efficiently prevent name collisions
10013    let p_path_id = id;
10014    let p_body_patched_user_saml_source_connection_request = patched_user_saml_source_connection_request;
10015
10016    let uri_str = format!(
10017        "{}/sources/user_connections/saml/{id}/",
10018        configuration.base_path,
10019        id = p_path_id
10020    );
10021    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10022
10023    if let Some(ref user_agent) = configuration.user_agent {
10024        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10025    }
10026    if let Some(ref token) = configuration.bearer_access_token {
10027        req_builder = req_builder.bearer_auth(token.to_owned());
10028    };
10029    req_builder = req_builder.json(&p_body_patched_user_saml_source_connection_request);
10030
10031    let req = req_builder.build()?;
10032    let resp = configuration.client.execute(req).await?;
10033
10034    let status = resp.status();
10035    let content_type = resp
10036        .headers()
10037        .get("content-type")
10038        .and_then(|v| v.to_str().ok())
10039        .unwrap_or("application/octet-stream");
10040    let content_type = super::ContentType::from(content_type);
10041
10042    if !status.is_client_error() && !status.is_server_error() {
10043        let content = resp.text().await?;
10044        match content_type {
10045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10046            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
10047            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
10048        }
10049    } else {
10050        let content = resp.text().await?;
10051        let entity: Option<SourcesUserConnectionsSamlPartialUpdateError> = serde_json::from_str(&content).ok();
10052        Err(Error::ResponseError(ResponseContent {
10053            status,
10054            content,
10055            entity,
10056        }))
10057    }
10058}
10059
10060/// User-source connection Viewset
10061pub async fn sources_user_connections_saml_retrieve(
10062    configuration: &configuration::Configuration,
10063    id: i32,
10064) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlRetrieveError>> {
10065    // add a prefix to parameters to efficiently prevent name collisions
10066    let p_path_id = id;
10067
10068    let uri_str = format!(
10069        "{}/sources/user_connections/saml/{id}/",
10070        configuration.base_path,
10071        id = p_path_id
10072    );
10073    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10074
10075    if let Some(ref user_agent) = configuration.user_agent {
10076        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10077    }
10078    if let Some(ref token) = configuration.bearer_access_token {
10079        req_builder = req_builder.bearer_auth(token.to_owned());
10080    };
10081
10082    let req = req_builder.build()?;
10083    let resp = configuration.client.execute(req).await?;
10084
10085    let status = resp.status();
10086    let content_type = resp
10087        .headers()
10088        .get("content-type")
10089        .and_then(|v| v.to_str().ok())
10090        .unwrap_or("application/octet-stream");
10091    let content_type = super::ContentType::from(content_type);
10092
10093    if !status.is_client_error() && !status.is_server_error() {
10094        let content = resp.text().await?;
10095        match content_type {
10096            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10097            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
10098            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
10099        }
10100    } else {
10101        let content = resp.text().await?;
10102        let entity: Option<SourcesUserConnectionsSamlRetrieveError> = serde_json::from_str(&content).ok();
10103        Err(Error::ResponseError(ResponseContent {
10104            status,
10105            content,
10106            entity,
10107        }))
10108    }
10109}
10110
10111/// User-source connection Viewset
10112pub async fn sources_user_connections_saml_update(
10113    configuration: &configuration::Configuration,
10114    id: i32,
10115    user_saml_source_connection_request: models::UserSamlSourceConnectionRequest,
10116) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlUpdateError>> {
10117    // add a prefix to parameters to efficiently prevent name collisions
10118    let p_path_id = id;
10119    let p_body_user_saml_source_connection_request = user_saml_source_connection_request;
10120
10121    let uri_str = format!(
10122        "{}/sources/user_connections/saml/{id}/",
10123        configuration.base_path,
10124        id = p_path_id
10125    );
10126    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10127
10128    if let Some(ref user_agent) = configuration.user_agent {
10129        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10130    }
10131    if let Some(ref token) = configuration.bearer_access_token {
10132        req_builder = req_builder.bearer_auth(token.to_owned());
10133    };
10134    req_builder = req_builder.json(&p_body_user_saml_source_connection_request);
10135
10136    let req = req_builder.build()?;
10137    let resp = configuration.client.execute(req).await?;
10138
10139    let status = resp.status();
10140    let content_type = resp
10141        .headers()
10142        .get("content-type")
10143        .and_then(|v| v.to_str().ok())
10144        .unwrap_or("application/octet-stream");
10145    let content_type = super::ContentType::from(content_type);
10146
10147    if !status.is_client_error() && !status.is_server_error() {
10148        let content = resp.text().await?;
10149        match content_type {
10150            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10151            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
10152            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
10153        }
10154    } else {
10155        let content = resp.text().await?;
10156        let entity: Option<SourcesUserConnectionsSamlUpdateError> = serde_json::from_str(&content).ok();
10157        Err(Error::ResponseError(ResponseContent {
10158            status,
10159            content,
10160            entity,
10161        }))
10162    }
10163}
10164
10165/// Get a list of all objects that use this object
10166pub async fn sources_user_connections_saml_used_by_list(
10167    configuration: &configuration::Configuration,
10168    id: i32,
10169) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsSamlUsedByListError>> {
10170    // add a prefix to parameters to efficiently prevent name collisions
10171    let p_path_id = id;
10172
10173    let uri_str = format!(
10174        "{}/sources/user_connections/saml/{id}/used_by/",
10175        configuration.base_path,
10176        id = p_path_id
10177    );
10178    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10179
10180    if let Some(ref user_agent) = configuration.user_agent {
10181        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10182    }
10183    if let Some(ref token) = configuration.bearer_access_token {
10184        req_builder = req_builder.bearer_auth(token.to_owned());
10185    };
10186
10187    let req = req_builder.build()?;
10188    let resp = configuration.client.execute(req).await?;
10189
10190    let status = resp.status();
10191    let content_type = resp
10192        .headers()
10193        .get("content-type")
10194        .and_then(|v| v.to_str().ok())
10195        .unwrap_or("application/octet-stream");
10196    let content_type = super::ContentType::from(content_type);
10197
10198    if !status.is_client_error() && !status.is_server_error() {
10199        let content = resp.text().await?;
10200        match content_type {
10201            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10202            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;`"))),
10203            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;`")))),
10204        }
10205    } else {
10206        let content = resp.text().await?;
10207        let entity: Option<SourcesUserConnectionsSamlUsedByListError> = serde_json::from_str(&content).ok();
10208        Err(Error::ResponseError(ResponseContent {
10209            status,
10210            content,
10211            entity,
10212        }))
10213    }
10214}