authentik_client/apis/
sources_api.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.10.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16/// struct for typed errors of method [`sources_all_destroy`]
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum SourcesAllDestroyError {
20    Status400(models::ValidationError),
21    Status403(models::GenericError),
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`sources_all_list`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum SourcesAllListError {
29    Status400(models::ValidationError),
30    Status403(models::GenericError),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`sources_all_retrieve`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum SourcesAllRetrieveError {
38    Status400(models::ValidationError),
39    Status403(models::GenericError),
40    UnknownValue(serde_json::Value),
41}
42
43/// struct for typed errors of method [`sources_all_set_icon_create`]
44#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(untagged)]
46pub enum SourcesAllSetIconCreateError {
47    Status400(),
48    Status403(models::GenericError),
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`sources_all_set_icon_url_create`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum SourcesAllSetIconUrlCreateError {
56    Status400(),
57    Status403(models::GenericError),
58    UnknownValue(serde_json::Value),
59}
60
61/// struct for typed errors of method [`sources_all_types_list`]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum SourcesAllTypesListError {
65    Status400(models::ValidationError),
66    Status403(models::GenericError),
67    UnknownValue(serde_json::Value),
68}
69
70/// struct for typed errors of method [`sources_all_used_by_list`]
71#[derive(Debug, Clone, Serialize, Deserialize)]
72#[serde(untagged)]
73pub enum SourcesAllUsedByListError {
74    Status400(models::ValidationError),
75    Status403(models::GenericError),
76    UnknownValue(serde_json::Value),
77}
78
79/// struct for typed errors of method [`sources_all_user_settings_list`]
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum SourcesAllUserSettingsListError {
83    Status400(models::ValidationError),
84    Status403(models::GenericError),
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`sources_group_connections_all_destroy`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum SourcesGroupConnectionsAllDestroyError {
92    Status400(models::ValidationError),
93    Status403(models::GenericError),
94    UnknownValue(serde_json::Value),
95}
96
97/// struct for typed errors of method [`sources_group_connections_all_list`]
98#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum SourcesGroupConnectionsAllListError {
101    Status400(models::ValidationError),
102    Status403(models::GenericError),
103    UnknownValue(serde_json::Value),
104}
105
106/// struct for typed errors of method [`sources_group_connections_all_partial_update`]
107#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum SourcesGroupConnectionsAllPartialUpdateError {
110    Status400(models::ValidationError),
111    Status403(models::GenericError),
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`sources_group_connections_all_retrieve`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum SourcesGroupConnectionsAllRetrieveError {
119    Status400(models::ValidationError),
120    Status403(models::GenericError),
121    UnknownValue(serde_json::Value),
122}
123
124/// struct for typed errors of method [`sources_group_connections_all_update`]
125#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum SourcesGroupConnectionsAllUpdateError {
128    Status400(models::ValidationError),
129    Status403(models::GenericError),
130    UnknownValue(serde_json::Value),
131}
132
133/// struct for typed errors of method [`sources_group_connections_all_used_by_list`]
134#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum SourcesGroupConnectionsAllUsedByListError {
137    Status400(models::ValidationError),
138    Status403(models::GenericError),
139    UnknownValue(serde_json::Value),
140}
141
142/// struct for typed errors of method [`sources_group_connections_kerberos_create`]
143#[derive(Debug, Clone, Serialize, Deserialize)]
144#[serde(untagged)]
145pub enum SourcesGroupConnectionsKerberosCreateError {
146    Status400(models::ValidationError),
147    Status403(models::GenericError),
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`sources_group_connections_kerberos_destroy`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum SourcesGroupConnectionsKerberosDestroyError {
155    Status400(models::ValidationError),
156    Status403(models::GenericError),
157    UnknownValue(serde_json::Value),
158}
159
160/// struct for typed errors of method [`sources_group_connections_kerberos_list`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum SourcesGroupConnectionsKerberosListError {
164    Status400(models::ValidationError),
165    Status403(models::GenericError),
166    UnknownValue(serde_json::Value),
167}
168
169/// struct for typed errors of method [`sources_group_connections_kerberos_partial_update`]
170#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(untagged)]
172pub enum SourcesGroupConnectionsKerberosPartialUpdateError {
173    Status400(models::ValidationError),
174    Status403(models::GenericError),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`sources_group_connections_kerberos_retrieve`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum SourcesGroupConnectionsKerberosRetrieveError {
182    Status400(models::ValidationError),
183    Status403(models::GenericError),
184    UnknownValue(serde_json::Value),
185}
186
187/// struct for typed errors of method [`sources_group_connections_kerberos_update`]
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum SourcesGroupConnectionsKerberosUpdateError {
191    Status400(models::ValidationError),
192    Status403(models::GenericError),
193    UnknownValue(serde_json::Value),
194}
195
196/// struct for typed errors of method [`sources_group_connections_kerberos_used_by_list`]
197#[derive(Debug, Clone, Serialize, Deserialize)]
198#[serde(untagged)]
199pub enum SourcesGroupConnectionsKerberosUsedByListError {
200    Status400(models::ValidationError),
201    Status403(models::GenericError),
202    UnknownValue(serde_json::Value),
203}
204
205/// struct for typed errors of method [`sources_group_connections_ldap_create`]
206#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum SourcesGroupConnectionsLdapCreateError {
209    Status400(models::ValidationError),
210    Status403(models::GenericError),
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`sources_group_connections_ldap_destroy`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum SourcesGroupConnectionsLdapDestroyError {
218    Status400(models::ValidationError),
219    Status403(models::GenericError),
220    UnknownValue(serde_json::Value),
221}
222
223/// struct for typed errors of method [`sources_group_connections_ldap_list`]
224#[derive(Debug, Clone, Serialize, Deserialize)]
225#[serde(untagged)]
226pub enum SourcesGroupConnectionsLdapListError {
227    Status400(models::ValidationError),
228    Status403(models::GenericError),
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed errors of method [`sources_group_connections_ldap_partial_update`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum SourcesGroupConnectionsLdapPartialUpdateError {
236    Status400(models::ValidationError),
237    Status403(models::GenericError),
238    UnknownValue(serde_json::Value),
239}
240
241/// struct for typed errors of method [`sources_group_connections_ldap_retrieve`]
242#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum SourcesGroupConnectionsLdapRetrieveError {
245    Status400(models::ValidationError),
246    Status403(models::GenericError),
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`sources_group_connections_ldap_update`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum SourcesGroupConnectionsLdapUpdateError {
254    Status400(models::ValidationError),
255    Status403(models::GenericError),
256    UnknownValue(serde_json::Value),
257}
258
259/// struct for typed errors of method [`sources_group_connections_ldap_used_by_list`]
260#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum SourcesGroupConnectionsLdapUsedByListError {
263    Status400(models::ValidationError),
264    Status403(models::GenericError),
265    UnknownValue(serde_json::Value),
266}
267
268/// struct for typed errors of method [`sources_group_connections_oauth_create`]
269#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum SourcesGroupConnectionsOauthCreateError {
272    Status400(models::ValidationError),
273    Status403(models::GenericError),
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`sources_group_connections_oauth_destroy`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum SourcesGroupConnectionsOauthDestroyError {
281    Status400(models::ValidationError),
282    Status403(models::GenericError),
283    UnknownValue(serde_json::Value),
284}
285
286/// struct for typed errors of method [`sources_group_connections_oauth_list`]
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum SourcesGroupConnectionsOauthListError {
290    Status400(models::ValidationError),
291    Status403(models::GenericError),
292    UnknownValue(serde_json::Value),
293}
294
295/// struct for typed errors of method [`sources_group_connections_oauth_partial_update`]
296#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(untagged)]
298pub enum SourcesGroupConnectionsOauthPartialUpdateError {
299    Status400(models::ValidationError),
300    Status403(models::GenericError),
301    UnknownValue(serde_json::Value),
302}
303
304/// struct for typed errors of method [`sources_group_connections_oauth_retrieve`]
305#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(untagged)]
307pub enum SourcesGroupConnectionsOauthRetrieveError {
308    Status400(models::ValidationError),
309    Status403(models::GenericError),
310    UnknownValue(serde_json::Value),
311}
312
313/// struct for typed errors of method [`sources_group_connections_oauth_update`]
314#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum SourcesGroupConnectionsOauthUpdateError {
317    Status400(models::ValidationError),
318    Status403(models::GenericError),
319    UnknownValue(serde_json::Value),
320}
321
322/// struct for typed errors of method [`sources_group_connections_oauth_used_by_list`]
323#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum SourcesGroupConnectionsOauthUsedByListError {
326    Status400(models::ValidationError),
327    Status403(models::GenericError),
328    UnknownValue(serde_json::Value),
329}
330
331/// struct for typed errors of method [`sources_group_connections_plex_create`]
332#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum SourcesGroupConnectionsPlexCreateError {
335    Status400(models::ValidationError),
336    Status403(models::GenericError),
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`sources_group_connections_plex_destroy`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum SourcesGroupConnectionsPlexDestroyError {
344    Status400(models::ValidationError),
345    Status403(models::GenericError),
346    UnknownValue(serde_json::Value),
347}
348
349/// struct for typed errors of method [`sources_group_connections_plex_list`]
350#[derive(Debug, Clone, Serialize, Deserialize)]
351#[serde(untagged)]
352pub enum SourcesGroupConnectionsPlexListError {
353    Status400(models::ValidationError),
354    Status403(models::GenericError),
355    UnknownValue(serde_json::Value),
356}
357
358/// struct for typed errors of method [`sources_group_connections_plex_partial_update`]
359#[derive(Debug, Clone, Serialize, Deserialize)]
360#[serde(untagged)]
361pub enum SourcesGroupConnectionsPlexPartialUpdateError {
362    Status400(models::ValidationError),
363    Status403(models::GenericError),
364    UnknownValue(serde_json::Value),
365}
366
367/// struct for typed errors of method [`sources_group_connections_plex_retrieve`]
368#[derive(Debug, Clone, Serialize, Deserialize)]
369#[serde(untagged)]
370pub enum SourcesGroupConnectionsPlexRetrieveError {
371    Status400(models::ValidationError),
372    Status403(models::GenericError),
373    UnknownValue(serde_json::Value),
374}
375
376/// struct for typed errors of method [`sources_group_connections_plex_update`]
377#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(untagged)]
379pub enum SourcesGroupConnectionsPlexUpdateError {
380    Status400(models::ValidationError),
381    Status403(models::GenericError),
382    UnknownValue(serde_json::Value),
383}
384
385/// struct for typed errors of method [`sources_group_connections_plex_used_by_list`]
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum SourcesGroupConnectionsPlexUsedByListError {
389    Status400(models::ValidationError),
390    Status403(models::GenericError),
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`sources_group_connections_saml_create`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum SourcesGroupConnectionsSamlCreateError {
398    Status400(models::ValidationError),
399    Status403(models::GenericError),
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`sources_group_connections_saml_destroy`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum SourcesGroupConnectionsSamlDestroyError {
407    Status400(models::ValidationError),
408    Status403(models::GenericError),
409    UnknownValue(serde_json::Value),
410}
411
412/// struct for typed errors of method [`sources_group_connections_saml_list`]
413#[derive(Debug, Clone, Serialize, Deserialize)]
414#[serde(untagged)]
415pub enum SourcesGroupConnectionsSamlListError {
416    Status400(models::ValidationError),
417    Status403(models::GenericError),
418    UnknownValue(serde_json::Value),
419}
420
421/// struct for typed errors of method [`sources_group_connections_saml_partial_update`]
422#[derive(Debug, Clone, Serialize, Deserialize)]
423#[serde(untagged)]
424pub enum SourcesGroupConnectionsSamlPartialUpdateError {
425    Status400(models::ValidationError),
426    Status403(models::GenericError),
427    UnknownValue(serde_json::Value),
428}
429
430/// struct for typed errors of method [`sources_group_connections_saml_retrieve`]
431#[derive(Debug, Clone, Serialize, Deserialize)]
432#[serde(untagged)]
433pub enum SourcesGroupConnectionsSamlRetrieveError {
434    Status400(models::ValidationError),
435    Status403(models::GenericError),
436    UnknownValue(serde_json::Value),
437}
438
439/// struct for typed errors of method [`sources_group_connections_saml_update`]
440#[derive(Debug, Clone, Serialize, Deserialize)]
441#[serde(untagged)]
442pub enum SourcesGroupConnectionsSamlUpdateError {
443    Status400(models::ValidationError),
444    Status403(models::GenericError),
445    UnknownValue(serde_json::Value),
446}
447
448/// struct for typed errors of method [`sources_group_connections_saml_used_by_list`]
449#[derive(Debug, Clone, Serialize, Deserialize)]
450#[serde(untagged)]
451pub enum SourcesGroupConnectionsSamlUsedByListError {
452    Status400(models::ValidationError),
453    Status403(models::GenericError),
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`sources_group_connections_telegram_create`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum SourcesGroupConnectionsTelegramCreateError {
461    Status400(models::ValidationError),
462    Status403(models::GenericError),
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`sources_group_connections_telegram_destroy`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum SourcesGroupConnectionsTelegramDestroyError {
470    Status400(models::ValidationError),
471    Status403(models::GenericError),
472    UnknownValue(serde_json::Value),
473}
474
475/// struct for typed errors of method [`sources_group_connections_telegram_list`]
476#[derive(Debug, Clone, Serialize, Deserialize)]
477#[serde(untagged)]
478pub enum SourcesGroupConnectionsTelegramListError {
479    Status400(models::ValidationError),
480    Status403(models::GenericError),
481    UnknownValue(serde_json::Value),
482}
483
484/// struct for typed errors of method [`sources_group_connections_telegram_partial_update`]
485#[derive(Debug, Clone, Serialize, Deserialize)]
486#[serde(untagged)]
487pub enum SourcesGroupConnectionsTelegramPartialUpdateError {
488    Status400(models::ValidationError),
489    Status403(models::GenericError),
490    UnknownValue(serde_json::Value),
491}
492
493/// struct for typed errors of method [`sources_group_connections_telegram_retrieve`]
494#[derive(Debug, Clone, Serialize, Deserialize)]
495#[serde(untagged)]
496pub enum SourcesGroupConnectionsTelegramRetrieveError {
497    Status400(models::ValidationError),
498    Status403(models::GenericError),
499    UnknownValue(serde_json::Value),
500}
501
502/// struct for typed errors of method [`sources_group_connections_telegram_update`]
503#[derive(Debug, Clone, Serialize, Deserialize)]
504#[serde(untagged)]
505pub enum SourcesGroupConnectionsTelegramUpdateError {
506    Status400(models::ValidationError),
507    Status403(models::GenericError),
508    UnknownValue(serde_json::Value),
509}
510
511/// struct for typed errors of method [`sources_group_connections_telegram_used_by_list`]
512#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum SourcesGroupConnectionsTelegramUsedByListError {
515    Status400(models::ValidationError),
516    Status403(models::GenericError),
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`sources_kerberos_create`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum SourcesKerberosCreateError {
524    Status400(models::ValidationError),
525    Status403(models::GenericError),
526    UnknownValue(serde_json::Value),
527}
528
529/// struct for typed errors of method [`sources_kerberos_destroy`]
530#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(untagged)]
532pub enum SourcesKerberosDestroyError {
533    Status400(models::ValidationError),
534    Status403(models::GenericError),
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`sources_kerberos_list`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum SourcesKerberosListError {
542    Status400(models::ValidationError),
543    Status403(models::GenericError),
544    UnknownValue(serde_json::Value),
545}
546
547/// struct for typed errors of method [`sources_kerberos_partial_update`]
548#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(untagged)]
550pub enum SourcesKerberosPartialUpdateError {
551    Status400(models::ValidationError),
552    Status403(models::GenericError),
553    UnknownValue(serde_json::Value),
554}
555
556/// struct for typed errors of method [`sources_kerberos_retrieve`]
557#[derive(Debug, Clone, Serialize, Deserialize)]
558#[serde(untagged)]
559pub enum SourcesKerberosRetrieveError {
560    Status400(models::ValidationError),
561    Status403(models::GenericError),
562    UnknownValue(serde_json::Value),
563}
564
565/// struct for typed errors of method [`sources_kerberos_sync_status_retrieve`]
566#[derive(Debug, Clone, Serialize, Deserialize)]
567#[serde(untagged)]
568pub enum SourcesKerberosSyncStatusRetrieveError {
569    Status400(models::ValidationError),
570    Status403(models::GenericError),
571    UnknownValue(serde_json::Value),
572}
573
574/// struct for typed errors of method [`sources_kerberos_update`]
575#[derive(Debug, Clone, Serialize, Deserialize)]
576#[serde(untagged)]
577pub enum SourcesKerberosUpdateError {
578    Status400(models::ValidationError),
579    Status403(models::GenericError),
580    UnknownValue(serde_json::Value),
581}
582
583/// struct for typed errors of method [`sources_kerberos_used_by_list`]
584#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum SourcesKerberosUsedByListError {
587    Status400(models::ValidationError),
588    Status403(models::GenericError),
589    UnknownValue(serde_json::Value),
590}
591
592/// struct for typed errors of method [`sources_ldap_create`]
593#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum SourcesLdapCreateError {
596    Status400(models::ValidationError),
597    Status403(models::GenericError),
598    UnknownValue(serde_json::Value),
599}
600
601/// struct for typed errors of method [`sources_ldap_debug_retrieve`]
602#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum SourcesLdapDebugRetrieveError {
605    Status400(models::ValidationError),
606    Status403(models::GenericError),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`sources_ldap_destroy`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum SourcesLdapDestroyError {
614    Status400(models::ValidationError),
615    Status403(models::GenericError),
616    UnknownValue(serde_json::Value),
617}
618
619/// struct for typed errors of method [`sources_ldap_list`]
620#[derive(Debug, Clone, Serialize, Deserialize)]
621#[serde(untagged)]
622pub enum SourcesLdapListError {
623    Status400(models::ValidationError),
624    Status403(models::GenericError),
625    UnknownValue(serde_json::Value),
626}
627
628/// struct for typed errors of method [`sources_ldap_partial_update`]
629#[derive(Debug, Clone, Serialize, Deserialize)]
630#[serde(untagged)]
631pub enum SourcesLdapPartialUpdateError {
632    Status400(models::ValidationError),
633    Status403(models::GenericError),
634    UnknownValue(serde_json::Value),
635}
636
637/// struct for typed errors of method [`sources_ldap_retrieve`]
638#[derive(Debug, Clone, Serialize, Deserialize)]
639#[serde(untagged)]
640pub enum SourcesLdapRetrieveError {
641    Status400(models::ValidationError),
642    Status403(models::GenericError),
643    UnknownValue(serde_json::Value),
644}
645
646/// struct for typed errors of method [`sources_ldap_sync_status_retrieve`]
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum SourcesLdapSyncStatusRetrieveError {
650    Status400(models::ValidationError),
651    Status403(models::GenericError),
652    UnknownValue(serde_json::Value),
653}
654
655/// struct for typed errors of method [`sources_ldap_update`]
656#[derive(Debug, Clone, Serialize, Deserialize)]
657#[serde(untagged)]
658pub enum SourcesLdapUpdateError {
659    Status400(models::ValidationError),
660    Status403(models::GenericError),
661    UnknownValue(serde_json::Value),
662}
663
664/// struct for typed errors of method [`sources_ldap_used_by_list`]
665#[derive(Debug, Clone, Serialize, Deserialize)]
666#[serde(untagged)]
667pub enum SourcesLdapUsedByListError {
668    Status400(models::ValidationError),
669    Status403(models::GenericError),
670    UnknownValue(serde_json::Value),
671}
672
673/// struct for typed errors of method [`sources_oauth_create`]
674#[derive(Debug, Clone, Serialize, Deserialize)]
675#[serde(untagged)]
676pub enum SourcesOauthCreateError {
677    Status400(models::ValidationError),
678    Status403(models::GenericError),
679    UnknownValue(serde_json::Value),
680}
681
682/// struct for typed errors of method [`sources_oauth_destroy`]
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum SourcesOauthDestroyError {
686    Status400(models::ValidationError),
687    Status403(models::GenericError),
688    UnknownValue(serde_json::Value),
689}
690
691/// struct for typed errors of method [`sources_oauth_list`]
692#[derive(Debug, Clone, Serialize, Deserialize)]
693#[serde(untagged)]
694pub enum SourcesOauthListError {
695    Status400(models::ValidationError),
696    Status403(models::GenericError),
697    UnknownValue(serde_json::Value),
698}
699
700/// struct for typed errors of method [`sources_oauth_partial_update`]
701#[derive(Debug, Clone, Serialize, Deserialize)]
702#[serde(untagged)]
703pub enum SourcesOauthPartialUpdateError {
704    Status400(models::ValidationError),
705    Status403(models::GenericError),
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`sources_oauth_retrieve`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum SourcesOauthRetrieveError {
713    Status400(models::ValidationError),
714    Status403(models::GenericError),
715    UnknownValue(serde_json::Value),
716}
717
718/// struct for typed errors of method [`sources_oauth_source_types_list`]
719#[derive(Debug, Clone, Serialize, Deserialize)]
720#[serde(untagged)]
721pub enum SourcesOauthSourceTypesListError {
722    Status400(models::ValidationError),
723    Status403(models::GenericError),
724    UnknownValue(serde_json::Value),
725}
726
727/// struct for typed errors of method [`sources_oauth_update`]
728#[derive(Debug, Clone, Serialize, Deserialize)]
729#[serde(untagged)]
730pub enum SourcesOauthUpdateError {
731    Status400(models::ValidationError),
732    Status403(models::GenericError),
733    UnknownValue(serde_json::Value),
734}
735
736/// struct for typed errors of method [`sources_oauth_used_by_list`]
737#[derive(Debug, Clone, Serialize, Deserialize)]
738#[serde(untagged)]
739pub enum SourcesOauthUsedByListError {
740    Status400(models::ValidationError),
741    Status403(models::GenericError),
742    UnknownValue(serde_json::Value),
743}
744
745/// struct for typed errors of method [`sources_plex_create`]
746#[derive(Debug, Clone, Serialize, Deserialize)]
747#[serde(untagged)]
748pub enum SourcesPlexCreateError {
749    Status400(models::ValidationError),
750    Status403(models::GenericError),
751    UnknownValue(serde_json::Value),
752}
753
754/// struct for typed errors of method [`sources_plex_destroy`]
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum SourcesPlexDestroyError {
758    Status400(models::ValidationError),
759    Status403(models::GenericError),
760    UnknownValue(serde_json::Value),
761}
762
763/// struct for typed errors of method [`sources_plex_list`]
764#[derive(Debug, Clone, Serialize, Deserialize)]
765#[serde(untagged)]
766pub enum SourcesPlexListError {
767    Status400(models::ValidationError),
768    Status403(models::GenericError),
769    UnknownValue(serde_json::Value),
770}
771
772/// struct for typed errors of method [`sources_plex_partial_update`]
773#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum SourcesPlexPartialUpdateError {
776    Status400(models::ValidationError),
777    Status403(models::GenericError),
778    UnknownValue(serde_json::Value),
779}
780
781/// struct for typed errors of method [`sources_plex_redeem_token_authenticated_create`]
782#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum SourcesPlexRedeemTokenAuthenticatedCreateError {
785    Status400(),
786    Status403(),
787    UnknownValue(serde_json::Value),
788}
789
790/// struct for typed errors of method [`sources_plex_redeem_token_create`]
791#[derive(Debug, Clone, Serialize, Deserialize)]
792#[serde(untagged)]
793pub enum SourcesPlexRedeemTokenCreateError {
794    Status400(),
795    Status403(),
796    UnknownValue(serde_json::Value),
797}
798
799/// struct for typed errors of method [`sources_plex_retrieve`]
800#[derive(Debug, Clone, Serialize, Deserialize)]
801#[serde(untagged)]
802pub enum SourcesPlexRetrieveError {
803    Status400(models::ValidationError),
804    Status403(models::GenericError),
805    UnknownValue(serde_json::Value),
806}
807
808/// struct for typed errors of method [`sources_plex_update`]
809#[derive(Debug, Clone, Serialize, Deserialize)]
810#[serde(untagged)]
811pub enum SourcesPlexUpdateError {
812    Status400(models::ValidationError),
813    Status403(models::GenericError),
814    UnknownValue(serde_json::Value),
815}
816
817/// struct for typed errors of method [`sources_plex_used_by_list`]
818#[derive(Debug, Clone, Serialize, Deserialize)]
819#[serde(untagged)]
820pub enum SourcesPlexUsedByListError {
821    Status400(models::ValidationError),
822    Status403(models::GenericError),
823    UnknownValue(serde_json::Value),
824}
825
826/// struct for typed errors of method [`sources_saml_create`]
827#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum SourcesSamlCreateError {
830    Status400(models::ValidationError),
831    Status403(models::GenericError),
832    UnknownValue(serde_json::Value),
833}
834
835/// struct for typed errors of method [`sources_saml_destroy`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum SourcesSamlDestroyError {
839    Status400(models::ValidationError),
840    Status403(models::GenericError),
841    UnknownValue(serde_json::Value),
842}
843
844/// struct for typed errors of method [`sources_saml_list`]
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(untagged)]
847pub enum SourcesSamlListError {
848    Status400(models::ValidationError),
849    Status403(models::GenericError),
850    UnknownValue(serde_json::Value),
851}
852
853/// struct for typed errors of method [`sources_saml_metadata_retrieve`]
854#[derive(Debug, Clone, Serialize, Deserialize)]
855#[serde(untagged)]
856pub enum SourcesSamlMetadataRetrieveError {
857    Status400(models::ValidationError),
858    Status403(models::GenericError),
859    UnknownValue(serde_json::Value),
860}
861
862/// struct for typed errors of method [`sources_saml_partial_update`]
863#[derive(Debug, Clone, Serialize, Deserialize)]
864#[serde(untagged)]
865pub enum SourcesSamlPartialUpdateError {
866    Status400(models::ValidationError),
867    Status403(models::GenericError),
868    UnknownValue(serde_json::Value),
869}
870
871/// struct for typed errors of method [`sources_saml_retrieve`]
872#[derive(Debug, Clone, Serialize, Deserialize)]
873#[serde(untagged)]
874pub enum SourcesSamlRetrieveError {
875    Status400(models::ValidationError),
876    Status403(models::GenericError),
877    UnknownValue(serde_json::Value),
878}
879
880/// struct for typed errors of method [`sources_saml_update`]
881#[derive(Debug, Clone, Serialize, Deserialize)]
882#[serde(untagged)]
883pub enum SourcesSamlUpdateError {
884    Status400(models::ValidationError),
885    Status403(models::GenericError),
886    UnknownValue(serde_json::Value),
887}
888
889/// struct for typed errors of method [`sources_saml_used_by_list`]
890#[derive(Debug, Clone, Serialize, Deserialize)]
891#[serde(untagged)]
892pub enum SourcesSamlUsedByListError {
893    Status400(models::ValidationError),
894    Status403(models::GenericError),
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`sources_scim_create`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum SourcesScimCreateError {
902    Status400(models::ValidationError),
903    Status403(models::GenericError),
904    UnknownValue(serde_json::Value),
905}
906
907/// struct for typed errors of method [`sources_scim_destroy`]
908#[derive(Debug, Clone, Serialize, Deserialize)]
909#[serde(untagged)]
910pub enum SourcesScimDestroyError {
911    Status400(models::ValidationError),
912    Status403(models::GenericError),
913    UnknownValue(serde_json::Value),
914}
915
916/// struct for typed errors of method [`sources_scim_groups_create`]
917#[derive(Debug, Clone, Serialize, Deserialize)]
918#[serde(untagged)]
919pub enum SourcesScimGroupsCreateError {
920    Status400(models::ValidationError),
921    Status403(models::GenericError),
922    UnknownValue(serde_json::Value),
923}
924
925/// struct for typed errors of method [`sources_scim_groups_destroy`]
926#[derive(Debug, Clone, Serialize, Deserialize)]
927#[serde(untagged)]
928pub enum SourcesScimGroupsDestroyError {
929    Status400(models::ValidationError),
930    Status403(models::GenericError),
931    UnknownValue(serde_json::Value),
932}
933
934/// struct for typed errors of method [`sources_scim_groups_list`]
935#[derive(Debug, Clone, Serialize, Deserialize)]
936#[serde(untagged)]
937pub enum SourcesScimGroupsListError {
938    Status400(models::ValidationError),
939    Status403(models::GenericError),
940    UnknownValue(serde_json::Value),
941}
942
943/// struct for typed errors of method [`sources_scim_groups_partial_update`]
944#[derive(Debug, Clone, Serialize, Deserialize)]
945#[serde(untagged)]
946pub enum SourcesScimGroupsPartialUpdateError {
947    Status400(models::ValidationError),
948    Status403(models::GenericError),
949    UnknownValue(serde_json::Value),
950}
951
952/// struct for typed errors of method [`sources_scim_groups_retrieve`]
953#[derive(Debug, Clone, Serialize, Deserialize)]
954#[serde(untagged)]
955pub enum SourcesScimGroupsRetrieveError {
956    Status400(models::ValidationError),
957    Status403(models::GenericError),
958    UnknownValue(serde_json::Value),
959}
960
961/// struct for typed errors of method [`sources_scim_groups_update`]
962#[derive(Debug, Clone, Serialize, Deserialize)]
963#[serde(untagged)]
964pub enum SourcesScimGroupsUpdateError {
965    Status400(models::ValidationError),
966    Status403(models::GenericError),
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`sources_scim_groups_used_by_list`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum SourcesScimGroupsUsedByListError {
974    Status400(models::ValidationError),
975    Status403(models::GenericError),
976    UnknownValue(serde_json::Value),
977}
978
979/// struct for typed errors of method [`sources_scim_list`]
980#[derive(Debug, Clone, Serialize, Deserialize)]
981#[serde(untagged)]
982pub enum SourcesScimListError {
983    Status400(models::ValidationError),
984    Status403(models::GenericError),
985    UnknownValue(serde_json::Value),
986}
987
988/// struct for typed errors of method [`sources_scim_partial_update`]
989#[derive(Debug, Clone, Serialize, Deserialize)]
990#[serde(untagged)]
991pub enum SourcesScimPartialUpdateError {
992    Status400(models::ValidationError),
993    Status403(models::GenericError),
994    UnknownValue(serde_json::Value),
995}
996
997/// struct for typed errors of method [`sources_scim_retrieve`]
998#[derive(Debug, Clone, Serialize, Deserialize)]
999#[serde(untagged)]
1000pub enum SourcesScimRetrieveError {
1001    Status400(models::ValidationError),
1002    Status403(models::GenericError),
1003    UnknownValue(serde_json::Value),
1004}
1005
1006/// struct for typed errors of method [`sources_scim_update`]
1007#[derive(Debug, Clone, Serialize, Deserialize)]
1008#[serde(untagged)]
1009pub enum SourcesScimUpdateError {
1010    Status400(models::ValidationError),
1011    Status403(models::GenericError),
1012    UnknownValue(serde_json::Value),
1013}
1014
1015/// struct for typed errors of method [`sources_scim_used_by_list`]
1016#[derive(Debug, Clone, Serialize, Deserialize)]
1017#[serde(untagged)]
1018pub enum SourcesScimUsedByListError {
1019    Status400(models::ValidationError),
1020    Status403(models::GenericError),
1021    UnknownValue(serde_json::Value),
1022}
1023
1024/// struct for typed errors of method [`sources_scim_users_create`]
1025#[derive(Debug, Clone, Serialize, Deserialize)]
1026#[serde(untagged)]
1027pub enum SourcesScimUsersCreateError {
1028    Status400(models::ValidationError),
1029    Status403(models::GenericError),
1030    UnknownValue(serde_json::Value),
1031}
1032
1033/// struct for typed errors of method [`sources_scim_users_destroy`]
1034#[derive(Debug, Clone, Serialize, Deserialize)]
1035#[serde(untagged)]
1036pub enum SourcesScimUsersDestroyError {
1037    Status400(models::ValidationError),
1038    Status403(models::GenericError),
1039    UnknownValue(serde_json::Value),
1040}
1041
1042/// struct for typed errors of method [`sources_scim_users_list`]
1043#[derive(Debug, Clone, Serialize, Deserialize)]
1044#[serde(untagged)]
1045pub enum SourcesScimUsersListError {
1046    Status400(models::ValidationError),
1047    Status403(models::GenericError),
1048    UnknownValue(serde_json::Value),
1049}
1050
1051/// struct for typed errors of method [`sources_scim_users_partial_update`]
1052#[derive(Debug, Clone, Serialize, Deserialize)]
1053#[serde(untagged)]
1054pub enum SourcesScimUsersPartialUpdateError {
1055    Status400(models::ValidationError),
1056    Status403(models::GenericError),
1057    UnknownValue(serde_json::Value),
1058}
1059
1060/// struct for typed errors of method [`sources_scim_users_retrieve`]
1061#[derive(Debug, Clone, Serialize, Deserialize)]
1062#[serde(untagged)]
1063pub enum SourcesScimUsersRetrieveError {
1064    Status400(models::ValidationError),
1065    Status403(models::GenericError),
1066    UnknownValue(serde_json::Value),
1067}
1068
1069/// struct for typed errors of method [`sources_scim_users_update`]
1070#[derive(Debug, Clone, Serialize, Deserialize)]
1071#[serde(untagged)]
1072pub enum SourcesScimUsersUpdateError {
1073    Status400(models::ValidationError),
1074    Status403(models::GenericError),
1075    UnknownValue(serde_json::Value),
1076}
1077
1078/// struct for typed errors of method [`sources_scim_users_used_by_list`]
1079#[derive(Debug, Clone, Serialize, Deserialize)]
1080#[serde(untagged)]
1081pub enum SourcesScimUsersUsedByListError {
1082    Status400(models::ValidationError),
1083    Status403(models::GenericError),
1084    UnknownValue(serde_json::Value),
1085}
1086
1087/// struct for typed errors of method [`sources_telegram_create`]
1088#[derive(Debug, Clone, Serialize, Deserialize)]
1089#[serde(untagged)]
1090pub enum SourcesTelegramCreateError {
1091    Status400(models::ValidationError),
1092    Status403(models::GenericError),
1093    UnknownValue(serde_json::Value),
1094}
1095
1096/// struct for typed errors of method [`sources_telegram_destroy`]
1097#[derive(Debug, Clone, Serialize, Deserialize)]
1098#[serde(untagged)]
1099pub enum SourcesTelegramDestroyError {
1100    Status400(models::ValidationError),
1101    Status403(models::GenericError),
1102    UnknownValue(serde_json::Value),
1103}
1104
1105/// struct for typed errors of method [`sources_telegram_list`]
1106#[derive(Debug, Clone, Serialize, Deserialize)]
1107#[serde(untagged)]
1108pub enum SourcesTelegramListError {
1109    Status400(models::ValidationError),
1110    Status403(models::GenericError),
1111    UnknownValue(serde_json::Value),
1112}
1113
1114/// struct for typed errors of method [`sources_telegram_partial_update`]
1115#[derive(Debug, Clone, Serialize, Deserialize)]
1116#[serde(untagged)]
1117pub enum SourcesTelegramPartialUpdateError {
1118    Status400(models::ValidationError),
1119    Status403(models::GenericError),
1120    UnknownValue(serde_json::Value),
1121}
1122
1123/// struct for typed errors of method [`sources_telegram_retrieve`]
1124#[derive(Debug, Clone, Serialize, Deserialize)]
1125#[serde(untagged)]
1126pub enum SourcesTelegramRetrieveError {
1127    Status400(models::ValidationError),
1128    Status403(models::GenericError),
1129    UnknownValue(serde_json::Value),
1130}
1131
1132/// struct for typed errors of method [`sources_telegram_update`]
1133#[derive(Debug, Clone, Serialize, Deserialize)]
1134#[serde(untagged)]
1135pub enum SourcesTelegramUpdateError {
1136    Status400(models::ValidationError),
1137    Status403(models::GenericError),
1138    UnknownValue(serde_json::Value),
1139}
1140
1141/// struct for typed errors of method [`sources_telegram_used_by_list`]
1142#[derive(Debug, Clone, Serialize, Deserialize)]
1143#[serde(untagged)]
1144pub enum SourcesTelegramUsedByListError {
1145    Status400(models::ValidationError),
1146    Status403(models::GenericError),
1147    UnknownValue(serde_json::Value),
1148}
1149
1150/// struct for typed errors of method [`sources_user_connections_all_destroy`]
1151#[derive(Debug, Clone, Serialize, Deserialize)]
1152#[serde(untagged)]
1153pub enum SourcesUserConnectionsAllDestroyError {
1154    Status400(models::ValidationError),
1155    Status403(models::GenericError),
1156    UnknownValue(serde_json::Value),
1157}
1158
1159/// struct for typed errors of method [`sources_user_connections_all_list`]
1160#[derive(Debug, Clone, Serialize, Deserialize)]
1161#[serde(untagged)]
1162pub enum SourcesUserConnectionsAllListError {
1163    Status400(models::ValidationError),
1164    Status403(models::GenericError),
1165    UnknownValue(serde_json::Value),
1166}
1167
1168/// struct for typed errors of method [`sources_user_connections_all_partial_update`]
1169#[derive(Debug, Clone, Serialize, Deserialize)]
1170#[serde(untagged)]
1171pub enum SourcesUserConnectionsAllPartialUpdateError {
1172    Status400(models::ValidationError),
1173    Status403(models::GenericError),
1174    UnknownValue(serde_json::Value),
1175}
1176
1177/// struct for typed errors of method [`sources_user_connections_all_retrieve`]
1178#[derive(Debug, Clone, Serialize, Deserialize)]
1179#[serde(untagged)]
1180pub enum SourcesUserConnectionsAllRetrieveError {
1181    Status400(models::ValidationError),
1182    Status403(models::GenericError),
1183    UnknownValue(serde_json::Value),
1184}
1185
1186/// struct for typed errors of method [`sources_user_connections_all_update`]
1187#[derive(Debug, Clone, Serialize, Deserialize)]
1188#[serde(untagged)]
1189pub enum SourcesUserConnectionsAllUpdateError {
1190    Status400(models::ValidationError),
1191    Status403(models::GenericError),
1192    UnknownValue(serde_json::Value),
1193}
1194
1195/// struct for typed errors of method [`sources_user_connections_all_used_by_list`]
1196#[derive(Debug, Clone, Serialize, Deserialize)]
1197#[serde(untagged)]
1198pub enum SourcesUserConnectionsAllUsedByListError {
1199    Status400(models::ValidationError),
1200    Status403(models::GenericError),
1201    UnknownValue(serde_json::Value),
1202}
1203
1204/// struct for typed errors of method [`sources_user_connections_kerberos_create`]
1205#[derive(Debug, Clone, Serialize, Deserialize)]
1206#[serde(untagged)]
1207pub enum SourcesUserConnectionsKerberosCreateError {
1208    Status400(models::ValidationError),
1209    Status403(models::GenericError),
1210    UnknownValue(serde_json::Value),
1211}
1212
1213/// struct for typed errors of method [`sources_user_connections_kerberos_destroy`]
1214#[derive(Debug, Clone, Serialize, Deserialize)]
1215#[serde(untagged)]
1216pub enum SourcesUserConnectionsKerberosDestroyError {
1217    Status400(models::ValidationError),
1218    Status403(models::GenericError),
1219    UnknownValue(serde_json::Value),
1220}
1221
1222/// struct for typed errors of method [`sources_user_connections_kerberos_list`]
1223#[derive(Debug, Clone, Serialize, Deserialize)]
1224#[serde(untagged)]
1225pub enum SourcesUserConnectionsKerberosListError {
1226    Status400(models::ValidationError),
1227    Status403(models::GenericError),
1228    UnknownValue(serde_json::Value),
1229}
1230
1231/// struct for typed errors of method [`sources_user_connections_kerberos_partial_update`]
1232#[derive(Debug, Clone, Serialize, Deserialize)]
1233#[serde(untagged)]
1234pub enum SourcesUserConnectionsKerberosPartialUpdateError {
1235    Status400(models::ValidationError),
1236    Status403(models::GenericError),
1237    UnknownValue(serde_json::Value),
1238}
1239
1240/// struct for typed errors of method [`sources_user_connections_kerberos_retrieve`]
1241#[derive(Debug, Clone, Serialize, Deserialize)]
1242#[serde(untagged)]
1243pub enum SourcesUserConnectionsKerberosRetrieveError {
1244    Status400(models::ValidationError),
1245    Status403(models::GenericError),
1246    UnknownValue(serde_json::Value),
1247}
1248
1249/// struct for typed errors of method [`sources_user_connections_kerberos_update`]
1250#[derive(Debug, Clone, Serialize, Deserialize)]
1251#[serde(untagged)]
1252pub enum SourcesUserConnectionsKerberosUpdateError {
1253    Status400(models::ValidationError),
1254    Status403(models::GenericError),
1255    UnknownValue(serde_json::Value),
1256}
1257
1258/// struct for typed errors of method [`sources_user_connections_kerberos_used_by_list`]
1259#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum SourcesUserConnectionsKerberosUsedByListError {
1262    Status400(models::ValidationError),
1263    Status403(models::GenericError),
1264    UnknownValue(serde_json::Value),
1265}
1266
1267/// struct for typed errors of method [`sources_user_connections_ldap_create`]
1268#[derive(Debug, Clone, Serialize, Deserialize)]
1269#[serde(untagged)]
1270pub enum SourcesUserConnectionsLdapCreateError {
1271    Status400(models::ValidationError),
1272    Status403(models::GenericError),
1273    UnknownValue(serde_json::Value),
1274}
1275
1276/// struct for typed errors of method [`sources_user_connections_ldap_destroy`]
1277#[derive(Debug, Clone, Serialize, Deserialize)]
1278#[serde(untagged)]
1279pub enum SourcesUserConnectionsLdapDestroyError {
1280    Status400(models::ValidationError),
1281    Status403(models::GenericError),
1282    UnknownValue(serde_json::Value),
1283}
1284
1285/// struct for typed errors of method [`sources_user_connections_ldap_list`]
1286#[derive(Debug, Clone, Serialize, Deserialize)]
1287#[serde(untagged)]
1288pub enum SourcesUserConnectionsLdapListError {
1289    Status400(models::ValidationError),
1290    Status403(models::GenericError),
1291    UnknownValue(serde_json::Value),
1292}
1293
1294/// struct for typed errors of method [`sources_user_connections_ldap_partial_update`]
1295#[derive(Debug, Clone, Serialize, Deserialize)]
1296#[serde(untagged)]
1297pub enum SourcesUserConnectionsLdapPartialUpdateError {
1298    Status400(models::ValidationError),
1299    Status403(models::GenericError),
1300    UnknownValue(serde_json::Value),
1301}
1302
1303/// struct for typed errors of method [`sources_user_connections_ldap_retrieve`]
1304#[derive(Debug, Clone, Serialize, Deserialize)]
1305#[serde(untagged)]
1306pub enum SourcesUserConnectionsLdapRetrieveError {
1307    Status400(models::ValidationError),
1308    Status403(models::GenericError),
1309    UnknownValue(serde_json::Value),
1310}
1311
1312/// struct for typed errors of method [`sources_user_connections_ldap_update`]
1313#[derive(Debug, Clone, Serialize, Deserialize)]
1314#[serde(untagged)]
1315pub enum SourcesUserConnectionsLdapUpdateError {
1316    Status400(models::ValidationError),
1317    Status403(models::GenericError),
1318    UnknownValue(serde_json::Value),
1319}
1320
1321/// struct for typed errors of method [`sources_user_connections_ldap_used_by_list`]
1322#[derive(Debug, Clone, Serialize, Deserialize)]
1323#[serde(untagged)]
1324pub enum SourcesUserConnectionsLdapUsedByListError {
1325    Status400(models::ValidationError),
1326    Status403(models::GenericError),
1327    UnknownValue(serde_json::Value),
1328}
1329
1330/// struct for typed errors of method [`sources_user_connections_oauth_create`]
1331#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum SourcesUserConnectionsOauthCreateError {
1334    Status400(models::ValidationError),
1335    Status403(models::GenericError),
1336    UnknownValue(serde_json::Value),
1337}
1338
1339/// struct for typed errors of method [`sources_user_connections_oauth_destroy`]
1340#[derive(Debug, Clone, Serialize, Deserialize)]
1341#[serde(untagged)]
1342pub enum SourcesUserConnectionsOauthDestroyError {
1343    Status400(models::ValidationError),
1344    Status403(models::GenericError),
1345    UnknownValue(serde_json::Value),
1346}
1347
1348/// struct for typed errors of method [`sources_user_connections_oauth_list`]
1349#[derive(Debug, Clone, Serialize, Deserialize)]
1350#[serde(untagged)]
1351pub enum SourcesUserConnectionsOauthListError {
1352    Status400(models::ValidationError),
1353    Status403(models::GenericError),
1354    UnknownValue(serde_json::Value),
1355}
1356
1357/// struct for typed errors of method [`sources_user_connections_oauth_partial_update`]
1358#[derive(Debug, Clone, Serialize, Deserialize)]
1359#[serde(untagged)]
1360pub enum SourcesUserConnectionsOauthPartialUpdateError {
1361    Status400(models::ValidationError),
1362    Status403(models::GenericError),
1363    UnknownValue(serde_json::Value),
1364}
1365
1366/// struct for typed errors of method [`sources_user_connections_oauth_retrieve`]
1367#[derive(Debug, Clone, Serialize, Deserialize)]
1368#[serde(untagged)]
1369pub enum SourcesUserConnectionsOauthRetrieveError {
1370    Status400(models::ValidationError),
1371    Status403(models::GenericError),
1372    UnknownValue(serde_json::Value),
1373}
1374
1375/// struct for typed errors of method [`sources_user_connections_oauth_update`]
1376#[derive(Debug, Clone, Serialize, Deserialize)]
1377#[serde(untagged)]
1378pub enum SourcesUserConnectionsOauthUpdateError {
1379    Status400(models::ValidationError),
1380    Status403(models::GenericError),
1381    UnknownValue(serde_json::Value),
1382}
1383
1384/// struct for typed errors of method [`sources_user_connections_oauth_used_by_list`]
1385#[derive(Debug, Clone, Serialize, Deserialize)]
1386#[serde(untagged)]
1387pub enum SourcesUserConnectionsOauthUsedByListError {
1388    Status400(models::ValidationError),
1389    Status403(models::GenericError),
1390    UnknownValue(serde_json::Value),
1391}
1392
1393/// struct for typed errors of method [`sources_user_connections_plex_create`]
1394#[derive(Debug, Clone, Serialize, Deserialize)]
1395#[serde(untagged)]
1396pub enum SourcesUserConnectionsPlexCreateError {
1397    Status400(models::ValidationError),
1398    Status403(models::GenericError),
1399    UnknownValue(serde_json::Value),
1400}
1401
1402/// struct for typed errors of method [`sources_user_connections_plex_destroy`]
1403#[derive(Debug, Clone, Serialize, Deserialize)]
1404#[serde(untagged)]
1405pub enum SourcesUserConnectionsPlexDestroyError {
1406    Status400(models::ValidationError),
1407    Status403(models::GenericError),
1408    UnknownValue(serde_json::Value),
1409}
1410
1411/// struct for typed errors of method [`sources_user_connections_plex_list`]
1412#[derive(Debug, Clone, Serialize, Deserialize)]
1413#[serde(untagged)]
1414pub enum SourcesUserConnectionsPlexListError {
1415    Status400(models::ValidationError),
1416    Status403(models::GenericError),
1417    UnknownValue(serde_json::Value),
1418}
1419
1420/// struct for typed errors of method [`sources_user_connections_plex_partial_update`]
1421#[derive(Debug, Clone, Serialize, Deserialize)]
1422#[serde(untagged)]
1423pub enum SourcesUserConnectionsPlexPartialUpdateError {
1424    Status400(models::ValidationError),
1425    Status403(models::GenericError),
1426    UnknownValue(serde_json::Value),
1427}
1428
1429/// struct for typed errors of method [`sources_user_connections_plex_retrieve`]
1430#[derive(Debug, Clone, Serialize, Deserialize)]
1431#[serde(untagged)]
1432pub enum SourcesUserConnectionsPlexRetrieveError {
1433    Status400(models::ValidationError),
1434    Status403(models::GenericError),
1435    UnknownValue(serde_json::Value),
1436}
1437
1438/// struct for typed errors of method [`sources_user_connections_plex_update`]
1439#[derive(Debug, Clone, Serialize, Deserialize)]
1440#[serde(untagged)]
1441pub enum SourcesUserConnectionsPlexUpdateError {
1442    Status400(models::ValidationError),
1443    Status403(models::GenericError),
1444    UnknownValue(serde_json::Value),
1445}
1446
1447/// struct for typed errors of method [`sources_user_connections_plex_used_by_list`]
1448#[derive(Debug, Clone, Serialize, Deserialize)]
1449#[serde(untagged)]
1450pub enum SourcesUserConnectionsPlexUsedByListError {
1451    Status400(models::ValidationError),
1452    Status403(models::GenericError),
1453    UnknownValue(serde_json::Value),
1454}
1455
1456/// struct for typed errors of method [`sources_user_connections_saml_create`]
1457#[derive(Debug, Clone, Serialize, Deserialize)]
1458#[serde(untagged)]
1459pub enum SourcesUserConnectionsSamlCreateError {
1460    Status400(models::ValidationError),
1461    Status403(models::GenericError),
1462    UnknownValue(serde_json::Value),
1463}
1464
1465/// struct for typed errors of method [`sources_user_connections_saml_destroy`]
1466#[derive(Debug, Clone, Serialize, Deserialize)]
1467#[serde(untagged)]
1468pub enum SourcesUserConnectionsSamlDestroyError {
1469    Status400(models::ValidationError),
1470    Status403(models::GenericError),
1471    UnknownValue(serde_json::Value),
1472}
1473
1474/// struct for typed errors of method [`sources_user_connections_saml_list`]
1475#[derive(Debug, Clone, Serialize, Deserialize)]
1476#[serde(untagged)]
1477pub enum SourcesUserConnectionsSamlListError {
1478    Status400(models::ValidationError),
1479    Status403(models::GenericError),
1480    UnknownValue(serde_json::Value),
1481}
1482
1483/// struct for typed errors of method [`sources_user_connections_saml_partial_update`]
1484#[derive(Debug, Clone, Serialize, Deserialize)]
1485#[serde(untagged)]
1486pub enum SourcesUserConnectionsSamlPartialUpdateError {
1487    Status400(models::ValidationError),
1488    Status403(models::GenericError),
1489    UnknownValue(serde_json::Value),
1490}
1491
1492/// struct for typed errors of method [`sources_user_connections_saml_retrieve`]
1493#[derive(Debug, Clone, Serialize, Deserialize)]
1494#[serde(untagged)]
1495pub enum SourcesUserConnectionsSamlRetrieveError {
1496    Status400(models::ValidationError),
1497    Status403(models::GenericError),
1498    UnknownValue(serde_json::Value),
1499}
1500
1501/// struct for typed errors of method [`sources_user_connections_saml_update`]
1502#[derive(Debug, Clone, Serialize, Deserialize)]
1503#[serde(untagged)]
1504pub enum SourcesUserConnectionsSamlUpdateError {
1505    Status400(models::ValidationError),
1506    Status403(models::GenericError),
1507    UnknownValue(serde_json::Value),
1508}
1509
1510/// struct for typed errors of method [`sources_user_connections_saml_used_by_list`]
1511#[derive(Debug, Clone, Serialize, Deserialize)]
1512#[serde(untagged)]
1513pub enum SourcesUserConnectionsSamlUsedByListError {
1514    Status400(models::ValidationError),
1515    Status403(models::GenericError),
1516    UnknownValue(serde_json::Value),
1517}
1518
1519/// struct for typed errors of method [`sources_user_connections_telegram_create`]
1520#[derive(Debug, Clone, Serialize, Deserialize)]
1521#[serde(untagged)]
1522pub enum SourcesUserConnectionsTelegramCreateError {
1523    Status400(models::ValidationError),
1524    Status403(models::GenericError),
1525    UnknownValue(serde_json::Value),
1526}
1527
1528/// struct for typed errors of method [`sources_user_connections_telegram_destroy`]
1529#[derive(Debug, Clone, Serialize, Deserialize)]
1530#[serde(untagged)]
1531pub enum SourcesUserConnectionsTelegramDestroyError {
1532    Status400(models::ValidationError),
1533    Status403(models::GenericError),
1534    UnknownValue(serde_json::Value),
1535}
1536
1537/// struct for typed errors of method [`sources_user_connections_telegram_list`]
1538#[derive(Debug, Clone, Serialize, Deserialize)]
1539#[serde(untagged)]
1540pub enum SourcesUserConnectionsTelegramListError {
1541    Status400(models::ValidationError),
1542    Status403(models::GenericError),
1543    UnknownValue(serde_json::Value),
1544}
1545
1546/// struct for typed errors of method [`sources_user_connections_telegram_partial_update`]
1547#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(untagged)]
1549pub enum SourcesUserConnectionsTelegramPartialUpdateError {
1550    Status400(models::ValidationError),
1551    Status403(models::GenericError),
1552    UnknownValue(serde_json::Value),
1553}
1554
1555/// struct for typed errors of method [`sources_user_connections_telegram_retrieve`]
1556#[derive(Debug, Clone, Serialize, Deserialize)]
1557#[serde(untagged)]
1558pub enum SourcesUserConnectionsTelegramRetrieveError {
1559    Status400(models::ValidationError),
1560    Status403(models::GenericError),
1561    UnknownValue(serde_json::Value),
1562}
1563
1564/// struct for typed errors of method [`sources_user_connections_telegram_update`]
1565#[derive(Debug, Clone, Serialize, Deserialize)]
1566#[serde(untagged)]
1567pub enum SourcesUserConnectionsTelegramUpdateError {
1568    Status400(models::ValidationError),
1569    Status403(models::GenericError),
1570    UnknownValue(serde_json::Value),
1571}
1572
1573/// struct for typed errors of method [`sources_user_connections_telegram_used_by_list`]
1574#[derive(Debug, Clone, Serialize, Deserialize)]
1575#[serde(untagged)]
1576pub enum SourcesUserConnectionsTelegramUsedByListError {
1577    Status400(models::ValidationError),
1578    Status403(models::GenericError),
1579    UnknownValue(serde_json::Value),
1580}
1581
1582/// Prevent deletion of built-in sources
1583pub async fn sources_all_destroy(
1584    configuration: &configuration::Configuration,
1585    slug: &str,
1586) -> Result<(), Error<SourcesAllDestroyError>> {
1587    // add a prefix to parameters to efficiently prevent name collisions
1588    let p_path_slug = slug;
1589
1590    let uri_str = format!(
1591        "{}/sources/all/{slug}/",
1592        configuration.base_path,
1593        slug = crate::apis::urlencode(p_path_slug)
1594    );
1595    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1596
1597    if let Some(ref user_agent) = configuration.user_agent {
1598        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1599    }
1600    if let Some(ref token) = configuration.bearer_access_token {
1601        req_builder = req_builder.bearer_auth(token.to_owned());
1602    };
1603
1604    let req = req_builder.build()?;
1605    let resp = configuration.client.execute(req).await?;
1606
1607    let status = resp.status();
1608
1609    if !status.is_client_error() && !status.is_server_error() {
1610        Ok(())
1611    } else {
1612        let content = resp.text().await?;
1613        let entity: Option<SourcesAllDestroyError> = serde_json::from_str(&content).ok();
1614        Err(Error::ResponseError(ResponseContent {
1615            status,
1616            content,
1617            entity,
1618        }))
1619    }
1620}
1621
1622/// Source Viewset
1623pub async fn sources_all_list(
1624    configuration: &configuration::Configuration,
1625    managed: Option<&str>,
1626    name: Option<&str>,
1627    ordering: Option<&str>,
1628    page: Option<i32>,
1629    page_size: Option<i32>,
1630    pbm_uuid: Option<&str>,
1631    search: Option<&str>,
1632    slug: Option<&str>,
1633) -> Result<models::PaginatedSourceList, Error<SourcesAllListError>> {
1634    // add a prefix to parameters to efficiently prevent name collisions
1635    let p_query_managed = managed;
1636    let p_query_name = name;
1637    let p_query_ordering = ordering;
1638    let p_query_page = page;
1639    let p_query_page_size = page_size;
1640    let p_query_pbm_uuid = pbm_uuid;
1641    let p_query_search = search;
1642    let p_query_slug = slug;
1643
1644    let uri_str = format!("{}/sources/all/", configuration.base_path);
1645    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1646
1647    if let Some(ref param_value) = p_query_managed {
1648        req_builder = req_builder.query(&[("managed", &param_value.to_string())]);
1649    }
1650    if let Some(ref param_value) = p_query_name {
1651        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
1652    }
1653    if let Some(ref param_value) = p_query_ordering {
1654        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1655    }
1656    if let Some(ref param_value) = p_query_page {
1657        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1658    }
1659    if let Some(ref param_value) = p_query_page_size {
1660        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1661    }
1662    if let Some(ref param_value) = p_query_pbm_uuid {
1663        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
1664    }
1665    if let Some(ref param_value) = p_query_search {
1666        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1667    }
1668    if let Some(ref param_value) = p_query_slug {
1669        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
1670    }
1671    if let Some(ref user_agent) = configuration.user_agent {
1672        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1673    }
1674    if let Some(ref token) = configuration.bearer_access_token {
1675        req_builder = req_builder.bearer_auth(token.to_owned());
1676    };
1677
1678    let req = req_builder.build()?;
1679    let resp = configuration.client.execute(req).await?;
1680
1681    let status = resp.status();
1682    let content_type = resp
1683        .headers()
1684        .get("content-type")
1685        .and_then(|v| v.to_str().ok())
1686        .unwrap_or("application/octet-stream");
1687    let content_type = super::ContentType::from(content_type);
1688
1689    if !status.is_client_error() && !status.is_server_error() {
1690        let content = resp.text().await?;
1691        match content_type {
1692            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1693            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSourceList`"))),
1694            ContentType::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`")))),
1695        }
1696    } else {
1697        let content = resp.text().await?;
1698        let entity: Option<SourcesAllListError> = serde_json::from_str(&content).ok();
1699        Err(Error::ResponseError(ResponseContent {
1700            status,
1701            content,
1702            entity,
1703        }))
1704    }
1705}
1706
1707/// Source Viewset
1708pub async fn sources_all_retrieve(
1709    configuration: &configuration::Configuration,
1710    slug: &str,
1711) -> Result<models::Source, Error<SourcesAllRetrieveError>> {
1712    // add a prefix to parameters to efficiently prevent name collisions
1713    let p_path_slug = slug;
1714
1715    let uri_str = format!(
1716        "{}/sources/all/{slug}/",
1717        configuration.base_path,
1718        slug = crate::apis::urlencode(p_path_slug)
1719    );
1720    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1721
1722    if let Some(ref user_agent) = configuration.user_agent {
1723        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1724    }
1725    if let Some(ref token) = configuration.bearer_access_token {
1726        req_builder = req_builder.bearer_auth(token.to_owned());
1727    };
1728
1729    let req = req_builder.build()?;
1730    let resp = configuration.client.execute(req).await?;
1731
1732    let status = resp.status();
1733    let content_type = resp
1734        .headers()
1735        .get("content-type")
1736        .and_then(|v| v.to_str().ok())
1737        .unwrap_or("application/octet-stream");
1738    let content_type = super::ContentType::from(content_type);
1739
1740    if !status.is_client_error() && !status.is_server_error() {
1741        let content = resp.text().await?;
1742        match content_type {
1743            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1744            ContentType::Text => {
1745                return Err(Error::from(serde_json::Error::custom(
1746                    "Received `text/plain` content type response that cannot be converted to `models::Source`",
1747                )))
1748            }
1749            ContentType::Unsupported(unknown_type) => {
1750                return Err(Error::from(serde_json::Error::custom(format!(
1751                    "Received `{unknown_type}` content type response that cannot be converted to `models::Source`"
1752                ))))
1753            }
1754        }
1755    } else {
1756        let content = resp.text().await?;
1757        let entity: Option<SourcesAllRetrieveError> = serde_json::from_str(&content).ok();
1758        Err(Error::ResponseError(ResponseContent {
1759            status,
1760            content,
1761            entity,
1762        }))
1763    }
1764}
1765
1766/// Set source icon
1767pub async fn sources_all_set_icon_create(
1768    configuration: &configuration::Configuration,
1769    slug: &str,
1770    file: Option<std::path::PathBuf>,
1771    clear: Option<bool>,
1772) -> Result<(), Error<SourcesAllSetIconCreateError>> {
1773    // add a prefix to parameters to efficiently prevent name collisions
1774    let p_path_slug = slug;
1775    let p_form_file = file;
1776    let p_form_clear = clear;
1777
1778    let uri_str = format!(
1779        "{}/sources/all/{slug}/set_icon/",
1780        configuration.base_path,
1781        slug = crate::apis::urlencode(p_path_slug)
1782    );
1783    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1784
1785    if let Some(ref user_agent) = configuration.user_agent {
1786        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1787    }
1788    if let Some(ref token) = configuration.bearer_access_token {
1789        req_builder = req_builder.bearer_auth(token.to_owned());
1790    };
1791    let mut multipart_form = reqwest::multipart::Form::new();
1792    // TODO: support file upload for 'file' parameter
1793    if let Some(param_value) = p_form_clear {
1794        multipart_form = multipart_form.text("clear", param_value.to_string());
1795    }
1796    req_builder = req_builder.multipart(multipart_form);
1797
1798    let req = req_builder.build()?;
1799    let resp = configuration.client.execute(req).await?;
1800
1801    let status = resp.status();
1802
1803    if !status.is_client_error() && !status.is_server_error() {
1804        Ok(())
1805    } else {
1806        let content = resp.text().await?;
1807        let entity: Option<SourcesAllSetIconCreateError> = serde_json::from_str(&content).ok();
1808        Err(Error::ResponseError(ResponseContent {
1809            status,
1810            content,
1811            entity,
1812        }))
1813    }
1814}
1815
1816/// Set source icon (as URL)
1817pub async fn sources_all_set_icon_url_create(
1818    configuration: &configuration::Configuration,
1819    slug: &str,
1820    file_path_request: models::FilePathRequest,
1821) -> Result<(), Error<SourcesAllSetIconUrlCreateError>> {
1822    // add a prefix to parameters to efficiently prevent name collisions
1823    let p_path_slug = slug;
1824    let p_body_file_path_request = file_path_request;
1825
1826    let uri_str = format!(
1827        "{}/sources/all/{slug}/set_icon_url/",
1828        configuration.base_path,
1829        slug = crate::apis::urlencode(p_path_slug)
1830    );
1831    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1832
1833    if let Some(ref user_agent) = configuration.user_agent {
1834        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1835    }
1836    if let Some(ref token) = configuration.bearer_access_token {
1837        req_builder = req_builder.bearer_auth(token.to_owned());
1838    };
1839    req_builder = req_builder.json(&p_body_file_path_request);
1840
1841    let req = req_builder.build()?;
1842    let resp = configuration.client.execute(req).await?;
1843
1844    let status = resp.status();
1845
1846    if !status.is_client_error() && !status.is_server_error() {
1847        Ok(())
1848    } else {
1849        let content = resp.text().await?;
1850        let entity: Option<SourcesAllSetIconUrlCreateError> = serde_json::from_str(&content).ok();
1851        Err(Error::ResponseError(ResponseContent {
1852            status,
1853            content,
1854            entity,
1855        }))
1856    }
1857}
1858
1859/// Get all creatable types
1860pub async fn sources_all_types_list(
1861    configuration: &configuration::Configuration,
1862) -> Result<Vec<models::TypeCreate>, Error<SourcesAllTypesListError>> {
1863    let uri_str = format!("{}/sources/all/types/", configuration.base_path);
1864    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1865
1866    if let Some(ref user_agent) = configuration.user_agent {
1867        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1868    }
1869    if let Some(ref token) = configuration.bearer_access_token {
1870        req_builder = req_builder.bearer_auth(token.to_owned());
1871    };
1872
1873    let req = req_builder.build()?;
1874    let resp = configuration.client.execute(req).await?;
1875
1876    let status = resp.status();
1877    let content_type = resp
1878        .headers()
1879        .get("content-type")
1880        .and_then(|v| v.to_str().ok())
1881        .unwrap_or("application/octet-stream");
1882    let content_type = super::ContentType::from(content_type);
1883
1884    if !status.is_client_error() && !status.is_server_error() {
1885        let content = resp.text().await?;
1886        match content_type {
1887            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1888            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;`"))),
1889            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;`")))),
1890        }
1891    } else {
1892        let content = resp.text().await?;
1893        let entity: Option<SourcesAllTypesListError> = serde_json::from_str(&content).ok();
1894        Err(Error::ResponseError(ResponseContent {
1895            status,
1896            content,
1897            entity,
1898        }))
1899    }
1900}
1901
1902/// Get a list of all objects that use this object
1903pub async fn sources_all_used_by_list(
1904    configuration: &configuration::Configuration,
1905    slug: &str,
1906) -> Result<Vec<models::UsedBy>, Error<SourcesAllUsedByListError>> {
1907    // add a prefix to parameters to efficiently prevent name collisions
1908    let p_path_slug = slug;
1909
1910    let uri_str = format!(
1911        "{}/sources/all/{slug}/used_by/",
1912        configuration.base_path,
1913        slug = crate::apis::urlencode(p_path_slug)
1914    );
1915    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1916
1917    if let Some(ref user_agent) = configuration.user_agent {
1918        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1919    }
1920    if let Some(ref token) = configuration.bearer_access_token {
1921        req_builder = req_builder.bearer_auth(token.to_owned());
1922    };
1923
1924    let req = req_builder.build()?;
1925    let resp = configuration.client.execute(req).await?;
1926
1927    let status = resp.status();
1928    let content_type = resp
1929        .headers()
1930        .get("content-type")
1931        .and_then(|v| v.to_str().ok())
1932        .unwrap_or("application/octet-stream");
1933    let content_type = super::ContentType::from(content_type);
1934
1935    if !status.is_client_error() && !status.is_server_error() {
1936        let content = resp.text().await?;
1937        match content_type {
1938            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1939            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;`"))),
1940            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;`")))),
1941        }
1942    } else {
1943        let content = resp.text().await?;
1944        let entity: Option<SourcesAllUsedByListError> = serde_json::from_str(&content).ok();
1945        Err(Error::ResponseError(ResponseContent {
1946            status,
1947            content,
1948            entity,
1949        }))
1950    }
1951}
1952
1953/// Get all sources the user can configure
1954pub async fn sources_all_user_settings_list(
1955    configuration: &configuration::Configuration,
1956) -> Result<Vec<models::UserSetting>, Error<SourcesAllUserSettingsListError>> {
1957    let uri_str = format!("{}/sources/all/user_settings/", configuration.base_path);
1958    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1959
1960    if let Some(ref user_agent) = configuration.user_agent {
1961        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1962    }
1963    if let Some(ref token) = configuration.bearer_access_token {
1964        req_builder = req_builder.bearer_auth(token.to_owned());
1965    };
1966
1967    let req = req_builder.build()?;
1968    let resp = configuration.client.execute(req).await?;
1969
1970    let status = resp.status();
1971    let content_type = resp
1972        .headers()
1973        .get("content-type")
1974        .and_then(|v| v.to_str().ok())
1975        .unwrap_or("application/octet-stream");
1976    let content_type = super::ContentType::from(content_type);
1977
1978    if !status.is_client_error() && !status.is_server_error() {
1979        let content = resp.text().await?;
1980        match content_type {
1981            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1982            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;`"))),
1983            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;`")))),
1984        }
1985    } else {
1986        let content = resp.text().await?;
1987        let entity: Option<SourcesAllUserSettingsListError> = serde_json::from_str(&content).ok();
1988        Err(Error::ResponseError(ResponseContent {
1989            status,
1990            content,
1991            entity,
1992        }))
1993    }
1994}
1995
1996/// Group-source connection Viewset
1997pub async fn sources_group_connections_all_destroy(
1998    configuration: &configuration::Configuration,
1999    id: i32,
2000) -> Result<(), Error<SourcesGroupConnectionsAllDestroyError>> {
2001    // add a prefix to parameters to efficiently prevent name collisions
2002    let p_path_id = id;
2003
2004    let uri_str = format!(
2005        "{}/sources/group_connections/all/{id}/",
2006        configuration.base_path,
2007        id = p_path_id
2008    );
2009    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2010
2011    if let Some(ref user_agent) = configuration.user_agent {
2012        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2013    }
2014    if let Some(ref token) = configuration.bearer_access_token {
2015        req_builder = req_builder.bearer_auth(token.to_owned());
2016    };
2017
2018    let req = req_builder.build()?;
2019    let resp = configuration.client.execute(req).await?;
2020
2021    let status = resp.status();
2022
2023    if !status.is_client_error() && !status.is_server_error() {
2024        Ok(())
2025    } else {
2026        let content = resp.text().await?;
2027        let entity: Option<SourcesGroupConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
2028        Err(Error::ResponseError(ResponseContent {
2029            status,
2030            content,
2031            entity,
2032        }))
2033    }
2034}
2035
2036/// Group-source connection Viewset
2037pub async fn sources_group_connections_all_list(
2038    configuration: &configuration::Configuration,
2039    group: Option<&str>,
2040    ordering: Option<&str>,
2041    page: Option<i32>,
2042    page_size: Option<i32>,
2043    search: Option<&str>,
2044    source__slug: Option<&str>,
2045) -> Result<models::PaginatedGroupSourceConnectionList, Error<SourcesGroupConnectionsAllListError>> {
2046    // add a prefix to parameters to efficiently prevent name collisions
2047    let p_query_group = group;
2048    let p_query_ordering = ordering;
2049    let p_query_page = page;
2050    let p_query_page_size = page_size;
2051    let p_query_search = search;
2052    let p_query_source__slug = source__slug;
2053
2054    let uri_str = format!("{}/sources/group_connections/all/", configuration.base_path);
2055    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2056
2057    if let Some(ref param_value) = p_query_group {
2058        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
2059    }
2060    if let Some(ref param_value) = p_query_ordering {
2061        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2062    }
2063    if let Some(ref param_value) = p_query_page {
2064        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2065    }
2066    if let Some(ref param_value) = p_query_page_size {
2067        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2068    }
2069    if let Some(ref param_value) = p_query_search {
2070        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2071    }
2072    if let Some(ref param_value) = p_query_source__slug {
2073        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
2074    }
2075    if let Some(ref user_agent) = configuration.user_agent {
2076        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2077    }
2078    if let Some(ref token) = configuration.bearer_access_token {
2079        req_builder = req_builder.bearer_auth(token.to_owned());
2080    };
2081
2082    let req = req_builder.build()?;
2083    let resp = configuration.client.execute(req).await?;
2084
2085    let status = resp.status();
2086    let content_type = resp
2087        .headers()
2088        .get("content-type")
2089        .and_then(|v| v.to_str().ok())
2090        .unwrap_or("application/octet-stream");
2091    let content_type = super::ContentType::from(content_type);
2092
2093    if !status.is_client_error() && !status.is_server_error() {
2094        let content = resp.text().await?;
2095        match content_type {
2096            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2097            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupSourceConnectionList`"))),
2098            ContentType::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`")))),
2099        }
2100    } else {
2101        let content = resp.text().await?;
2102        let entity: Option<SourcesGroupConnectionsAllListError> = serde_json::from_str(&content).ok();
2103        Err(Error::ResponseError(ResponseContent {
2104            status,
2105            content,
2106            entity,
2107        }))
2108    }
2109}
2110
2111/// Group-source connection Viewset
2112pub async fn sources_group_connections_all_partial_update(
2113    configuration: &configuration::Configuration,
2114    id: i32,
2115    patched_group_source_connection_request: Option<models::PatchedGroupSourceConnectionRequest>,
2116) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllPartialUpdateError>> {
2117    // add a prefix to parameters to efficiently prevent name collisions
2118    let p_path_id = id;
2119    let p_body_patched_group_source_connection_request = patched_group_source_connection_request;
2120
2121    let uri_str = format!(
2122        "{}/sources/group_connections/all/{id}/",
2123        configuration.base_path,
2124        id = p_path_id
2125    );
2126    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2127
2128    if let Some(ref user_agent) = configuration.user_agent {
2129        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2130    }
2131    if let Some(ref token) = configuration.bearer_access_token {
2132        req_builder = req_builder.bearer_auth(token.to_owned());
2133    };
2134    req_builder = req_builder.json(&p_body_patched_group_source_connection_request);
2135
2136    let req = req_builder.build()?;
2137    let resp = configuration.client.execute(req).await?;
2138
2139    let status = resp.status();
2140    let content_type = resp
2141        .headers()
2142        .get("content-type")
2143        .and_then(|v| v.to_str().ok())
2144        .unwrap_or("application/octet-stream");
2145    let content_type = super::ContentType::from(content_type);
2146
2147    if !status.is_client_error() && !status.is_server_error() {
2148        let content = resp.text().await?;
2149        match content_type {
2150            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2151            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2152            ContentType::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`")))),
2153        }
2154    } else {
2155        let content = resp.text().await?;
2156        let entity: Option<SourcesGroupConnectionsAllPartialUpdateError> = serde_json::from_str(&content).ok();
2157        Err(Error::ResponseError(ResponseContent {
2158            status,
2159            content,
2160            entity,
2161        }))
2162    }
2163}
2164
2165/// Group-source connection Viewset
2166pub async fn sources_group_connections_all_retrieve(
2167    configuration: &configuration::Configuration,
2168    id: i32,
2169) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllRetrieveError>> {
2170    // add a prefix to parameters to efficiently prevent name collisions
2171    let p_path_id = id;
2172
2173    let uri_str = format!(
2174        "{}/sources/group_connections/all/{id}/",
2175        configuration.base_path,
2176        id = p_path_id
2177    );
2178    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2179
2180    if let Some(ref user_agent) = configuration.user_agent {
2181        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2182    }
2183    if let Some(ref token) = configuration.bearer_access_token {
2184        req_builder = req_builder.bearer_auth(token.to_owned());
2185    };
2186
2187    let req = req_builder.build()?;
2188    let resp = configuration.client.execute(req).await?;
2189
2190    let status = resp.status();
2191    let content_type = resp
2192        .headers()
2193        .get("content-type")
2194        .and_then(|v| v.to_str().ok())
2195        .unwrap_or("application/octet-stream");
2196    let content_type = super::ContentType::from(content_type);
2197
2198    if !status.is_client_error() && !status.is_server_error() {
2199        let content = resp.text().await?;
2200        match content_type {
2201            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2202            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2203            ContentType::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`")))),
2204        }
2205    } else {
2206        let content = resp.text().await?;
2207        let entity: Option<SourcesGroupConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
2208        Err(Error::ResponseError(ResponseContent {
2209            status,
2210            content,
2211            entity,
2212        }))
2213    }
2214}
2215
2216/// Group-source connection Viewset
2217pub async fn sources_group_connections_all_update(
2218    configuration: &configuration::Configuration,
2219    id: i32,
2220    group_source_connection_request: models::GroupSourceConnectionRequest,
2221) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllUpdateError>> {
2222    // add a prefix to parameters to efficiently prevent name collisions
2223    let p_path_id = id;
2224    let p_body_group_source_connection_request = group_source_connection_request;
2225
2226    let uri_str = format!(
2227        "{}/sources/group_connections/all/{id}/",
2228        configuration.base_path,
2229        id = p_path_id
2230    );
2231    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2232
2233    if let Some(ref user_agent) = configuration.user_agent {
2234        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2235    }
2236    if let Some(ref token) = configuration.bearer_access_token {
2237        req_builder = req_builder.bearer_auth(token.to_owned());
2238    };
2239    req_builder = req_builder.json(&p_body_group_source_connection_request);
2240
2241    let req = req_builder.build()?;
2242    let resp = configuration.client.execute(req).await?;
2243
2244    let status = resp.status();
2245    let content_type = resp
2246        .headers()
2247        .get("content-type")
2248        .and_then(|v| v.to_str().ok())
2249        .unwrap_or("application/octet-stream");
2250    let content_type = super::ContentType::from(content_type);
2251
2252    if !status.is_client_error() && !status.is_server_error() {
2253        let content = resp.text().await?;
2254        match content_type {
2255            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2256            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2257            ContentType::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`")))),
2258        }
2259    } else {
2260        let content = resp.text().await?;
2261        let entity: Option<SourcesGroupConnectionsAllUpdateError> = serde_json::from_str(&content).ok();
2262        Err(Error::ResponseError(ResponseContent {
2263            status,
2264            content,
2265            entity,
2266        }))
2267    }
2268}
2269
2270/// Get a list of all objects that use this object
2271pub async fn sources_group_connections_all_used_by_list(
2272    configuration: &configuration::Configuration,
2273    id: i32,
2274) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsAllUsedByListError>> {
2275    // add a prefix to parameters to efficiently prevent name collisions
2276    let p_path_id = id;
2277
2278    let uri_str = format!(
2279        "{}/sources/group_connections/all/{id}/used_by/",
2280        configuration.base_path,
2281        id = p_path_id
2282    );
2283    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2284
2285    if let Some(ref user_agent) = configuration.user_agent {
2286        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2287    }
2288    if let Some(ref token) = configuration.bearer_access_token {
2289        req_builder = req_builder.bearer_auth(token.to_owned());
2290    };
2291
2292    let req = req_builder.build()?;
2293    let resp = configuration.client.execute(req).await?;
2294
2295    let status = resp.status();
2296    let content_type = resp
2297        .headers()
2298        .get("content-type")
2299        .and_then(|v| v.to_str().ok())
2300        .unwrap_or("application/octet-stream");
2301    let content_type = super::ContentType::from(content_type);
2302
2303    if !status.is_client_error() && !status.is_server_error() {
2304        let content = resp.text().await?;
2305        match content_type {
2306            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2307            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;`"))),
2308            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;`")))),
2309        }
2310    } else {
2311        let content = resp.text().await?;
2312        let entity: Option<SourcesGroupConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
2313        Err(Error::ResponseError(ResponseContent {
2314            status,
2315            content,
2316            entity,
2317        }))
2318    }
2319}
2320
2321/// Group-source connection Viewset
2322pub async fn sources_group_connections_kerberos_create(
2323    configuration: &configuration::Configuration,
2324    group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest,
2325) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosCreateError>> {
2326    // add a prefix to parameters to efficiently prevent name collisions
2327    let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request;
2328
2329    let uri_str = format!("{}/sources/group_connections/kerberos/", configuration.base_path);
2330    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2331
2332    if let Some(ref user_agent) = configuration.user_agent {
2333        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2334    }
2335    if let Some(ref token) = configuration.bearer_access_token {
2336        req_builder = req_builder.bearer_auth(token.to_owned());
2337    };
2338    req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request);
2339
2340    let req = req_builder.build()?;
2341    let resp = configuration.client.execute(req).await?;
2342
2343    let status = resp.status();
2344    let content_type = resp
2345        .headers()
2346        .get("content-type")
2347        .and_then(|v| v.to_str().ok())
2348        .unwrap_or("application/octet-stream");
2349    let content_type = super::ContentType::from(content_type);
2350
2351    if !status.is_client_error() && !status.is_server_error() {
2352        let content = resp.text().await?;
2353        match content_type {
2354            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2355            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2356            ContentType::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`")))),
2357        }
2358    } else {
2359        let content = resp.text().await?;
2360        let entity: Option<SourcesGroupConnectionsKerberosCreateError> = serde_json::from_str(&content).ok();
2361        Err(Error::ResponseError(ResponseContent {
2362            status,
2363            content,
2364            entity,
2365        }))
2366    }
2367}
2368
2369/// Group-source connection Viewset
2370pub async fn sources_group_connections_kerberos_destroy(
2371    configuration: &configuration::Configuration,
2372    id: i32,
2373) -> Result<(), Error<SourcesGroupConnectionsKerberosDestroyError>> {
2374    // add a prefix to parameters to efficiently prevent name collisions
2375    let p_path_id = id;
2376
2377    let uri_str = format!(
2378        "{}/sources/group_connections/kerberos/{id}/",
2379        configuration.base_path,
2380        id = p_path_id
2381    );
2382    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2383
2384    if let Some(ref user_agent) = configuration.user_agent {
2385        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2386    }
2387    if let Some(ref token) = configuration.bearer_access_token {
2388        req_builder = req_builder.bearer_auth(token.to_owned());
2389    };
2390
2391    let req = req_builder.build()?;
2392    let resp = configuration.client.execute(req).await?;
2393
2394    let status = resp.status();
2395
2396    if !status.is_client_error() && !status.is_server_error() {
2397        Ok(())
2398    } else {
2399        let content = resp.text().await?;
2400        let entity: Option<SourcesGroupConnectionsKerberosDestroyError> = serde_json::from_str(&content).ok();
2401        Err(Error::ResponseError(ResponseContent {
2402            status,
2403            content,
2404            entity,
2405        }))
2406    }
2407}
2408
2409/// Group-source connection Viewset
2410pub async fn sources_group_connections_kerberos_list(
2411    configuration: &configuration::Configuration,
2412    group: Option<&str>,
2413    ordering: Option<&str>,
2414    page: Option<i32>,
2415    page_size: Option<i32>,
2416    search: Option<&str>,
2417    source__slug: Option<&str>,
2418) -> Result<models::PaginatedGroupKerberosSourceConnectionList, Error<SourcesGroupConnectionsKerberosListError>> {
2419    // add a prefix to parameters to efficiently prevent name collisions
2420    let p_query_group = group;
2421    let p_query_ordering = ordering;
2422    let p_query_page = page;
2423    let p_query_page_size = page_size;
2424    let p_query_search = search;
2425    let p_query_source__slug = source__slug;
2426
2427    let uri_str = format!("{}/sources/group_connections/kerberos/", configuration.base_path);
2428    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2429
2430    if let Some(ref param_value) = p_query_group {
2431        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
2432    }
2433    if let Some(ref param_value) = p_query_ordering {
2434        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2435    }
2436    if let Some(ref param_value) = p_query_page {
2437        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2438    }
2439    if let Some(ref param_value) = p_query_page_size {
2440        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2441    }
2442    if let Some(ref param_value) = p_query_search {
2443        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2444    }
2445    if let Some(ref param_value) = p_query_source__slug {
2446        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
2447    }
2448    if let Some(ref user_agent) = configuration.user_agent {
2449        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2450    }
2451    if let Some(ref token) = configuration.bearer_access_token {
2452        req_builder = req_builder.bearer_auth(token.to_owned());
2453    };
2454
2455    let req = req_builder.build()?;
2456    let resp = configuration.client.execute(req).await?;
2457
2458    let status = resp.status();
2459    let content_type = resp
2460        .headers()
2461        .get("content-type")
2462        .and_then(|v| v.to_str().ok())
2463        .unwrap_or("application/octet-stream");
2464    let content_type = super::ContentType::from(content_type);
2465
2466    if !status.is_client_error() && !status.is_server_error() {
2467        let content = resp.text().await?;
2468        match content_type {
2469            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2470            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupKerberosSourceConnectionList`"))),
2471            ContentType::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`")))),
2472        }
2473    } else {
2474        let content = resp.text().await?;
2475        let entity: Option<SourcesGroupConnectionsKerberosListError> = serde_json::from_str(&content).ok();
2476        Err(Error::ResponseError(ResponseContent {
2477            status,
2478            content,
2479            entity,
2480        }))
2481    }
2482}
2483
2484/// Group-source connection Viewset
2485pub async fn sources_group_connections_kerberos_partial_update(
2486    configuration: &configuration::Configuration,
2487    id: i32,
2488    patched_group_kerberos_source_connection_request: Option<models::PatchedGroupKerberosSourceConnectionRequest>,
2489) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosPartialUpdateError>> {
2490    // add a prefix to parameters to efficiently prevent name collisions
2491    let p_path_id = id;
2492    let p_body_patched_group_kerberos_source_connection_request = patched_group_kerberos_source_connection_request;
2493
2494    let uri_str = format!(
2495        "{}/sources/group_connections/kerberos/{id}/",
2496        configuration.base_path,
2497        id = p_path_id
2498    );
2499    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2500
2501    if let Some(ref user_agent) = configuration.user_agent {
2502        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2503    }
2504    if let Some(ref token) = configuration.bearer_access_token {
2505        req_builder = req_builder.bearer_auth(token.to_owned());
2506    };
2507    req_builder = req_builder.json(&p_body_patched_group_kerberos_source_connection_request);
2508
2509    let req = req_builder.build()?;
2510    let resp = configuration.client.execute(req).await?;
2511
2512    let status = resp.status();
2513    let content_type = resp
2514        .headers()
2515        .get("content-type")
2516        .and_then(|v| v.to_str().ok())
2517        .unwrap_or("application/octet-stream");
2518    let content_type = super::ContentType::from(content_type);
2519
2520    if !status.is_client_error() && !status.is_server_error() {
2521        let content = resp.text().await?;
2522        match content_type {
2523            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2524            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2525            ContentType::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`")))),
2526        }
2527    } else {
2528        let content = resp.text().await?;
2529        let entity: Option<SourcesGroupConnectionsKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
2530        Err(Error::ResponseError(ResponseContent {
2531            status,
2532            content,
2533            entity,
2534        }))
2535    }
2536}
2537
2538/// Group-source connection Viewset
2539pub async fn sources_group_connections_kerberos_retrieve(
2540    configuration: &configuration::Configuration,
2541    id: i32,
2542) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosRetrieveError>> {
2543    // add a prefix to parameters to efficiently prevent name collisions
2544    let p_path_id = id;
2545
2546    let uri_str = format!(
2547        "{}/sources/group_connections/kerberos/{id}/",
2548        configuration.base_path,
2549        id = p_path_id
2550    );
2551    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2552
2553    if let Some(ref user_agent) = configuration.user_agent {
2554        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2555    }
2556    if let Some(ref token) = configuration.bearer_access_token {
2557        req_builder = req_builder.bearer_auth(token.to_owned());
2558    };
2559
2560    let req = req_builder.build()?;
2561    let resp = configuration.client.execute(req).await?;
2562
2563    let status = resp.status();
2564    let content_type = resp
2565        .headers()
2566        .get("content-type")
2567        .and_then(|v| v.to_str().ok())
2568        .unwrap_or("application/octet-stream");
2569    let content_type = super::ContentType::from(content_type);
2570
2571    if !status.is_client_error() && !status.is_server_error() {
2572        let content = resp.text().await?;
2573        match content_type {
2574            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2575            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2576            ContentType::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`")))),
2577        }
2578    } else {
2579        let content = resp.text().await?;
2580        let entity: Option<SourcesGroupConnectionsKerberosRetrieveError> = serde_json::from_str(&content).ok();
2581        Err(Error::ResponseError(ResponseContent {
2582            status,
2583            content,
2584            entity,
2585        }))
2586    }
2587}
2588
2589/// Group-source connection Viewset
2590pub async fn sources_group_connections_kerberos_update(
2591    configuration: &configuration::Configuration,
2592    id: i32,
2593    group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest,
2594) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosUpdateError>> {
2595    // add a prefix to parameters to efficiently prevent name collisions
2596    let p_path_id = id;
2597    let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request;
2598
2599    let uri_str = format!(
2600        "{}/sources/group_connections/kerberos/{id}/",
2601        configuration.base_path,
2602        id = p_path_id
2603    );
2604    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2605
2606    if let Some(ref user_agent) = configuration.user_agent {
2607        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2608    }
2609    if let Some(ref token) = configuration.bearer_access_token {
2610        req_builder = req_builder.bearer_auth(token.to_owned());
2611    };
2612    req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request);
2613
2614    let req = req_builder.build()?;
2615    let resp = configuration.client.execute(req).await?;
2616
2617    let status = resp.status();
2618    let content_type = resp
2619        .headers()
2620        .get("content-type")
2621        .and_then(|v| v.to_str().ok())
2622        .unwrap_or("application/octet-stream");
2623    let content_type = super::ContentType::from(content_type);
2624
2625    if !status.is_client_error() && !status.is_server_error() {
2626        let content = resp.text().await?;
2627        match content_type {
2628            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2629            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2630            ContentType::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`")))),
2631        }
2632    } else {
2633        let content = resp.text().await?;
2634        let entity: Option<SourcesGroupConnectionsKerberosUpdateError> = serde_json::from_str(&content).ok();
2635        Err(Error::ResponseError(ResponseContent {
2636            status,
2637            content,
2638            entity,
2639        }))
2640    }
2641}
2642
2643/// Get a list of all objects that use this object
2644pub async fn sources_group_connections_kerberos_used_by_list(
2645    configuration: &configuration::Configuration,
2646    id: i32,
2647) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsKerberosUsedByListError>> {
2648    // add a prefix to parameters to efficiently prevent name collisions
2649    let p_path_id = id;
2650
2651    let uri_str = format!(
2652        "{}/sources/group_connections/kerberos/{id}/used_by/",
2653        configuration.base_path,
2654        id = p_path_id
2655    );
2656    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2657
2658    if let Some(ref user_agent) = configuration.user_agent {
2659        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2660    }
2661    if let Some(ref token) = configuration.bearer_access_token {
2662        req_builder = req_builder.bearer_auth(token.to_owned());
2663    };
2664
2665    let req = req_builder.build()?;
2666    let resp = configuration.client.execute(req).await?;
2667
2668    let status = resp.status();
2669    let content_type = resp
2670        .headers()
2671        .get("content-type")
2672        .and_then(|v| v.to_str().ok())
2673        .unwrap_or("application/octet-stream");
2674    let content_type = super::ContentType::from(content_type);
2675
2676    if !status.is_client_error() && !status.is_server_error() {
2677        let content = resp.text().await?;
2678        match content_type {
2679            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2680            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;`"))),
2681            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;`")))),
2682        }
2683    } else {
2684        let content = resp.text().await?;
2685        let entity: Option<SourcesGroupConnectionsKerberosUsedByListError> = serde_json::from_str(&content).ok();
2686        Err(Error::ResponseError(ResponseContent {
2687            status,
2688            content,
2689            entity,
2690        }))
2691    }
2692}
2693
2694/// Group-source connection Viewset
2695pub async fn sources_group_connections_ldap_create(
2696    configuration: &configuration::Configuration,
2697    group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest,
2698) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapCreateError>> {
2699    // add a prefix to parameters to efficiently prevent name collisions
2700    let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request;
2701
2702    let uri_str = format!("{}/sources/group_connections/ldap/", configuration.base_path);
2703    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2704
2705    if let Some(ref user_agent) = configuration.user_agent {
2706        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2707    }
2708    if let Some(ref token) = configuration.bearer_access_token {
2709        req_builder = req_builder.bearer_auth(token.to_owned());
2710    };
2711    req_builder = req_builder.json(&p_body_group_ldap_source_connection_request);
2712
2713    let req = req_builder.build()?;
2714    let resp = configuration.client.execute(req).await?;
2715
2716    let status = resp.status();
2717    let content_type = resp
2718        .headers()
2719        .get("content-type")
2720        .and_then(|v| v.to_str().ok())
2721        .unwrap_or("application/octet-stream");
2722    let content_type = super::ContentType::from(content_type);
2723
2724    if !status.is_client_error() && !status.is_server_error() {
2725        let content = resp.text().await?;
2726        match content_type {
2727            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2728            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2729            ContentType::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`")))),
2730        }
2731    } else {
2732        let content = resp.text().await?;
2733        let entity: Option<SourcesGroupConnectionsLdapCreateError> = serde_json::from_str(&content).ok();
2734        Err(Error::ResponseError(ResponseContent {
2735            status,
2736            content,
2737            entity,
2738        }))
2739    }
2740}
2741
2742/// Group-source connection Viewset
2743pub async fn sources_group_connections_ldap_destroy(
2744    configuration: &configuration::Configuration,
2745    id: i32,
2746) -> Result<(), Error<SourcesGroupConnectionsLdapDestroyError>> {
2747    // add a prefix to parameters to efficiently prevent name collisions
2748    let p_path_id = id;
2749
2750    let uri_str = format!(
2751        "{}/sources/group_connections/ldap/{id}/",
2752        configuration.base_path,
2753        id = p_path_id
2754    );
2755    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2756
2757    if let Some(ref user_agent) = configuration.user_agent {
2758        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2759    }
2760    if let Some(ref token) = configuration.bearer_access_token {
2761        req_builder = req_builder.bearer_auth(token.to_owned());
2762    };
2763
2764    let req = req_builder.build()?;
2765    let resp = configuration.client.execute(req).await?;
2766
2767    let status = resp.status();
2768
2769    if !status.is_client_error() && !status.is_server_error() {
2770        Ok(())
2771    } else {
2772        let content = resp.text().await?;
2773        let entity: Option<SourcesGroupConnectionsLdapDestroyError> = serde_json::from_str(&content).ok();
2774        Err(Error::ResponseError(ResponseContent {
2775            status,
2776            content,
2777            entity,
2778        }))
2779    }
2780}
2781
2782/// Group-source connection Viewset
2783pub async fn sources_group_connections_ldap_list(
2784    configuration: &configuration::Configuration,
2785    group: Option<&str>,
2786    ordering: Option<&str>,
2787    page: Option<i32>,
2788    page_size: Option<i32>,
2789    search: Option<&str>,
2790    source__slug: Option<&str>,
2791) -> Result<models::PaginatedGroupLdapSourceConnectionList, Error<SourcesGroupConnectionsLdapListError>> {
2792    // add a prefix to parameters to efficiently prevent name collisions
2793    let p_query_group = group;
2794    let p_query_ordering = ordering;
2795    let p_query_page = page;
2796    let p_query_page_size = page_size;
2797    let p_query_search = search;
2798    let p_query_source__slug = source__slug;
2799
2800    let uri_str = format!("{}/sources/group_connections/ldap/", configuration.base_path);
2801    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2802
2803    if let Some(ref param_value) = p_query_group {
2804        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
2805    }
2806    if let Some(ref param_value) = p_query_ordering {
2807        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2808    }
2809    if let Some(ref param_value) = p_query_page {
2810        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2811    }
2812    if let Some(ref param_value) = p_query_page_size {
2813        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2814    }
2815    if let Some(ref param_value) = p_query_search {
2816        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2817    }
2818    if let Some(ref param_value) = p_query_source__slug {
2819        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
2820    }
2821    if let Some(ref user_agent) = configuration.user_agent {
2822        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2823    }
2824    if let Some(ref token) = configuration.bearer_access_token {
2825        req_builder = req_builder.bearer_auth(token.to_owned());
2826    };
2827
2828    let req = req_builder.build()?;
2829    let resp = configuration.client.execute(req).await?;
2830
2831    let status = resp.status();
2832    let content_type = resp
2833        .headers()
2834        .get("content-type")
2835        .and_then(|v| v.to_str().ok())
2836        .unwrap_or("application/octet-stream");
2837    let content_type = super::ContentType::from(content_type);
2838
2839    if !status.is_client_error() && !status.is_server_error() {
2840        let content = resp.text().await?;
2841        match content_type {
2842            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2843            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupLdapSourceConnectionList`"))),
2844            ContentType::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`")))),
2845        }
2846    } else {
2847        let content = resp.text().await?;
2848        let entity: Option<SourcesGroupConnectionsLdapListError> = serde_json::from_str(&content).ok();
2849        Err(Error::ResponseError(ResponseContent {
2850            status,
2851            content,
2852            entity,
2853        }))
2854    }
2855}
2856
2857/// Group-source connection Viewset
2858pub async fn sources_group_connections_ldap_partial_update(
2859    configuration: &configuration::Configuration,
2860    id: i32,
2861    patched_group_ldap_source_connection_request: Option<models::PatchedGroupLdapSourceConnectionRequest>,
2862) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapPartialUpdateError>> {
2863    // add a prefix to parameters to efficiently prevent name collisions
2864    let p_path_id = id;
2865    let p_body_patched_group_ldap_source_connection_request = patched_group_ldap_source_connection_request;
2866
2867    let uri_str = format!(
2868        "{}/sources/group_connections/ldap/{id}/",
2869        configuration.base_path,
2870        id = p_path_id
2871    );
2872    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2873
2874    if let Some(ref user_agent) = configuration.user_agent {
2875        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2876    }
2877    if let Some(ref token) = configuration.bearer_access_token {
2878        req_builder = req_builder.bearer_auth(token.to_owned());
2879    };
2880    req_builder = req_builder.json(&p_body_patched_group_ldap_source_connection_request);
2881
2882    let req = req_builder.build()?;
2883    let resp = configuration.client.execute(req).await?;
2884
2885    let status = resp.status();
2886    let content_type = resp
2887        .headers()
2888        .get("content-type")
2889        .and_then(|v| v.to_str().ok())
2890        .unwrap_or("application/octet-stream");
2891    let content_type = super::ContentType::from(content_type);
2892
2893    if !status.is_client_error() && !status.is_server_error() {
2894        let content = resp.text().await?;
2895        match content_type {
2896            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2897            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2898            ContentType::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`")))),
2899        }
2900    } else {
2901        let content = resp.text().await?;
2902        let entity: Option<SourcesGroupConnectionsLdapPartialUpdateError> = serde_json::from_str(&content).ok();
2903        Err(Error::ResponseError(ResponseContent {
2904            status,
2905            content,
2906            entity,
2907        }))
2908    }
2909}
2910
2911/// Group-source connection Viewset
2912pub async fn sources_group_connections_ldap_retrieve(
2913    configuration: &configuration::Configuration,
2914    id: i32,
2915) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapRetrieveError>> {
2916    // add a prefix to parameters to efficiently prevent name collisions
2917    let p_path_id = id;
2918
2919    let uri_str = format!(
2920        "{}/sources/group_connections/ldap/{id}/",
2921        configuration.base_path,
2922        id = p_path_id
2923    );
2924    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2925
2926    if let Some(ref user_agent) = configuration.user_agent {
2927        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2928    }
2929    if let Some(ref token) = configuration.bearer_access_token {
2930        req_builder = req_builder.bearer_auth(token.to_owned());
2931    };
2932
2933    let req = req_builder.build()?;
2934    let resp = configuration.client.execute(req).await?;
2935
2936    let status = resp.status();
2937    let content_type = resp
2938        .headers()
2939        .get("content-type")
2940        .and_then(|v| v.to_str().ok())
2941        .unwrap_or("application/octet-stream");
2942    let content_type = super::ContentType::from(content_type);
2943
2944    if !status.is_client_error() && !status.is_server_error() {
2945        let content = resp.text().await?;
2946        match content_type {
2947            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2948            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2949            ContentType::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`")))),
2950        }
2951    } else {
2952        let content = resp.text().await?;
2953        let entity: Option<SourcesGroupConnectionsLdapRetrieveError> = serde_json::from_str(&content).ok();
2954        Err(Error::ResponseError(ResponseContent {
2955            status,
2956            content,
2957            entity,
2958        }))
2959    }
2960}
2961
2962/// Group-source connection Viewset
2963pub async fn sources_group_connections_ldap_update(
2964    configuration: &configuration::Configuration,
2965    id: i32,
2966    group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest,
2967) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapUpdateError>> {
2968    // add a prefix to parameters to efficiently prevent name collisions
2969    let p_path_id = id;
2970    let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request;
2971
2972    let uri_str = format!(
2973        "{}/sources/group_connections/ldap/{id}/",
2974        configuration.base_path,
2975        id = p_path_id
2976    );
2977    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2978
2979    if let Some(ref user_agent) = configuration.user_agent {
2980        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2981    }
2982    if let Some(ref token) = configuration.bearer_access_token {
2983        req_builder = req_builder.bearer_auth(token.to_owned());
2984    };
2985    req_builder = req_builder.json(&p_body_group_ldap_source_connection_request);
2986
2987    let req = req_builder.build()?;
2988    let resp = configuration.client.execute(req).await?;
2989
2990    let status = resp.status();
2991    let content_type = resp
2992        .headers()
2993        .get("content-type")
2994        .and_then(|v| v.to_str().ok())
2995        .unwrap_or("application/octet-stream");
2996    let content_type = super::ContentType::from(content_type);
2997
2998    if !status.is_client_error() && !status.is_server_error() {
2999        let content = resp.text().await?;
3000        match content_type {
3001            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3002            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
3003            ContentType::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`")))),
3004        }
3005    } else {
3006        let content = resp.text().await?;
3007        let entity: Option<SourcesGroupConnectionsLdapUpdateError> = serde_json::from_str(&content).ok();
3008        Err(Error::ResponseError(ResponseContent {
3009            status,
3010            content,
3011            entity,
3012        }))
3013    }
3014}
3015
3016/// Get a list of all objects that use this object
3017pub async fn sources_group_connections_ldap_used_by_list(
3018    configuration: &configuration::Configuration,
3019    id: i32,
3020) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsLdapUsedByListError>> {
3021    // add a prefix to parameters to efficiently prevent name collisions
3022    let p_path_id = id;
3023
3024    let uri_str = format!(
3025        "{}/sources/group_connections/ldap/{id}/used_by/",
3026        configuration.base_path,
3027        id = p_path_id
3028    );
3029    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3030
3031    if let Some(ref user_agent) = configuration.user_agent {
3032        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3033    }
3034    if let Some(ref token) = configuration.bearer_access_token {
3035        req_builder = req_builder.bearer_auth(token.to_owned());
3036    };
3037
3038    let req = req_builder.build()?;
3039    let resp = configuration.client.execute(req).await?;
3040
3041    let status = resp.status();
3042    let content_type = resp
3043        .headers()
3044        .get("content-type")
3045        .and_then(|v| v.to_str().ok())
3046        .unwrap_or("application/octet-stream");
3047    let content_type = super::ContentType::from(content_type);
3048
3049    if !status.is_client_error() && !status.is_server_error() {
3050        let content = resp.text().await?;
3051        match content_type {
3052            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3053            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;`"))),
3054            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;`")))),
3055        }
3056    } else {
3057        let content = resp.text().await?;
3058        let entity: Option<SourcesGroupConnectionsLdapUsedByListError> = serde_json::from_str(&content).ok();
3059        Err(Error::ResponseError(ResponseContent {
3060            status,
3061            content,
3062            entity,
3063        }))
3064    }
3065}
3066
3067/// Group-source connection Viewset
3068pub async fn sources_group_connections_oauth_create(
3069    configuration: &configuration::Configuration,
3070    group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest,
3071) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthCreateError>> {
3072    // add a prefix to parameters to efficiently prevent name collisions
3073    let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request;
3074
3075    let uri_str = format!("{}/sources/group_connections/oauth/", configuration.base_path);
3076    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3077
3078    if let Some(ref user_agent) = configuration.user_agent {
3079        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3080    }
3081    if let Some(ref token) = configuration.bearer_access_token {
3082        req_builder = req_builder.bearer_auth(token.to_owned());
3083    };
3084    req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request);
3085
3086    let req = req_builder.build()?;
3087    let resp = configuration.client.execute(req).await?;
3088
3089    let status = resp.status();
3090    let content_type = resp
3091        .headers()
3092        .get("content-type")
3093        .and_then(|v| v.to_str().ok())
3094        .unwrap_or("application/octet-stream");
3095    let content_type = super::ContentType::from(content_type);
3096
3097    if !status.is_client_error() && !status.is_server_error() {
3098        let content = resp.text().await?;
3099        match content_type {
3100            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3101            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3102            ContentType::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`")))),
3103        }
3104    } else {
3105        let content = resp.text().await?;
3106        let entity: Option<SourcesGroupConnectionsOauthCreateError> = serde_json::from_str(&content).ok();
3107        Err(Error::ResponseError(ResponseContent {
3108            status,
3109            content,
3110            entity,
3111        }))
3112    }
3113}
3114
3115/// Group-source connection Viewset
3116pub async fn sources_group_connections_oauth_destroy(
3117    configuration: &configuration::Configuration,
3118    id: i32,
3119) -> Result<(), Error<SourcesGroupConnectionsOauthDestroyError>> {
3120    // add a prefix to parameters to efficiently prevent name collisions
3121    let p_path_id = id;
3122
3123    let uri_str = format!(
3124        "{}/sources/group_connections/oauth/{id}/",
3125        configuration.base_path,
3126        id = p_path_id
3127    );
3128    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3129
3130    if let Some(ref user_agent) = configuration.user_agent {
3131        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3132    }
3133    if let Some(ref token) = configuration.bearer_access_token {
3134        req_builder = req_builder.bearer_auth(token.to_owned());
3135    };
3136
3137    let req = req_builder.build()?;
3138    let resp = configuration.client.execute(req).await?;
3139
3140    let status = resp.status();
3141
3142    if !status.is_client_error() && !status.is_server_error() {
3143        Ok(())
3144    } else {
3145        let content = resp.text().await?;
3146        let entity: Option<SourcesGroupConnectionsOauthDestroyError> = serde_json::from_str(&content).ok();
3147        Err(Error::ResponseError(ResponseContent {
3148            status,
3149            content,
3150            entity,
3151        }))
3152    }
3153}
3154
3155/// Group-source connection Viewset
3156pub async fn sources_group_connections_oauth_list(
3157    configuration: &configuration::Configuration,
3158    group: Option<&str>,
3159    ordering: Option<&str>,
3160    page: Option<i32>,
3161    page_size: Option<i32>,
3162    search: Option<&str>,
3163    source__slug: Option<&str>,
3164) -> Result<models::PaginatedGroupOAuthSourceConnectionList, Error<SourcesGroupConnectionsOauthListError>> {
3165    // add a prefix to parameters to efficiently prevent name collisions
3166    let p_query_group = group;
3167    let p_query_ordering = ordering;
3168    let p_query_page = page;
3169    let p_query_page_size = page_size;
3170    let p_query_search = search;
3171    let p_query_source__slug = source__slug;
3172
3173    let uri_str = format!("{}/sources/group_connections/oauth/", configuration.base_path);
3174    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3175
3176    if let Some(ref param_value) = p_query_group {
3177        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
3178    }
3179    if let Some(ref param_value) = p_query_ordering {
3180        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3181    }
3182    if let Some(ref param_value) = p_query_page {
3183        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3184    }
3185    if let Some(ref param_value) = p_query_page_size {
3186        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3187    }
3188    if let Some(ref param_value) = p_query_search {
3189        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3190    }
3191    if let Some(ref param_value) = p_query_source__slug {
3192        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
3193    }
3194    if let Some(ref user_agent) = configuration.user_agent {
3195        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3196    }
3197    if let Some(ref token) = configuration.bearer_access_token {
3198        req_builder = req_builder.bearer_auth(token.to_owned());
3199    };
3200
3201    let req = req_builder.build()?;
3202    let resp = configuration.client.execute(req).await?;
3203
3204    let status = resp.status();
3205    let content_type = resp
3206        .headers()
3207        .get("content-type")
3208        .and_then(|v| v.to_str().ok())
3209        .unwrap_or("application/octet-stream");
3210    let content_type = super::ContentType::from(content_type);
3211
3212    if !status.is_client_error() && !status.is_server_error() {
3213        let content = resp.text().await?;
3214        match content_type {
3215            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3216            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupOAuthSourceConnectionList`"))),
3217            ContentType::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`")))),
3218        }
3219    } else {
3220        let content = resp.text().await?;
3221        let entity: Option<SourcesGroupConnectionsOauthListError> = serde_json::from_str(&content).ok();
3222        Err(Error::ResponseError(ResponseContent {
3223            status,
3224            content,
3225            entity,
3226        }))
3227    }
3228}
3229
3230/// Group-source connection Viewset
3231pub async fn sources_group_connections_oauth_partial_update(
3232    configuration: &configuration::Configuration,
3233    id: i32,
3234    patched_group_o_auth_source_connection_request: Option<models::PatchedGroupOAuthSourceConnectionRequest>,
3235) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthPartialUpdateError>> {
3236    // add a prefix to parameters to efficiently prevent name collisions
3237    let p_path_id = id;
3238    let p_body_patched_group_o_auth_source_connection_request = patched_group_o_auth_source_connection_request;
3239
3240    let uri_str = format!(
3241        "{}/sources/group_connections/oauth/{id}/",
3242        configuration.base_path,
3243        id = p_path_id
3244    );
3245    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3246
3247    if let Some(ref user_agent) = configuration.user_agent {
3248        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3249    }
3250    if let Some(ref token) = configuration.bearer_access_token {
3251        req_builder = req_builder.bearer_auth(token.to_owned());
3252    };
3253    req_builder = req_builder.json(&p_body_patched_group_o_auth_source_connection_request);
3254
3255    let req = req_builder.build()?;
3256    let resp = configuration.client.execute(req).await?;
3257
3258    let status = resp.status();
3259    let content_type = resp
3260        .headers()
3261        .get("content-type")
3262        .and_then(|v| v.to_str().ok())
3263        .unwrap_or("application/octet-stream");
3264    let content_type = super::ContentType::from(content_type);
3265
3266    if !status.is_client_error() && !status.is_server_error() {
3267        let content = resp.text().await?;
3268        match content_type {
3269            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3270            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3271            ContentType::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`")))),
3272        }
3273    } else {
3274        let content = resp.text().await?;
3275        let entity: Option<SourcesGroupConnectionsOauthPartialUpdateError> = serde_json::from_str(&content).ok();
3276        Err(Error::ResponseError(ResponseContent {
3277            status,
3278            content,
3279            entity,
3280        }))
3281    }
3282}
3283
3284/// Group-source connection Viewset
3285pub async fn sources_group_connections_oauth_retrieve(
3286    configuration: &configuration::Configuration,
3287    id: i32,
3288) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthRetrieveError>> {
3289    // add a prefix to parameters to efficiently prevent name collisions
3290    let p_path_id = id;
3291
3292    let uri_str = format!(
3293        "{}/sources/group_connections/oauth/{id}/",
3294        configuration.base_path,
3295        id = p_path_id
3296    );
3297    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3298
3299    if let Some(ref user_agent) = configuration.user_agent {
3300        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3301    }
3302    if let Some(ref token) = configuration.bearer_access_token {
3303        req_builder = req_builder.bearer_auth(token.to_owned());
3304    };
3305
3306    let req = req_builder.build()?;
3307    let resp = configuration.client.execute(req).await?;
3308
3309    let status = resp.status();
3310    let content_type = resp
3311        .headers()
3312        .get("content-type")
3313        .and_then(|v| v.to_str().ok())
3314        .unwrap_or("application/octet-stream");
3315    let content_type = super::ContentType::from(content_type);
3316
3317    if !status.is_client_error() && !status.is_server_error() {
3318        let content = resp.text().await?;
3319        match content_type {
3320            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3321            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3322            ContentType::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`")))),
3323        }
3324    } else {
3325        let content = resp.text().await?;
3326        let entity: Option<SourcesGroupConnectionsOauthRetrieveError> = serde_json::from_str(&content).ok();
3327        Err(Error::ResponseError(ResponseContent {
3328            status,
3329            content,
3330            entity,
3331        }))
3332    }
3333}
3334
3335/// Group-source connection Viewset
3336pub async fn sources_group_connections_oauth_update(
3337    configuration: &configuration::Configuration,
3338    id: i32,
3339    group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest,
3340) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthUpdateError>> {
3341    // add a prefix to parameters to efficiently prevent name collisions
3342    let p_path_id = id;
3343    let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request;
3344
3345    let uri_str = format!(
3346        "{}/sources/group_connections/oauth/{id}/",
3347        configuration.base_path,
3348        id = p_path_id
3349    );
3350    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3351
3352    if let Some(ref user_agent) = configuration.user_agent {
3353        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3354    }
3355    if let Some(ref token) = configuration.bearer_access_token {
3356        req_builder = req_builder.bearer_auth(token.to_owned());
3357    };
3358    req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request);
3359
3360    let req = req_builder.build()?;
3361    let resp = configuration.client.execute(req).await?;
3362
3363    let status = resp.status();
3364    let content_type = resp
3365        .headers()
3366        .get("content-type")
3367        .and_then(|v| v.to_str().ok())
3368        .unwrap_or("application/octet-stream");
3369    let content_type = super::ContentType::from(content_type);
3370
3371    if !status.is_client_error() && !status.is_server_error() {
3372        let content = resp.text().await?;
3373        match content_type {
3374            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3375            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3376            ContentType::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`")))),
3377        }
3378    } else {
3379        let content = resp.text().await?;
3380        let entity: Option<SourcesGroupConnectionsOauthUpdateError> = serde_json::from_str(&content).ok();
3381        Err(Error::ResponseError(ResponseContent {
3382            status,
3383            content,
3384            entity,
3385        }))
3386    }
3387}
3388
3389/// Get a list of all objects that use this object
3390pub async fn sources_group_connections_oauth_used_by_list(
3391    configuration: &configuration::Configuration,
3392    id: i32,
3393) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsOauthUsedByListError>> {
3394    // add a prefix to parameters to efficiently prevent name collisions
3395    let p_path_id = id;
3396
3397    let uri_str = format!(
3398        "{}/sources/group_connections/oauth/{id}/used_by/",
3399        configuration.base_path,
3400        id = p_path_id
3401    );
3402    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3403
3404    if let Some(ref user_agent) = configuration.user_agent {
3405        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3406    }
3407    if let Some(ref token) = configuration.bearer_access_token {
3408        req_builder = req_builder.bearer_auth(token.to_owned());
3409    };
3410
3411    let req = req_builder.build()?;
3412    let resp = configuration.client.execute(req).await?;
3413
3414    let status = resp.status();
3415    let content_type = resp
3416        .headers()
3417        .get("content-type")
3418        .and_then(|v| v.to_str().ok())
3419        .unwrap_or("application/octet-stream");
3420    let content_type = super::ContentType::from(content_type);
3421
3422    if !status.is_client_error() && !status.is_server_error() {
3423        let content = resp.text().await?;
3424        match content_type {
3425            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3426            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;`"))),
3427            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;`")))),
3428        }
3429    } else {
3430        let content = resp.text().await?;
3431        let entity: Option<SourcesGroupConnectionsOauthUsedByListError> = serde_json::from_str(&content).ok();
3432        Err(Error::ResponseError(ResponseContent {
3433            status,
3434            content,
3435            entity,
3436        }))
3437    }
3438}
3439
3440/// Group-source connection Viewset
3441pub async fn sources_group_connections_plex_create(
3442    configuration: &configuration::Configuration,
3443    group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest,
3444) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexCreateError>> {
3445    // add a prefix to parameters to efficiently prevent name collisions
3446    let p_body_group_plex_source_connection_request = group_plex_source_connection_request;
3447
3448    let uri_str = format!("{}/sources/group_connections/plex/", configuration.base_path);
3449    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3450
3451    if let Some(ref user_agent) = configuration.user_agent {
3452        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3453    }
3454    if let Some(ref token) = configuration.bearer_access_token {
3455        req_builder = req_builder.bearer_auth(token.to_owned());
3456    };
3457    req_builder = req_builder.json(&p_body_group_plex_source_connection_request);
3458
3459    let req = req_builder.build()?;
3460    let resp = configuration.client.execute(req).await?;
3461
3462    let status = resp.status();
3463    let content_type = resp
3464        .headers()
3465        .get("content-type")
3466        .and_then(|v| v.to_str().ok())
3467        .unwrap_or("application/octet-stream");
3468    let content_type = super::ContentType::from(content_type);
3469
3470    if !status.is_client_error() && !status.is_server_error() {
3471        let content = resp.text().await?;
3472        match content_type {
3473            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3474            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3475            ContentType::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`")))),
3476        }
3477    } else {
3478        let content = resp.text().await?;
3479        let entity: Option<SourcesGroupConnectionsPlexCreateError> = serde_json::from_str(&content).ok();
3480        Err(Error::ResponseError(ResponseContent {
3481            status,
3482            content,
3483            entity,
3484        }))
3485    }
3486}
3487
3488/// Group-source connection Viewset
3489pub async fn sources_group_connections_plex_destroy(
3490    configuration: &configuration::Configuration,
3491    id: i32,
3492) -> Result<(), Error<SourcesGroupConnectionsPlexDestroyError>> {
3493    // add a prefix to parameters to efficiently prevent name collisions
3494    let p_path_id = id;
3495
3496    let uri_str = format!(
3497        "{}/sources/group_connections/plex/{id}/",
3498        configuration.base_path,
3499        id = p_path_id
3500    );
3501    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3502
3503    if let Some(ref user_agent) = configuration.user_agent {
3504        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3505    }
3506    if let Some(ref token) = configuration.bearer_access_token {
3507        req_builder = req_builder.bearer_auth(token.to_owned());
3508    };
3509
3510    let req = req_builder.build()?;
3511    let resp = configuration.client.execute(req).await?;
3512
3513    let status = resp.status();
3514
3515    if !status.is_client_error() && !status.is_server_error() {
3516        Ok(())
3517    } else {
3518        let content = resp.text().await?;
3519        let entity: Option<SourcesGroupConnectionsPlexDestroyError> = serde_json::from_str(&content).ok();
3520        Err(Error::ResponseError(ResponseContent {
3521            status,
3522            content,
3523            entity,
3524        }))
3525    }
3526}
3527
3528/// Group-source connection Viewset
3529pub async fn sources_group_connections_plex_list(
3530    configuration: &configuration::Configuration,
3531    group: Option<&str>,
3532    ordering: Option<&str>,
3533    page: Option<i32>,
3534    page_size: Option<i32>,
3535    search: Option<&str>,
3536    source__slug: Option<&str>,
3537) -> Result<models::PaginatedGroupPlexSourceConnectionList, Error<SourcesGroupConnectionsPlexListError>> {
3538    // add a prefix to parameters to efficiently prevent name collisions
3539    let p_query_group = group;
3540    let p_query_ordering = ordering;
3541    let p_query_page = page;
3542    let p_query_page_size = page_size;
3543    let p_query_search = search;
3544    let p_query_source__slug = source__slug;
3545
3546    let uri_str = format!("{}/sources/group_connections/plex/", configuration.base_path);
3547    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3548
3549    if let Some(ref param_value) = p_query_group {
3550        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
3551    }
3552    if let Some(ref param_value) = p_query_ordering {
3553        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3554    }
3555    if let Some(ref param_value) = p_query_page {
3556        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3557    }
3558    if let Some(ref param_value) = p_query_page_size {
3559        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3560    }
3561    if let Some(ref param_value) = p_query_search {
3562        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3563    }
3564    if let Some(ref param_value) = p_query_source__slug {
3565        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
3566    }
3567    if let Some(ref user_agent) = configuration.user_agent {
3568        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3569    }
3570    if let Some(ref token) = configuration.bearer_access_token {
3571        req_builder = req_builder.bearer_auth(token.to_owned());
3572    };
3573
3574    let req = req_builder.build()?;
3575    let resp = configuration.client.execute(req).await?;
3576
3577    let status = resp.status();
3578    let content_type = resp
3579        .headers()
3580        .get("content-type")
3581        .and_then(|v| v.to_str().ok())
3582        .unwrap_or("application/octet-stream");
3583    let content_type = super::ContentType::from(content_type);
3584
3585    if !status.is_client_error() && !status.is_server_error() {
3586        let content = resp.text().await?;
3587        match content_type {
3588            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3589            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupPlexSourceConnectionList`"))),
3590            ContentType::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`")))),
3591        }
3592    } else {
3593        let content = resp.text().await?;
3594        let entity: Option<SourcesGroupConnectionsPlexListError> = serde_json::from_str(&content).ok();
3595        Err(Error::ResponseError(ResponseContent {
3596            status,
3597            content,
3598            entity,
3599        }))
3600    }
3601}
3602
3603/// Group-source connection Viewset
3604pub async fn sources_group_connections_plex_partial_update(
3605    configuration: &configuration::Configuration,
3606    id: i32,
3607    patched_group_plex_source_connection_request: Option<models::PatchedGroupPlexSourceConnectionRequest>,
3608) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexPartialUpdateError>> {
3609    // add a prefix to parameters to efficiently prevent name collisions
3610    let p_path_id = id;
3611    let p_body_patched_group_plex_source_connection_request = patched_group_plex_source_connection_request;
3612
3613    let uri_str = format!(
3614        "{}/sources/group_connections/plex/{id}/",
3615        configuration.base_path,
3616        id = p_path_id
3617    );
3618    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3619
3620    if let Some(ref user_agent) = configuration.user_agent {
3621        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3622    }
3623    if let Some(ref token) = configuration.bearer_access_token {
3624        req_builder = req_builder.bearer_auth(token.to_owned());
3625    };
3626    req_builder = req_builder.json(&p_body_patched_group_plex_source_connection_request);
3627
3628    let req = req_builder.build()?;
3629    let resp = configuration.client.execute(req).await?;
3630
3631    let status = resp.status();
3632    let content_type = resp
3633        .headers()
3634        .get("content-type")
3635        .and_then(|v| v.to_str().ok())
3636        .unwrap_or("application/octet-stream");
3637    let content_type = super::ContentType::from(content_type);
3638
3639    if !status.is_client_error() && !status.is_server_error() {
3640        let content = resp.text().await?;
3641        match content_type {
3642            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3643            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3644            ContentType::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`")))),
3645        }
3646    } else {
3647        let content = resp.text().await?;
3648        let entity: Option<SourcesGroupConnectionsPlexPartialUpdateError> = serde_json::from_str(&content).ok();
3649        Err(Error::ResponseError(ResponseContent {
3650            status,
3651            content,
3652            entity,
3653        }))
3654    }
3655}
3656
3657/// Group-source connection Viewset
3658pub async fn sources_group_connections_plex_retrieve(
3659    configuration: &configuration::Configuration,
3660    id: i32,
3661) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexRetrieveError>> {
3662    // add a prefix to parameters to efficiently prevent name collisions
3663    let p_path_id = id;
3664
3665    let uri_str = format!(
3666        "{}/sources/group_connections/plex/{id}/",
3667        configuration.base_path,
3668        id = p_path_id
3669    );
3670    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3671
3672    if let Some(ref user_agent) = configuration.user_agent {
3673        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3674    }
3675    if let Some(ref token) = configuration.bearer_access_token {
3676        req_builder = req_builder.bearer_auth(token.to_owned());
3677    };
3678
3679    let req = req_builder.build()?;
3680    let resp = configuration.client.execute(req).await?;
3681
3682    let status = resp.status();
3683    let content_type = resp
3684        .headers()
3685        .get("content-type")
3686        .and_then(|v| v.to_str().ok())
3687        .unwrap_or("application/octet-stream");
3688    let content_type = super::ContentType::from(content_type);
3689
3690    if !status.is_client_error() && !status.is_server_error() {
3691        let content = resp.text().await?;
3692        match content_type {
3693            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3694            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3695            ContentType::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`")))),
3696        }
3697    } else {
3698        let content = resp.text().await?;
3699        let entity: Option<SourcesGroupConnectionsPlexRetrieveError> = serde_json::from_str(&content).ok();
3700        Err(Error::ResponseError(ResponseContent {
3701            status,
3702            content,
3703            entity,
3704        }))
3705    }
3706}
3707
3708/// Group-source connection Viewset
3709pub async fn sources_group_connections_plex_update(
3710    configuration: &configuration::Configuration,
3711    id: i32,
3712    group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest,
3713) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexUpdateError>> {
3714    // add a prefix to parameters to efficiently prevent name collisions
3715    let p_path_id = id;
3716    let p_body_group_plex_source_connection_request = group_plex_source_connection_request;
3717
3718    let uri_str = format!(
3719        "{}/sources/group_connections/plex/{id}/",
3720        configuration.base_path,
3721        id = p_path_id
3722    );
3723    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3724
3725    if let Some(ref user_agent) = configuration.user_agent {
3726        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3727    }
3728    if let Some(ref token) = configuration.bearer_access_token {
3729        req_builder = req_builder.bearer_auth(token.to_owned());
3730    };
3731    req_builder = req_builder.json(&p_body_group_plex_source_connection_request);
3732
3733    let req = req_builder.build()?;
3734    let resp = configuration.client.execute(req).await?;
3735
3736    let status = resp.status();
3737    let content_type = resp
3738        .headers()
3739        .get("content-type")
3740        .and_then(|v| v.to_str().ok())
3741        .unwrap_or("application/octet-stream");
3742    let content_type = super::ContentType::from(content_type);
3743
3744    if !status.is_client_error() && !status.is_server_error() {
3745        let content = resp.text().await?;
3746        match content_type {
3747            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3748            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3749            ContentType::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`")))),
3750        }
3751    } else {
3752        let content = resp.text().await?;
3753        let entity: Option<SourcesGroupConnectionsPlexUpdateError> = serde_json::from_str(&content).ok();
3754        Err(Error::ResponseError(ResponseContent {
3755            status,
3756            content,
3757            entity,
3758        }))
3759    }
3760}
3761
3762/// Get a list of all objects that use this object
3763pub async fn sources_group_connections_plex_used_by_list(
3764    configuration: &configuration::Configuration,
3765    id: i32,
3766) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsPlexUsedByListError>> {
3767    // add a prefix to parameters to efficiently prevent name collisions
3768    let p_path_id = id;
3769
3770    let uri_str = format!(
3771        "{}/sources/group_connections/plex/{id}/used_by/",
3772        configuration.base_path,
3773        id = p_path_id
3774    );
3775    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3776
3777    if let Some(ref user_agent) = configuration.user_agent {
3778        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3779    }
3780    if let Some(ref token) = configuration.bearer_access_token {
3781        req_builder = req_builder.bearer_auth(token.to_owned());
3782    };
3783
3784    let req = req_builder.build()?;
3785    let resp = configuration.client.execute(req).await?;
3786
3787    let status = resp.status();
3788    let content_type = resp
3789        .headers()
3790        .get("content-type")
3791        .and_then(|v| v.to_str().ok())
3792        .unwrap_or("application/octet-stream");
3793    let content_type = super::ContentType::from(content_type);
3794
3795    if !status.is_client_error() && !status.is_server_error() {
3796        let content = resp.text().await?;
3797        match content_type {
3798            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3799            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;`"))),
3800            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;`")))),
3801        }
3802    } else {
3803        let content = resp.text().await?;
3804        let entity: Option<SourcesGroupConnectionsPlexUsedByListError> = serde_json::from_str(&content).ok();
3805        Err(Error::ResponseError(ResponseContent {
3806            status,
3807            content,
3808            entity,
3809        }))
3810    }
3811}
3812
3813/// Group-source connection Viewset
3814pub async fn sources_group_connections_saml_create(
3815    configuration: &configuration::Configuration,
3816    group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest,
3817) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlCreateError>> {
3818    // add a prefix to parameters to efficiently prevent name collisions
3819    let p_body_group_saml_source_connection_request = group_saml_source_connection_request;
3820
3821    let uri_str = format!("{}/sources/group_connections/saml/", configuration.base_path);
3822    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3823
3824    if let Some(ref user_agent) = configuration.user_agent {
3825        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3826    }
3827    if let Some(ref token) = configuration.bearer_access_token {
3828        req_builder = req_builder.bearer_auth(token.to_owned());
3829    };
3830    req_builder = req_builder.json(&p_body_group_saml_source_connection_request);
3831
3832    let req = req_builder.build()?;
3833    let resp = configuration.client.execute(req).await?;
3834
3835    let status = resp.status();
3836    let content_type = resp
3837        .headers()
3838        .get("content-type")
3839        .and_then(|v| v.to_str().ok())
3840        .unwrap_or("application/octet-stream");
3841    let content_type = super::ContentType::from(content_type);
3842
3843    if !status.is_client_error() && !status.is_server_error() {
3844        let content = resp.text().await?;
3845        match content_type {
3846            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3847            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3848            ContentType::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`")))),
3849        }
3850    } else {
3851        let content = resp.text().await?;
3852        let entity: Option<SourcesGroupConnectionsSamlCreateError> = serde_json::from_str(&content).ok();
3853        Err(Error::ResponseError(ResponseContent {
3854            status,
3855            content,
3856            entity,
3857        }))
3858    }
3859}
3860
3861/// Group-source connection Viewset
3862pub async fn sources_group_connections_saml_destroy(
3863    configuration: &configuration::Configuration,
3864    id: i32,
3865) -> Result<(), Error<SourcesGroupConnectionsSamlDestroyError>> {
3866    // add a prefix to parameters to efficiently prevent name collisions
3867    let p_path_id = id;
3868
3869    let uri_str = format!(
3870        "{}/sources/group_connections/saml/{id}/",
3871        configuration.base_path,
3872        id = p_path_id
3873    );
3874    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3875
3876    if let Some(ref user_agent) = configuration.user_agent {
3877        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3878    }
3879    if let Some(ref token) = configuration.bearer_access_token {
3880        req_builder = req_builder.bearer_auth(token.to_owned());
3881    };
3882
3883    let req = req_builder.build()?;
3884    let resp = configuration.client.execute(req).await?;
3885
3886    let status = resp.status();
3887
3888    if !status.is_client_error() && !status.is_server_error() {
3889        Ok(())
3890    } else {
3891        let content = resp.text().await?;
3892        let entity: Option<SourcesGroupConnectionsSamlDestroyError> = serde_json::from_str(&content).ok();
3893        Err(Error::ResponseError(ResponseContent {
3894            status,
3895            content,
3896            entity,
3897        }))
3898    }
3899}
3900
3901/// Group-source connection Viewset
3902pub async fn sources_group_connections_saml_list(
3903    configuration: &configuration::Configuration,
3904    group: Option<&str>,
3905    ordering: Option<&str>,
3906    page: Option<i32>,
3907    page_size: Option<i32>,
3908    search: Option<&str>,
3909    source__slug: Option<&str>,
3910) -> Result<models::PaginatedGroupSamlSourceConnectionList, Error<SourcesGroupConnectionsSamlListError>> {
3911    // add a prefix to parameters to efficiently prevent name collisions
3912    let p_query_group = group;
3913    let p_query_ordering = ordering;
3914    let p_query_page = page;
3915    let p_query_page_size = page_size;
3916    let p_query_search = search;
3917    let p_query_source__slug = source__slug;
3918
3919    let uri_str = format!("{}/sources/group_connections/saml/", configuration.base_path);
3920    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3921
3922    if let Some(ref param_value) = p_query_group {
3923        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
3924    }
3925    if let Some(ref param_value) = p_query_ordering {
3926        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3927    }
3928    if let Some(ref param_value) = p_query_page {
3929        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3930    }
3931    if let Some(ref param_value) = p_query_page_size {
3932        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3933    }
3934    if let Some(ref param_value) = p_query_search {
3935        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3936    }
3937    if let Some(ref param_value) = p_query_source__slug {
3938        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
3939    }
3940    if let Some(ref user_agent) = configuration.user_agent {
3941        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3942    }
3943    if let Some(ref token) = configuration.bearer_access_token {
3944        req_builder = req_builder.bearer_auth(token.to_owned());
3945    };
3946
3947    let req = req_builder.build()?;
3948    let resp = configuration.client.execute(req).await?;
3949
3950    let status = resp.status();
3951    let content_type = resp
3952        .headers()
3953        .get("content-type")
3954        .and_then(|v| v.to_str().ok())
3955        .unwrap_or("application/octet-stream");
3956    let content_type = super::ContentType::from(content_type);
3957
3958    if !status.is_client_error() && !status.is_server_error() {
3959        let content = resp.text().await?;
3960        match content_type {
3961            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3962            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupSamlSourceConnectionList`"))),
3963            ContentType::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`")))),
3964        }
3965    } else {
3966        let content = resp.text().await?;
3967        let entity: Option<SourcesGroupConnectionsSamlListError> = serde_json::from_str(&content).ok();
3968        Err(Error::ResponseError(ResponseContent {
3969            status,
3970            content,
3971            entity,
3972        }))
3973    }
3974}
3975
3976/// Group-source connection Viewset
3977pub async fn sources_group_connections_saml_partial_update(
3978    configuration: &configuration::Configuration,
3979    id: i32,
3980    patched_group_saml_source_connection_request: Option<models::PatchedGroupSamlSourceConnectionRequest>,
3981) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlPartialUpdateError>> {
3982    // add a prefix to parameters to efficiently prevent name collisions
3983    let p_path_id = id;
3984    let p_body_patched_group_saml_source_connection_request = patched_group_saml_source_connection_request;
3985
3986    let uri_str = format!(
3987        "{}/sources/group_connections/saml/{id}/",
3988        configuration.base_path,
3989        id = p_path_id
3990    );
3991    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3992
3993    if let Some(ref user_agent) = configuration.user_agent {
3994        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3995    }
3996    if let Some(ref token) = configuration.bearer_access_token {
3997        req_builder = req_builder.bearer_auth(token.to_owned());
3998    };
3999    req_builder = req_builder.json(&p_body_patched_group_saml_source_connection_request);
4000
4001    let req = req_builder.build()?;
4002    let resp = configuration.client.execute(req).await?;
4003
4004    let status = resp.status();
4005    let content_type = resp
4006        .headers()
4007        .get("content-type")
4008        .and_then(|v| v.to_str().ok())
4009        .unwrap_or("application/octet-stream");
4010    let content_type = super::ContentType::from(content_type);
4011
4012    if !status.is_client_error() && !status.is_server_error() {
4013        let content = resp.text().await?;
4014        match content_type {
4015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4016            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
4017            ContentType::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`")))),
4018        }
4019    } else {
4020        let content = resp.text().await?;
4021        let entity: Option<SourcesGroupConnectionsSamlPartialUpdateError> = serde_json::from_str(&content).ok();
4022        Err(Error::ResponseError(ResponseContent {
4023            status,
4024            content,
4025            entity,
4026        }))
4027    }
4028}
4029
4030/// Group-source connection Viewset
4031pub async fn sources_group_connections_saml_retrieve(
4032    configuration: &configuration::Configuration,
4033    id: i32,
4034) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlRetrieveError>> {
4035    // add a prefix to parameters to efficiently prevent name collisions
4036    let p_path_id = id;
4037
4038    let uri_str = format!(
4039        "{}/sources/group_connections/saml/{id}/",
4040        configuration.base_path,
4041        id = p_path_id
4042    );
4043    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4044
4045    if let Some(ref user_agent) = configuration.user_agent {
4046        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4047    }
4048    if let Some(ref token) = configuration.bearer_access_token {
4049        req_builder = req_builder.bearer_auth(token.to_owned());
4050    };
4051
4052    let req = req_builder.build()?;
4053    let resp = configuration.client.execute(req).await?;
4054
4055    let status = resp.status();
4056    let content_type = resp
4057        .headers()
4058        .get("content-type")
4059        .and_then(|v| v.to_str().ok())
4060        .unwrap_or("application/octet-stream");
4061    let content_type = super::ContentType::from(content_type);
4062
4063    if !status.is_client_error() && !status.is_server_error() {
4064        let content = resp.text().await?;
4065        match content_type {
4066            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4067            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
4068            ContentType::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`")))),
4069        }
4070    } else {
4071        let content = resp.text().await?;
4072        let entity: Option<SourcesGroupConnectionsSamlRetrieveError> = serde_json::from_str(&content).ok();
4073        Err(Error::ResponseError(ResponseContent {
4074            status,
4075            content,
4076            entity,
4077        }))
4078    }
4079}
4080
4081/// Group-source connection Viewset
4082pub async fn sources_group_connections_saml_update(
4083    configuration: &configuration::Configuration,
4084    id: i32,
4085    group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest,
4086) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlUpdateError>> {
4087    // add a prefix to parameters to efficiently prevent name collisions
4088    let p_path_id = id;
4089    let p_body_group_saml_source_connection_request = group_saml_source_connection_request;
4090
4091    let uri_str = format!(
4092        "{}/sources/group_connections/saml/{id}/",
4093        configuration.base_path,
4094        id = p_path_id
4095    );
4096    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4097
4098    if let Some(ref user_agent) = configuration.user_agent {
4099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4100    }
4101    if let Some(ref token) = configuration.bearer_access_token {
4102        req_builder = req_builder.bearer_auth(token.to_owned());
4103    };
4104    req_builder = req_builder.json(&p_body_group_saml_source_connection_request);
4105
4106    let req = req_builder.build()?;
4107    let resp = configuration.client.execute(req).await?;
4108
4109    let status = resp.status();
4110    let content_type = resp
4111        .headers()
4112        .get("content-type")
4113        .and_then(|v| v.to_str().ok())
4114        .unwrap_or("application/octet-stream");
4115    let content_type = super::ContentType::from(content_type);
4116
4117    if !status.is_client_error() && !status.is_server_error() {
4118        let content = resp.text().await?;
4119        match content_type {
4120            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4121            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
4122            ContentType::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`")))),
4123        }
4124    } else {
4125        let content = resp.text().await?;
4126        let entity: Option<SourcesGroupConnectionsSamlUpdateError> = serde_json::from_str(&content).ok();
4127        Err(Error::ResponseError(ResponseContent {
4128            status,
4129            content,
4130            entity,
4131        }))
4132    }
4133}
4134
4135/// Get a list of all objects that use this object
4136pub async fn sources_group_connections_saml_used_by_list(
4137    configuration: &configuration::Configuration,
4138    id: i32,
4139) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsSamlUsedByListError>> {
4140    // add a prefix to parameters to efficiently prevent name collisions
4141    let p_path_id = id;
4142
4143    let uri_str = format!(
4144        "{}/sources/group_connections/saml/{id}/used_by/",
4145        configuration.base_path,
4146        id = p_path_id
4147    );
4148    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4149
4150    if let Some(ref user_agent) = configuration.user_agent {
4151        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4152    }
4153    if let Some(ref token) = configuration.bearer_access_token {
4154        req_builder = req_builder.bearer_auth(token.to_owned());
4155    };
4156
4157    let req = req_builder.build()?;
4158    let resp = configuration.client.execute(req).await?;
4159
4160    let status = resp.status();
4161    let content_type = resp
4162        .headers()
4163        .get("content-type")
4164        .and_then(|v| v.to_str().ok())
4165        .unwrap_or("application/octet-stream");
4166    let content_type = super::ContentType::from(content_type);
4167
4168    if !status.is_client_error() && !status.is_server_error() {
4169        let content = resp.text().await?;
4170        match content_type {
4171            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4172            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;`"))),
4173            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;`")))),
4174        }
4175    } else {
4176        let content = resp.text().await?;
4177        let entity: Option<SourcesGroupConnectionsSamlUsedByListError> = serde_json::from_str(&content).ok();
4178        Err(Error::ResponseError(ResponseContent {
4179            status,
4180            content,
4181            entity,
4182        }))
4183    }
4184}
4185
4186/// Group-source connection Viewset
4187pub async fn sources_group_connections_telegram_create(
4188    configuration: &configuration::Configuration,
4189    group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest,
4190) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramCreateError>> {
4191    // add a prefix to parameters to efficiently prevent name collisions
4192    let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request;
4193
4194    let uri_str = format!("{}/sources/group_connections/telegram/", configuration.base_path);
4195    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4196
4197    if let Some(ref user_agent) = configuration.user_agent {
4198        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4199    }
4200    if let Some(ref token) = configuration.bearer_access_token {
4201        req_builder = req_builder.bearer_auth(token.to_owned());
4202    };
4203    req_builder = req_builder.json(&p_body_group_telegram_source_connection_request);
4204
4205    let req = req_builder.build()?;
4206    let resp = configuration.client.execute(req).await?;
4207
4208    let status = resp.status();
4209    let content_type = resp
4210        .headers()
4211        .get("content-type")
4212        .and_then(|v| v.to_str().ok())
4213        .unwrap_or("application/octet-stream");
4214    let content_type = super::ContentType::from(content_type);
4215
4216    if !status.is_client_error() && !status.is_server_error() {
4217        let content = resp.text().await?;
4218        match content_type {
4219            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4220            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4221            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4222        }
4223    } else {
4224        let content = resp.text().await?;
4225        let entity: Option<SourcesGroupConnectionsTelegramCreateError> = serde_json::from_str(&content).ok();
4226        Err(Error::ResponseError(ResponseContent {
4227            status,
4228            content,
4229            entity,
4230        }))
4231    }
4232}
4233
4234/// Group-source connection Viewset
4235pub async fn sources_group_connections_telegram_destroy(
4236    configuration: &configuration::Configuration,
4237    id: i32,
4238) -> Result<(), Error<SourcesGroupConnectionsTelegramDestroyError>> {
4239    // add a prefix to parameters to efficiently prevent name collisions
4240    let p_path_id = id;
4241
4242    let uri_str = format!(
4243        "{}/sources/group_connections/telegram/{id}/",
4244        configuration.base_path,
4245        id = p_path_id
4246    );
4247    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4248
4249    if let Some(ref user_agent) = configuration.user_agent {
4250        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4251    }
4252    if let Some(ref token) = configuration.bearer_access_token {
4253        req_builder = req_builder.bearer_auth(token.to_owned());
4254    };
4255
4256    let req = req_builder.build()?;
4257    let resp = configuration.client.execute(req).await?;
4258
4259    let status = resp.status();
4260
4261    if !status.is_client_error() && !status.is_server_error() {
4262        Ok(())
4263    } else {
4264        let content = resp.text().await?;
4265        let entity: Option<SourcesGroupConnectionsTelegramDestroyError> = serde_json::from_str(&content).ok();
4266        Err(Error::ResponseError(ResponseContent {
4267            status,
4268            content,
4269            entity,
4270        }))
4271    }
4272}
4273
4274/// Group-source connection Viewset
4275pub async fn sources_group_connections_telegram_list(
4276    configuration: &configuration::Configuration,
4277    group: Option<&str>,
4278    ordering: Option<&str>,
4279    page: Option<i32>,
4280    page_size: Option<i32>,
4281    search: Option<&str>,
4282    source__slug: Option<&str>,
4283) -> Result<models::PaginatedGroupTelegramSourceConnectionList, Error<SourcesGroupConnectionsTelegramListError>> {
4284    // add a prefix to parameters to efficiently prevent name collisions
4285    let p_query_group = group;
4286    let p_query_ordering = ordering;
4287    let p_query_page = page;
4288    let p_query_page_size = page_size;
4289    let p_query_search = search;
4290    let p_query_source__slug = source__slug;
4291
4292    let uri_str = format!("{}/sources/group_connections/telegram/", configuration.base_path);
4293    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4294
4295    if let Some(ref param_value) = p_query_group {
4296        req_builder = req_builder.query(&[("group", &param_value.to_string())]);
4297    }
4298    if let Some(ref param_value) = p_query_ordering {
4299        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4300    }
4301    if let Some(ref param_value) = p_query_page {
4302        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4303    }
4304    if let Some(ref param_value) = p_query_page_size {
4305        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4306    }
4307    if let Some(ref param_value) = p_query_search {
4308        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4309    }
4310    if let Some(ref param_value) = p_query_source__slug {
4311        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
4312    }
4313    if let Some(ref user_agent) = configuration.user_agent {
4314        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4315    }
4316    if let Some(ref token) = configuration.bearer_access_token {
4317        req_builder = req_builder.bearer_auth(token.to_owned());
4318    };
4319
4320    let req = req_builder.build()?;
4321    let resp = configuration.client.execute(req).await?;
4322
4323    let status = resp.status();
4324    let content_type = resp
4325        .headers()
4326        .get("content-type")
4327        .and_then(|v| v.to_str().ok())
4328        .unwrap_or("application/octet-stream");
4329    let content_type = super::ContentType::from(content_type);
4330
4331    if !status.is_client_error() && !status.is_server_error() {
4332        let content = resp.text().await?;
4333        match content_type {
4334            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4335            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupTelegramSourceConnectionList`"))),
4336            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupTelegramSourceConnectionList`")))),
4337        }
4338    } else {
4339        let content = resp.text().await?;
4340        let entity: Option<SourcesGroupConnectionsTelegramListError> = serde_json::from_str(&content).ok();
4341        Err(Error::ResponseError(ResponseContent {
4342            status,
4343            content,
4344            entity,
4345        }))
4346    }
4347}
4348
4349/// Group-source connection Viewset
4350pub async fn sources_group_connections_telegram_partial_update(
4351    configuration: &configuration::Configuration,
4352    id: i32,
4353    patched_group_telegram_source_connection_request: Option<models::PatchedGroupTelegramSourceConnectionRequest>,
4354) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramPartialUpdateError>> {
4355    // add a prefix to parameters to efficiently prevent name collisions
4356    let p_path_id = id;
4357    let p_body_patched_group_telegram_source_connection_request = patched_group_telegram_source_connection_request;
4358
4359    let uri_str = format!(
4360        "{}/sources/group_connections/telegram/{id}/",
4361        configuration.base_path,
4362        id = p_path_id
4363    );
4364    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4365
4366    if let Some(ref user_agent) = configuration.user_agent {
4367        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4368    }
4369    if let Some(ref token) = configuration.bearer_access_token {
4370        req_builder = req_builder.bearer_auth(token.to_owned());
4371    };
4372    req_builder = req_builder.json(&p_body_patched_group_telegram_source_connection_request);
4373
4374    let req = req_builder.build()?;
4375    let resp = configuration.client.execute(req).await?;
4376
4377    let status = resp.status();
4378    let content_type = resp
4379        .headers()
4380        .get("content-type")
4381        .and_then(|v| v.to_str().ok())
4382        .unwrap_or("application/octet-stream");
4383    let content_type = super::ContentType::from(content_type);
4384
4385    if !status.is_client_error() && !status.is_server_error() {
4386        let content = resp.text().await?;
4387        match content_type {
4388            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4389            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4390            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4391        }
4392    } else {
4393        let content = resp.text().await?;
4394        let entity: Option<SourcesGroupConnectionsTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
4395        Err(Error::ResponseError(ResponseContent {
4396            status,
4397            content,
4398            entity,
4399        }))
4400    }
4401}
4402
4403/// Group-source connection Viewset
4404pub async fn sources_group_connections_telegram_retrieve(
4405    configuration: &configuration::Configuration,
4406    id: i32,
4407) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramRetrieveError>> {
4408    // add a prefix to parameters to efficiently prevent name collisions
4409    let p_path_id = id;
4410
4411    let uri_str = format!(
4412        "{}/sources/group_connections/telegram/{id}/",
4413        configuration.base_path,
4414        id = p_path_id
4415    );
4416    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4417
4418    if let Some(ref user_agent) = configuration.user_agent {
4419        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4420    }
4421    if let Some(ref token) = configuration.bearer_access_token {
4422        req_builder = req_builder.bearer_auth(token.to_owned());
4423    };
4424
4425    let req = req_builder.build()?;
4426    let resp = configuration.client.execute(req).await?;
4427
4428    let status = resp.status();
4429    let content_type = resp
4430        .headers()
4431        .get("content-type")
4432        .and_then(|v| v.to_str().ok())
4433        .unwrap_or("application/octet-stream");
4434    let content_type = super::ContentType::from(content_type);
4435
4436    if !status.is_client_error() && !status.is_server_error() {
4437        let content = resp.text().await?;
4438        match content_type {
4439            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4440            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4441            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4442        }
4443    } else {
4444        let content = resp.text().await?;
4445        let entity: Option<SourcesGroupConnectionsTelegramRetrieveError> = serde_json::from_str(&content).ok();
4446        Err(Error::ResponseError(ResponseContent {
4447            status,
4448            content,
4449            entity,
4450        }))
4451    }
4452}
4453
4454/// Group-source connection Viewset
4455pub async fn sources_group_connections_telegram_update(
4456    configuration: &configuration::Configuration,
4457    id: i32,
4458    group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest,
4459) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramUpdateError>> {
4460    // add a prefix to parameters to efficiently prevent name collisions
4461    let p_path_id = id;
4462    let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request;
4463
4464    let uri_str = format!(
4465        "{}/sources/group_connections/telegram/{id}/",
4466        configuration.base_path,
4467        id = p_path_id
4468    );
4469    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4470
4471    if let Some(ref user_agent) = configuration.user_agent {
4472        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4473    }
4474    if let Some(ref token) = configuration.bearer_access_token {
4475        req_builder = req_builder.bearer_auth(token.to_owned());
4476    };
4477    req_builder = req_builder.json(&p_body_group_telegram_source_connection_request);
4478
4479    let req = req_builder.build()?;
4480    let resp = configuration.client.execute(req).await?;
4481
4482    let status = resp.status();
4483    let content_type = resp
4484        .headers()
4485        .get("content-type")
4486        .and_then(|v| v.to_str().ok())
4487        .unwrap_or("application/octet-stream");
4488    let content_type = super::ContentType::from(content_type);
4489
4490    if !status.is_client_error() && !status.is_server_error() {
4491        let content = resp.text().await?;
4492        match content_type {
4493            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4494            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4495            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4496        }
4497    } else {
4498        let content = resp.text().await?;
4499        let entity: Option<SourcesGroupConnectionsTelegramUpdateError> = serde_json::from_str(&content).ok();
4500        Err(Error::ResponseError(ResponseContent {
4501            status,
4502            content,
4503            entity,
4504        }))
4505    }
4506}
4507
4508/// Get a list of all objects that use this object
4509pub async fn sources_group_connections_telegram_used_by_list(
4510    configuration: &configuration::Configuration,
4511    id: i32,
4512) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsTelegramUsedByListError>> {
4513    // add a prefix to parameters to efficiently prevent name collisions
4514    let p_path_id = id;
4515
4516    let uri_str = format!(
4517        "{}/sources/group_connections/telegram/{id}/used_by/",
4518        configuration.base_path,
4519        id = p_path_id
4520    );
4521    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4522
4523    if let Some(ref user_agent) = configuration.user_agent {
4524        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4525    }
4526    if let Some(ref token) = configuration.bearer_access_token {
4527        req_builder = req_builder.bearer_auth(token.to_owned());
4528    };
4529
4530    let req = req_builder.build()?;
4531    let resp = configuration.client.execute(req).await?;
4532
4533    let status = resp.status();
4534    let content_type = resp
4535        .headers()
4536        .get("content-type")
4537        .and_then(|v| v.to_str().ok())
4538        .unwrap_or("application/octet-stream");
4539    let content_type = super::ContentType::from(content_type);
4540
4541    if !status.is_client_error() && !status.is_server_error() {
4542        let content = resp.text().await?;
4543        match content_type {
4544            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4545            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;`"))),
4546            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;`")))),
4547        }
4548    } else {
4549        let content = resp.text().await?;
4550        let entity: Option<SourcesGroupConnectionsTelegramUsedByListError> = serde_json::from_str(&content).ok();
4551        Err(Error::ResponseError(ResponseContent {
4552            status,
4553            content,
4554            entity,
4555        }))
4556    }
4557}
4558
4559/// Kerberos Source Viewset
4560pub async fn sources_kerberos_create(
4561    configuration: &configuration::Configuration,
4562    kerberos_source_request: models::KerberosSourceRequest,
4563) -> Result<models::KerberosSource, Error<SourcesKerberosCreateError>> {
4564    // add a prefix to parameters to efficiently prevent name collisions
4565    let p_body_kerberos_source_request = kerberos_source_request;
4566
4567    let uri_str = format!("{}/sources/kerberos/", configuration.base_path);
4568    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4569
4570    if let Some(ref user_agent) = configuration.user_agent {
4571        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4572    }
4573    if let Some(ref token) = configuration.bearer_access_token {
4574        req_builder = req_builder.bearer_auth(token.to_owned());
4575    };
4576    req_builder = req_builder.json(&p_body_kerberos_source_request);
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::KerberosSource`",
4596                )))
4597            }
4598            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4599                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4600            )))),
4601        }
4602    } else {
4603        let content = resp.text().await?;
4604        let entity: Option<SourcesKerberosCreateError> = serde_json::from_str(&content).ok();
4605        Err(Error::ResponseError(ResponseContent {
4606            status,
4607            content,
4608            entity,
4609        }))
4610    }
4611}
4612
4613/// Kerberos Source Viewset
4614pub async fn sources_kerberos_destroy(
4615    configuration: &configuration::Configuration,
4616    slug: &str,
4617) -> Result<(), Error<SourcesKerberosDestroyError>> {
4618    // add a prefix to parameters to efficiently prevent name collisions
4619    let p_path_slug = slug;
4620
4621    let uri_str = format!(
4622        "{}/sources/kerberos/{slug}/",
4623        configuration.base_path,
4624        slug = crate::apis::urlencode(p_path_slug)
4625    );
4626    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4627
4628    if let Some(ref user_agent) = configuration.user_agent {
4629        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4630    }
4631    if let Some(ref token) = configuration.bearer_access_token {
4632        req_builder = req_builder.bearer_auth(token.to_owned());
4633    };
4634
4635    let req = req_builder.build()?;
4636    let resp = configuration.client.execute(req).await?;
4637
4638    let status = resp.status();
4639
4640    if !status.is_client_error() && !status.is_server_error() {
4641        Ok(())
4642    } else {
4643        let content = resp.text().await?;
4644        let entity: Option<SourcesKerberosDestroyError> = serde_json::from_str(&content).ok();
4645        Err(Error::ResponseError(ResponseContent {
4646            status,
4647            content,
4648            entity,
4649        }))
4650    }
4651}
4652
4653/// Kerberos Source Viewset
4654pub async fn sources_kerberos_list(
4655    configuration: &configuration::Configuration,
4656    enabled: Option<bool>,
4657    kadmin_type: Option<&str>,
4658    name: Option<&str>,
4659    ordering: Option<&str>,
4660    page: Option<i32>,
4661    page_size: Option<i32>,
4662    password_login_update_internal_password: Option<bool>,
4663    pbm_uuid: Option<&str>,
4664    realm: Option<&str>,
4665    search: Option<&str>,
4666    slug: Option<&str>,
4667    spnego_server_name: Option<&str>,
4668    sync_principal: Option<&str>,
4669    sync_users: Option<bool>,
4670    sync_users_password: Option<bool>,
4671) -> Result<models::PaginatedKerberosSourceList, Error<SourcesKerberosListError>> {
4672    // add a prefix to parameters to efficiently prevent name collisions
4673    let p_query_enabled = enabled;
4674    let p_query_kadmin_type = kadmin_type;
4675    let p_query_name = name;
4676    let p_query_ordering = ordering;
4677    let p_query_page = page;
4678    let p_query_page_size = page_size;
4679    let p_query_password_login_update_internal_password = password_login_update_internal_password;
4680    let p_query_pbm_uuid = pbm_uuid;
4681    let p_query_realm = realm;
4682    let p_query_search = search;
4683    let p_query_slug = slug;
4684    let p_query_spnego_server_name = spnego_server_name;
4685    let p_query_sync_principal = sync_principal;
4686    let p_query_sync_users = sync_users;
4687    let p_query_sync_users_password = sync_users_password;
4688
4689    let uri_str = format!("{}/sources/kerberos/", configuration.base_path);
4690    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4691
4692    if let Some(ref param_value) = p_query_enabled {
4693        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
4694    }
4695    if let Some(ref param_value) = p_query_kadmin_type {
4696        req_builder = req_builder.query(&[("kadmin_type", &param_value.to_string())]);
4697    }
4698    if let Some(ref param_value) = p_query_name {
4699        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
4700    }
4701    if let Some(ref param_value) = p_query_ordering {
4702        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4703    }
4704    if let Some(ref param_value) = p_query_page {
4705        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4706    }
4707    if let Some(ref param_value) = p_query_page_size {
4708        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4709    }
4710    if let Some(ref param_value) = p_query_password_login_update_internal_password {
4711        req_builder = req_builder.query(&[("password_login_update_internal_password", &param_value.to_string())]);
4712    }
4713    if let Some(ref param_value) = p_query_pbm_uuid {
4714        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
4715    }
4716    if let Some(ref param_value) = p_query_realm {
4717        req_builder = req_builder.query(&[("realm", &param_value.to_string())]);
4718    }
4719    if let Some(ref param_value) = p_query_search {
4720        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4721    }
4722    if let Some(ref param_value) = p_query_slug {
4723        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
4724    }
4725    if let Some(ref param_value) = p_query_spnego_server_name {
4726        req_builder = req_builder.query(&[("spnego_server_name", &param_value.to_string())]);
4727    }
4728    if let Some(ref param_value) = p_query_sync_principal {
4729        req_builder = req_builder.query(&[("sync_principal", &param_value.to_string())]);
4730    }
4731    if let Some(ref param_value) = p_query_sync_users {
4732        req_builder = req_builder.query(&[("sync_users", &param_value.to_string())]);
4733    }
4734    if let Some(ref param_value) = p_query_sync_users_password {
4735        req_builder = req_builder.query(&[("sync_users_password", &param_value.to_string())]);
4736    }
4737    if let Some(ref user_agent) = configuration.user_agent {
4738        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4739    }
4740    if let Some(ref token) = configuration.bearer_access_token {
4741        req_builder = req_builder.bearer_auth(token.to_owned());
4742    };
4743
4744    let req = req_builder.build()?;
4745    let resp = configuration.client.execute(req).await?;
4746
4747    let status = resp.status();
4748    let content_type = resp
4749        .headers()
4750        .get("content-type")
4751        .and_then(|v| v.to_str().ok())
4752        .unwrap_or("application/octet-stream");
4753    let content_type = super::ContentType::from(content_type);
4754
4755    if !status.is_client_error() && !status.is_server_error() {
4756        let content = resp.text().await?;
4757        match content_type {
4758            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4759            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedKerberosSourceList`"))),
4760            ContentType::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`")))),
4761        }
4762    } else {
4763        let content = resp.text().await?;
4764        let entity: Option<SourcesKerberosListError> = serde_json::from_str(&content).ok();
4765        Err(Error::ResponseError(ResponseContent {
4766            status,
4767            content,
4768            entity,
4769        }))
4770    }
4771}
4772
4773/// Kerberos Source Viewset
4774pub async fn sources_kerberos_partial_update(
4775    configuration: &configuration::Configuration,
4776    slug: &str,
4777    patched_kerberos_source_request: Option<models::PatchedKerberosSourceRequest>,
4778) -> Result<models::KerberosSource, Error<SourcesKerberosPartialUpdateError>> {
4779    // add a prefix to parameters to efficiently prevent name collisions
4780    let p_path_slug = slug;
4781    let p_body_patched_kerberos_source_request = patched_kerberos_source_request;
4782
4783    let uri_str = format!(
4784        "{}/sources/kerberos/{slug}/",
4785        configuration.base_path,
4786        slug = crate::apis::urlencode(p_path_slug)
4787    );
4788    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4789
4790    if let Some(ref user_agent) = configuration.user_agent {
4791        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4792    }
4793    if let Some(ref token) = configuration.bearer_access_token {
4794        req_builder = req_builder.bearer_auth(token.to_owned());
4795    };
4796    req_builder = req_builder.json(&p_body_patched_kerberos_source_request);
4797
4798    let req = req_builder.build()?;
4799    let resp = configuration.client.execute(req).await?;
4800
4801    let status = resp.status();
4802    let content_type = resp
4803        .headers()
4804        .get("content-type")
4805        .and_then(|v| v.to_str().ok())
4806        .unwrap_or("application/octet-stream");
4807    let content_type = super::ContentType::from(content_type);
4808
4809    if !status.is_client_error() && !status.is_server_error() {
4810        let content = resp.text().await?;
4811        match content_type {
4812            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4813            ContentType::Text => {
4814                return Err(Error::from(serde_json::Error::custom(
4815                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4816                )))
4817            }
4818            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4819                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4820            )))),
4821        }
4822    } else {
4823        let content = resp.text().await?;
4824        let entity: Option<SourcesKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
4825        Err(Error::ResponseError(ResponseContent {
4826            status,
4827            content,
4828            entity,
4829        }))
4830    }
4831}
4832
4833/// Kerberos Source Viewset
4834pub async fn sources_kerberos_retrieve(
4835    configuration: &configuration::Configuration,
4836    slug: &str,
4837) -> Result<models::KerberosSource, Error<SourcesKerberosRetrieveError>> {
4838    // add a prefix to parameters to efficiently prevent name collisions
4839    let p_path_slug = slug;
4840
4841    let uri_str = format!(
4842        "{}/sources/kerberos/{slug}/",
4843        configuration.base_path,
4844        slug = crate::apis::urlencode(p_path_slug)
4845    );
4846    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4847
4848    if let Some(ref user_agent) = configuration.user_agent {
4849        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4850    }
4851    if let Some(ref token) = configuration.bearer_access_token {
4852        req_builder = req_builder.bearer_auth(token.to_owned());
4853    };
4854
4855    let req = req_builder.build()?;
4856    let resp = configuration.client.execute(req).await?;
4857
4858    let status = resp.status();
4859    let content_type = resp
4860        .headers()
4861        .get("content-type")
4862        .and_then(|v| v.to_str().ok())
4863        .unwrap_or("application/octet-stream");
4864    let content_type = super::ContentType::from(content_type);
4865
4866    if !status.is_client_error() && !status.is_server_error() {
4867        let content = resp.text().await?;
4868        match content_type {
4869            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4870            ContentType::Text => {
4871                return Err(Error::from(serde_json::Error::custom(
4872                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4873                )))
4874            }
4875            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4876                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4877            )))),
4878        }
4879    } else {
4880        let content = resp.text().await?;
4881        let entity: Option<SourcesKerberosRetrieveError> = serde_json::from_str(&content).ok();
4882        Err(Error::ResponseError(ResponseContent {
4883            status,
4884            content,
4885            entity,
4886        }))
4887    }
4888}
4889
4890/// Get provider's sync status
4891pub async fn sources_kerberos_sync_status_retrieve(
4892    configuration: &configuration::Configuration,
4893    slug: &str,
4894) -> Result<models::SyncStatus, Error<SourcesKerberosSyncStatusRetrieveError>> {
4895    // add a prefix to parameters to efficiently prevent name collisions
4896    let p_path_slug = slug;
4897
4898    let uri_str = format!(
4899        "{}/sources/kerberos/{slug}/sync/status/",
4900        configuration.base_path,
4901        slug = crate::apis::urlencode(p_path_slug)
4902    );
4903    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4904
4905    if let Some(ref user_agent) = configuration.user_agent {
4906        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4907    }
4908    if let Some(ref token) = configuration.bearer_access_token {
4909        req_builder = req_builder.bearer_auth(token.to_owned());
4910    };
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::SyncStatus`",
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::SyncStatus`"
4935                ))))
4936            }
4937        }
4938    } else {
4939        let content = resp.text().await?;
4940        let entity: Option<SourcesKerberosSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
4941        Err(Error::ResponseError(ResponseContent {
4942            status,
4943            content,
4944            entity,
4945        }))
4946    }
4947}
4948
4949/// Kerberos Source Viewset
4950pub async fn sources_kerberos_update(
4951    configuration: &configuration::Configuration,
4952    slug: &str,
4953    kerberos_source_request: models::KerberosSourceRequest,
4954) -> Result<models::KerberosSource, Error<SourcesKerberosUpdateError>> {
4955    // add a prefix to parameters to efficiently prevent name collisions
4956    let p_path_slug = slug;
4957    let p_body_kerberos_source_request = kerberos_source_request;
4958
4959    let uri_str = format!(
4960        "{}/sources/kerberos/{slug}/",
4961        configuration.base_path,
4962        slug = crate::apis::urlencode(p_path_slug)
4963    );
4964    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4965
4966    if let Some(ref user_agent) = configuration.user_agent {
4967        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4968    }
4969    if let Some(ref token) = configuration.bearer_access_token {
4970        req_builder = req_builder.bearer_auth(token.to_owned());
4971    };
4972    req_builder = req_builder.json(&p_body_kerberos_source_request);
4973
4974    let req = req_builder.build()?;
4975    let resp = configuration.client.execute(req).await?;
4976
4977    let status = resp.status();
4978    let content_type = resp
4979        .headers()
4980        .get("content-type")
4981        .and_then(|v| v.to_str().ok())
4982        .unwrap_or("application/octet-stream");
4983    let content_type = super::ContentType::from(content_type);
4984
4985    if !status.is_client_error() && !status.is_server_error() {
4986        let content = resp.text().await?;
4987        match content_type {
4988            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4989            ContentType::Text => {
4990                return Err(Error::from(serde_json::Error::custom(
4991                    "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4992                )))
4993            }
4994            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4995                "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4996            )))),
4997        }
4998    } else {
4999        let content = resp.text().await?;
5000        let entity: Option<SourcesKerberosUpdateError> = serde_json::from_str(&content).ok();
5001        Err(Error::ResponseError(ResponseContent {
5002            status,
5003            content,
5004            entity,
5005        }))
5006    }
5007}
5008
5009/// Get a list of all objects that use this object
5010pub async fn sources_kerberos_used_by_list(
5011    configuration: &configuration::Configuration,
5012    slug: &str,
5013) -> Result<Vec<models::UsedBy>, Error<SourcesKerberosUsedByListError>> {
5014    // add a prefix to parameters to efficiently prevent name collisions
5015    let p_path_slug = slug;
5016
5017    let uri_str = format!(
5018        "{}/sources/kerberos/{slug}/used_by/",
5019        configuration.base_path,
5020        slug = crate::apis::urlencode(p_path_slug)
5021    );
5022    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5023
5024    if let Some(ref user_agent) = configuration.user_agent {
5025        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5026    }
5027    if let Some(ref token) = configuration.bearer_access_token {
5028        req_builder = req_builder.bearer_auth(token.to_owned());
5029    };
5030
5031    let req = req_builder.build()?;
5032    let resp = configuration.client.execute(req).await?;
5033
5034    let status = resp.status();
5035    let content_type = resp
5036        .headers()
5037        .get("content-type")
5038        .and_then(|v| v.to_str().ok())
5039        .unwrap_or("application/octet-stream");
5040    let content_type = super::ContentType::from(content_type);
5041
5042    if !status.is_client_error() && !status.is_server_error() {
5043        let content = resp.text().await?;
5044        match content_type {
5045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5046            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;`"))),
5047            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;`")))),
5048        }
5049    } else {
5050        let content = resp.text().await?;
5051        let entity: Option<SourcesKerberosUsedByListError> = serde_json::from_str(&content).ok();
5052        Err(Error::ResponseError(ResponseContent {
5053            status,
5054            content,
5055            entity,
5056        }))
5057    }
5058}
5059
5060/// LDAP Source Viewset
5061pub async fn sources_ldap_create(
5062    configuration: &configuration::Configuration,
5063    ldap_source_request: models::LdapSourceRequest,
5064) -> Result<models::LdapSource, Error<SourcesLdapCreateError>> {
5065    // add a prefix to parameters to efficiently prevent name collisions
5066    let p_body_ldap_source_request = ldap_source_request;
5067
5068    let uri_str = format!("{}/sources/ldap/", configuration.base_path);
5069    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5070
5071    if let Some(ref user_agent) = configuration.user_agent {
5072        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5073    }
5074    if let Some(ref token) = configuration.bearer_access_token {
5075        req_builder = req_builder.bearer_auth(token.to_owned());
5076    };
5077    req_builder = req_builder.json(&p_body_ldap_source_request);
5078
5079    let req = req_builder.build()?;
5080    let resp = configuration.client.execute(req).await?;
5081
5082    let status = resp.status();
5083    let content_type = resp
5084        .headers()
5085        .get("content-type")
5086        .and_then(|v| v.to_str().ok())
5087        .unwrap_or("application/octet-stream");
5088    let content_type = super::ContentType::from(content_type);
5089
5090    if !status.is_client_error() && !status.is_server_error() {
5091        let content = resp.text().await?;
5092        match content_type {
5093            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5094            ContentType::Text => {
5095                return Err(Error::from(serde_json::Error::custom(
5096                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5097                )))
5098            }
5099            ContentType::Unsupported(unknown_type) => {
5100                return Err(Error::from(serde_json::Error::custom(format!(
5101                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5102                ))))
5103            }
5104        }
5105    } else {
5106        let content = resp.text().await?;
5107        let entity: Option<SourcesLdapCreateError> = serde_json::from_str(&content).ok();
5108        Err(Error::ResponseError(ResponseContent {
5109            status,
5110            content,
5111            entity,
5112        }))
5113    }
5114}
5115
5116/// Get raw LDAP data to debug
5117pub async fn sources_ldap_debug_retrieve(
5118    configuration: &configuration::Configuration,
5119    slug: &str,
5120) -> Result<models::LdapDebug, Error<SourcesLdapDebugRetrieveError>> {
5121    // add a prefix to parameters to efficiently prevent name collisions
5122    let p_path_slug = slug;
5123
5124    let uri_str = format!(
5125        "{}/sources/ldap/{slug}/debug/",
5126        configuration.base_path,
5127        slug = crate::apis::urlencode(p_path_slug)
5128    );
5129    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5130
5131    if let Some(ref user_agent) = configuration.user_agent {
5132        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5133    }
5134    if let Some(ref token) = configuration.bearer_access_token {
5135        req_builder = req_builder.bearer_auth(token.to_owned());
5136    };
5137
5138    let req = req_builder.build()?;
5139    let resp = configuration.client.execute(req).await?;
5140
5141    let status = resp.status();
5142    let content_type = resp
5143        .headers()
5144        .get("content-type")
5145        .and_then(|v| v.to_str().ok())
5146        .unwrap_or("application/octet-stream");
5147    let content_type = super::ContentType::from(content_type);
5148
5149    if !status.is_client_error() && !status.is_server_error() {
5150        let content = resp.text().await?;
5151        match content_type {
5152            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5153            ContentType::Text => {
5154                return Err(Error::from(serde_json::Error::custom(
5155                    "Received `text/plain` content type response that cannot be converted to `models::LdapDebug`",
5156                )))
5157            }
5158            ContentType::Unsupported(unknown_type) => {
5159                return Err(Error::from(serde_json::Error::custom(format!(
5160                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapDebug`"
5161                ))))
5162            }
5163        }
5164    } else {
5165        let content = resp.text().await?;
5166        let entity: Option<SourcesLdapDebugRetrieveError> = serde_json::from_str(&content).ok();
5167        Err(Error::ResponseError(ResponseContent {
5168            status,
5169            content,
5170            entity,
5171        }))
5172    }
5173}
5174
5175/// LDAP Source Viewset
5176pub async fn sources_ldap_destroy(
5177    configuration: &configuration::Configuration,
5178    slug: &str,
5179) -> Result<(), Error<SourcesLdapDestroyError>> {
5180    // add a prefix to parameters to efficiently prevent name collisions
5181    let p_path_slug = slug;
5182
5183    let uri_str = format!(
5184        "{}/sources/ldap/{slug}/",
5185        configuration.base_path,
5186        slug = crate::apis::urlencode(p_path_slug)
5187    );
5188    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5189
5190    if let Some(ref user_agent) = configuration.user_agent {
5191        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5192    }
5193    if let Some(ref token) = configuration.bearer_access_token {
5194        req_builder = req_builder.bearer_auth(token.to_owned());
5195    };
5196
5197    let req = req_builder.build()?;
5198    let resp = configuration.client.execute(req).await?;
5199
5200    let status = resp.status();
5201
5202    if !status.is_client_error() && !status.is_server_error() {
5203        Ok(())
5204    } else {
5205        let content = resp.text().await?;
5206        let entity: Option<SourcesLdapDestroyError> = serde_json::from_str(&content).ok();
5207        Err(Error::ResponseError(ResponseContent {
5208            status,
5209            content,
5210            entity,
5211        }))
5212    }
5213}
5214
5215/// LDAP Source Viewset
5216pub async fn sources_ldap_list(
5217    configuration: &configuration::Configuration,
5218    additional_group_dn: Option<&str>,
5219    additional_user_dn: Option<&str>,
5220    base_dn: Option<&str>,
5221    bind_cn: Option<&str>,
5222    client_certificate: Option<&str>,
5223    delete_not_found_objects: Option<bool>,
5224    enabled: Option<bool>,
5225    group_membership_field: Option<&str>,
5226    group_object_filter: Option<&str>,
5227    group_property_mappings: Option<Vec<uuid::Uuid>>,
5228    lookup_groups_from_user: Option<bool>,
5229    name: Option<&str>,
5230    object_uniqueness_field: Option<&str>,
5231    ordering: Option<&str>,
5232    page: Option<i32>,
5233    page_size: Option<i32>,
5234    password_login_update_internal_password: Option<bool>,
5235    pbm_uuid: Option<&str>,
5236    peer_certificate: Option<&str>,
5237    search: Option<&str>,
5238    server_uri: Option<&str>,
5239    slug: Option<&str>,
5240    sni: Option<bool>,
5241    start_tls: Option<bool>,
5242    sync_groups: Option<bool>,
5243    sync_parent_group: Option<&str>,
5244    sync_users: Option<bool>,
5245    sync_users_password: Option<bool>,
5246    user_membership_attribute: Option<&str>,
5247    user_object_filter: Option<&str>,
5248    user_property_mappings: Option<Vec<uuid::Uuid>>,
5249) -> Result<models::PaginatedLdapSourceList, Error<SourcesLdapListError>> {
5250    // add a prefix to parameters to efficiently prevent name collisions
5251    let p_query_additional_group_dn = additional_group_dn;
5252    let p_query_additional_user_dn = additional_user_dn;
5253    let p_query_base_dn = base_dn;
5254    let p_query_bind_cn = bind_cn;
5255    let p_query_client_certificate = client_certificate;
5256    let p_query_delete_not_found_objects = delete_not_found_objects;
5257    let p_query_enabled = enabled;
5258    let p_query_group_membership_field = group_membership_field;
5259    let p_query_group_object_filter = group_object_filter;
5260    let p_query_group_property_mappings = group_property_mappings;
5261    let p_query_lookup_groups_from_user = lookup_groups_from_user;
5262    let p_query_name = name;
5263    let p_query_object_uniqueness_field = object_uniqueness_field;
5264    let p_query_ordering = ordering;
5265    let p_query_page = page;
5266    let p_query_page_size = page_size;
5267    let p_query_password_login_update_internal_password = password_login_update_internal_password;
5268    let p_query_pbm_uuid = pbm_uuid;
5269    let p_query_peer_certificate = peer_certificate;
5270    let p_query_search = search;
5271    let p_query_server_uri = server_uri;
5272    let p_query_slug = slug;
5273    let p_query_sni = sni;
5274    let p_query_start_tls = start_tls;
5275    let p_query_sync_groups = sync_groups;
5276    let p_query_sync_parent_group = sync_parent_group;
5277    let p_query_sync_users = sync_users;
5278    let p_query_sync_users_password = sync_users_password;
5279    let p_query_user_membership_attribute = user_membership_attribute;
5280    let p_query_user_object_filter = user_object_filter;
5281    let p_query_user_property_mappings = user_property_mappings;
5282
5283    let uri_str = format!("{}/sources/ldap/", configuration.base_path);
5284    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5285
5286    if let Some(ref param_value) = p_query_additional_group_dn {
5287        req_builder = req_builder.query(&[("additional_group_dn", &param_value.to_string())]);
5288    }
5289    if let Some(ref param_value) = p_query_additional_user_dn {
5290        req_builder = req_builder.query(&[("additional_user_dn", &param_value.to_string())]);
5291    }
5292    if let Some(ref param_value) = p_query_base_dn {
5293        req_builder = req_builder.query(&[("base_dn", &param_value.to_string())]);
5294    }
5295    if let Some(ref param_value) = p_query_bind_cn {
5296        req_builder = req_builder.query(&[("bind_cn", &param_value.to_string())]);
5297    }
5298    if let Some(ref param_value) = p_query_client_certificate {
5299        req_builder = req_builder.query(&[("client_certificate", &param_value.to_string())]);
5300    }
5301    if let Some(ref param_value) = p_query_delete_not_found_objects {
5302        req_builder = req_builder.query(&[("delete_not_found_objects", &param_value.to_string())]);
5303    }
5304    if let Some(ref param_value) = p_query_enabled {
5305        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
5306    }
5307    if let Some(ref param_value) = p_query_group_membership_field {
5308        req_builder = req_builder.query(&[("group_membership_field", &param_value.to_string())]);
5309    }
5310    if let Some(ref param_value) = p_query_group_object_filter {
5311        req_builder = req_builder.query(&[("group_object_filter", &param_value.to_string())]);
5312    }
5313    if let Some(ref param_value) = p_query_group_property_mappings {
5314        req_builder = match "multi" {
5315            "multi" => req_builder.query(
5316                &param_value
5317                    .into_iter()
5318                    .map(|p| ("group_property_mappings".to_owned(), p.to_string()))
5319                    .collect::<Vec<(std::string::String, std::string::String)>>(),
5320            ),
5321            _ => req_builder.query(&[(
5322                "group_property_mappings",
5323                &param_value
5324                    .into_iter()
5325                    .map(|p| p.to_string())
5326                    .collect::<Vec<String>>()
5327                    .join(",")
5328                    .to_string(),
5329            )]),
5330        };
5331    }
5332    if let Some(ref param_value) = p_query_lookup_groups_from_user {
5333        req_builder = req_builder.query(&[("lookup_groups_from_user", &param_value.to_string())]);
5334    }
5335    if let Some(ref param_value) = p_query_name {
5336        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5337    }
5338    if let Some(ref param_value) = p_query_object_uniqueness_field {
5339        req_builder = req_builder.query(&[("object_uniqueness_field", &param_value.to_string())]);
5340    }
5341    if let Some(ref param_value) = p_query_ordering {
5342        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5343    }
5344    if let Some(ref param_value) = p_query_page {
5345        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5346    }
5347    if let Some(ref param_value) = p_query_page_size {
5348        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5349    }
5350    if let Some(ref param_value) = p_query_password_login_update_internal_password {
5351        req_builder = req_builder.query(&[("password_login_update_internal_password", &param_value.to_string())]);
5352    }
5353    if let Some(ref param_value) = p_query_pbm_uuid {
5354        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
5355    }
5356    if let Some(ref param_value) = p_query_peer_certificate {
5357        req_builder = req_builder.query(&[("peer_certificate", &param_value.to_string())]);
5358    }
5359    if let Some(ref param_value) = p_query_search {
5360        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5361    }
5362    if let Some(ref param_value) = p_query_server_uri {
5363        req_builder = req_builder.query(&[("server_uri", &param_value.to_string())]);
5364    }
5365    if let Some(ref param_value) = p_query_slug {
5366        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
5367    }
5368    if let Some(ref param_value) = p_query_sni {
5369        req_builder = req_builder.query(&[("sni", &param_value.to_string())]);
5370    }
5371    if let Some(ref param_value) = p_query_start_tls {
5372        req_builder = req_builder.query(&[("start_tls", &param_value.to_string())]);
5373    }
5374    if let Some(ref param_value) = p_query_sync_groups {
5375        req_builder = req_builder.query(&[("sync_groups", &param_value.to_string())]);
5376    }
5377    if let Some(ref param_value) = p_query_sync_parent_group {
5378        req_builder = req_builder.query(&[("sync_parent_group", &param_value.to_string())]);
5379    }
5380    if let Some(ref param_value) = p_query_sync_users {
5381        req_builder = req_builder.query(&[("sync_users", &param_value.to_string())]);
5382    }
5383    if let Some(ref param_value) = p_query_sync_users_password {
5384        req_builder = req_builder.query(&[("sync_users_password", &param_value.to_string())]);
5385    }
5386    if let Some(ref param_value) = p_query_user_membership_attribute {
5387        req_builder = req_builder.query(&[("user_membership_attribute", &param_value.to_string())]);
5388    }
5389    if let Some(ref param_value) = p_query_user_object_filter {
5390        req_builder = req_builder.query(&[("user_object_filter", &param_value.to_string())]);
5391    }
5392    if let Some(ref param_value) = p_query_user_property_mappings {
5393        req_builder = match "multi" {
5394            "multi" => req_builder.query(
5395                &param_value
5396                    .into_iter()
5397                    .map(|p| ("user_property_mappings".to_owned(), p.to_string()))
5398                    .collect::<Vec<(std::string::String, std::string::String)>>(),
5399            ),
5400            _ => req_builder.query(&[(
5401                "user_property_mappings",
5402                &param_value
5403                    .into_iter()
5404                    .map(|p| p.to_string())
5405                    .collect::<Vec<String>>()
5406                    .join(",")
5407                    .to_string(),
5408            )]),
5409        };
5410    }
5411    if let Some(ref user_agent) = configuration.user_agent {
5412        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5413    }
5414    if let Some(ref token) = configuration.bearer_access_token {
5415        req_builder = req_builder.bearer_auth(token.to_owned());
5416    };
5417
5418    let req = req_builder.build()?;
5419    let resp = configuration.client.execute(req).await?;
5420
5421    let status = resp.status();
5422    let content_type = resp
5423        .headers()
5424        .get("content-type")
5425        .and_then(|v| v.to_str().ok())
5426        .unwrap_or("application/octet-stream");
5427    let content_type = super::ContentType::from(content_type);
5428
5429    if !status.is_client_error() && !status.is_server_error() {
5430        let content = resp.text().await?;
5431        match content_type {
5432            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5433            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapSourceList`"))),
5434            ContentType::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`")))),
5435        }
5436    } else {
5437        let content = resp.text().await?;
5438        let entity: Option<SourcesLdapListError> = serde_json::from_str(&content).ok();
5439        Err(Error::ResponseError(ResponseContent {
5440            status,
5441            content,
5442            entity,
5443        }))
5444    }
5445}
5446
5447/// LDAP Source Viewset
5448pub async fn sources_ldap_partial_update(
5449    configuration: &configuration::Configuration,
5450    slug: &str,
5451    patched_ldap_source_request: Option<models::PatchedLdapSourceRequest>,
5452) -> Result<models::LdapSource, Error<SourcesLdapPartialUpdateError>> {
5453    // add a prefix to parameters to efficiently prevent name collisions
5454    let p_path_slug = slug;
5455    let p_body_patched_ldap_source_request = patched_ldap_source_request;
5456
5457    let uri_str = format!(
5458        "{}/sources/ldap/{slug}/",
5459        configuration.base_path,
5460        slug = crate::apis::urlencode(p_path_slug)
5461    );
5462    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5463
5464    if let Some(ref user_agent) = configuration.user_agent {
5465        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5466    }
5467    if let Some(ref token) = configuration.bearer_access_token {
5468        req_builder = req_builder.bearer_auth(token.to_owned());
5469    };
5470    req_builder = req_builder.json(&p_body_patched_ldap_source_request);
5471
5472    let req = req_builder.build()?;
5473    let resp = configuration.client.execute(req).await?;
5474
5475    let status = resp.status();
5476    let content_type = resp
5477        .headers()
5478        .get("content-type")
5479        .and_then(|v| v.to_str().ok())
5480        .unwrap_or("application/octet-stream");
5481    let content_type = super::ContentType::from(content_type);
5482
5483    if !status.is_client_error() && !status.is_server_error() {
5484        let content = resp.text().await?;
5485        match content_type {
5486            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5487            ContentType::Text => {
5488                return Err(Error::from(serde_json::Error::custom(
5489                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5490                )))
5491            }
5492            ContentType::Unsupported(unknown_type) => {
5493                return Err(Error::from(serde_json::Error::custom(format!(
5494                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5495                ))))
5496            }
5497        }
5498    } else {
5499        let content = resp.text().await?;
5500        let entity: Option<SourcesLdapPartialUpdateError> = serde_json::from_str(&content).ok();
5501        Err(Error::ResponseError(ResponseContent {
5502            status,
5503            content,
5504            entity,
5505        }))
5506    }
5507}
5508
5509/// LDAP Source Viewset
5510pub async fn sources_ldap_retrieve(
5511    configuration: &configuration::Configuration,
5512    slug: &str,
5513) -> Result<models::LdapSource, Error<SourcesLdapRetrieveError>> {
5514    // add a prefix to parameters to efficiently prevent name collisions
5515    let p_path_slug = slug;
5516
5517    let uri_str = format!(
5518        "{}/sources/ldap/{slug}/",
5519        configuration.base_path,
5520        slug = crate::apis::urlencode(p_path_slug)
5521    );
5522    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5523
5524    if let Some(ref user_agent) = configuration.user_agent {
5525        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5526    }
5527    if let Some(ref token) = configuration.bearer_access_token {
5528        req_builder = req_builder.bearer_auth(token.to_owned());
5529    };
5530
5531    let req = req_builder.build()?;
5532    let resp = configuration.client.execute(req).await?;
5533
5534    let status = resp.status();
5535    let content_type = resp
5536        .headers()
5537        .get("content-type")
5538        .and_then(|v| v.to_str().ok())
5539        .unwrap_or("application/octet-stream");
5540    let content_type = super::ContentType::from(content_type);
5541
5542    if !status.is_client_error() && !status.is_server_error() {
5543        let content = resp.text().await?;
5544        match content_type {
5545            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5546            ContentType::Text => {
5547                return Err(Error::from(serde_json::Error::custom(
5548                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5549                )))
5550            }
5551            ContentType::Unsupported(unknown_type) => {
5552                return Err(Error::from(serde_json::Error::custom(format!(
5553                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5554                ))))
5555            }
5556        }
5557    } else {
5558        let content = resp.text().await?;
5559        let entity: Option<SourcesLdapRetrieveError> = serde_json::from_str(&content).ok();
5560        Err(Error::ResponseError(ResponseContent {
5561            status,
5562            content,
5563            entity,
5564        }))
5565    }
5566}
5567
5568/// Get provider's sync status
5569pub async fn sources_ldap_sync_status_retrieve(
5570    configuration: &configuration::Configuration,
5571    slug: &str,
5572) -> Result<models::SyncStatus, Error<SourcesLdapSyncStatusRetrieveError>> {
5573    // add a prefix to parameters to efficiently prevent name collisions
5574    let p_path_slug = slug;
5575
5576    let uri_str = format!(
5577        "{}/sources/ldap/{slug}/sync/status/",
5578        configuration.base_path,
5579        slug = crate::apis::urlencode(p_path_slug)
5580    );
5581    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5582
5583    if let Some(ref user_agent) = configuration.user_agent {
5584        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5585    }
5586    if let Some(ref token) = configuration.bearer_access_token {
5587        req_builder = req_builder.bearer_auth(token.to_owned());
5588    };
5589
5590    let req = req_builder.build()?;
5591    let resp = configuration.client.execute(req).await?;
5592
5593    let status = resp.status();
5594    let content_type = resp
5595        .headers()
5596        .get("content-type")
5597        .and_then(|v| v.to_str().ok())
5598        .unwrap_or("application/octet-stream");
5599    let content_type = super::ContentType::from(content_type);
5600
5601    if !status.is_client_error() && !status.is_server_error() {
5602        let content = resp.text().await?;
5603        match content_type {
5604            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5605            ContentType::Text => {
5606                return Err(Error::from(serde_json::Error::custom(
5607                    "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
5608                )))
5609            }
5610            ContentType::Unsupported(unknown_type) => {
5611                return Err(Error::from(serde_json::Error::custom(format!(
5612                    "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
5613                ))))
5614            }
5615        }
5616    } else {
5617        let content = resp.text().await?;
5618        let entity: Option<SourcesLdapSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
5619        Err(Error::ResponseError(ResponseContent {
5620            status,
5621            content,
5622            entity,
5623        }))
5624    }
5625}
5626
5627/// LDAP Source Viewset
5628pub async fn sources_ldap_update(
5629    configuration: &configuration::Configuration,
5630    slug: &str,
5631    ldap_source_request: models::LdapSourceRequest,
5632) -> Result<models::LdapSource, Error<SourcesLdapUpdateError>> {
5633    // add a prefix to parameters to efficiently prevent name collisions
5634    let p_path_slug = slug;
5635    let p_body_ldap_source_request = ldap_source_request;
5636
5637    let uri_str = format!(
5638        "{}/sources/ldap/{slug}/",
5639        configuration.base_path,
5640        slug = crate::apis::urlencode(p_path_slug)
5641    );
5642    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5643
5644    if let Some(ref user_agent) = configuration.user_agent {
5645        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5646    }
5647    if let Some(ref token) = configuration.bearer_access_token {
5648        req_builder = req_builder.bearer_auth(token.to_owned());
5649    };
5650    req_builder = req_builder.json(&p_body_ldap_source_request);
5651
5652    let req = req_builder.build()?;
5653    let resp = configuration.client.execute(req).await?;
5654
5655    let status = resp.status();
5656    let content_type = resp
5657        .headers()
5658        .get("content-type")
5659        .and_then(|v| v.to_str().ok())
5660        .unwrap_or("application/octet-stream");
5661    let content_type = super::ContentType::from(content_type);
5662
5663    if !status.is_client_error() && !status.is_server_error() {
5664        let content = resp.text().await?;
5665        match content_type {
5666            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5667            ContentType::Text => {
5668                return Err(Error::from(serde_json::Error::custom(
5669                    "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5670                )))
5671            }
5672            ContentType::Unsupported(unknown_type) => {
5673                return Err(Error::from(serde_json::Error::custom(format!(
5674                    "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5675                ))))
5676            }
5677        }
5678    } else {
5679        let content = resp.text().await?;
5680        let entity: Option<SourcesLdapUpdateError> = serde_json::from_str(&content).ok();
5681        Err(Error::ResponseError(ResponseContent {
5682            status,
5683            content,
5684            entity,
5685        }))
5686    }
5687}
5688
5689/// Get a list of all objects that use this object
5690pub async fn sources_ldap_used_by_list(
5691    configuration: &configuration::Configuration,
5692    slug: &str,
5693) -> Result<Vec<models::UsedBy>, Error<SourcesLdapUsedByListError>> {
5694    // add a prefix to parameters to efficiently prevent name collisions
5695    let p_path_slug = slug;
5696
5697    let uri_str = format!(
5698        "{}/sources/ldap/{slug}/used_by/",
5699        configuration.base_path,
5700        slug = crate::apis::urlencode(p_path_slug)
5701    );
5702    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5703
5704    if let Some(ref user_agent) = configuration.user_agent {
5705        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5706    }
5707    if let Some(ref token) = configuration.bearer_access_token {
5708        req_builder = req_builder.bearer_auth(token.to_owned());
5709    };
5710
5711    let req = req_builder.build()?;
5712    let resp = configuration.client.execute(req).await?;
5713
5714    let status = resp.status();
5715    let content_type = resp
5716        .headers()
5717        .get("content-type")
5718        .and_then(|v| v.to_str().ok())
5719        .unwrap_or("application/octet-stream");
5720    let content_type = super::ContentType::from(content_type);
5721
5722    if !status.is_client_error() && !status.is_server_error() {
5723        let content = resp.text().await?;
5724        match content_type {
5725            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5726            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;`"))),
5727            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;`")))),
5728        }
5729    } else {
5730        let content = resp.text().await?;
5731        let entity: Option<SourcesLdapUsedByListError> = serde_json::from_str(&content).ok();
5732        Err(Error::ResponseError(ResponseContent {
5733            status,
5734            content,
5735            entity,
5736        }))
5737    }
5738}
5739
5740/// Source Viewset
5741pub async fn sources_oauth_create(
5742    configuration: &configuration::Configuration,
5743    o_auth_source_request: models::OAuthSourceRequest,
5744) -> Result<models::OAuthSource, Error<SourcesOauthCreateError>> {
5745    // add a prefix to parameters to efficiently prevent name collisions
5746    let p_body_o_auth_source_request = o_auth_source_request;
5747
5748    let uri_str = format!("{}/sources/oauth/", configuration.base_path);
5749    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5750
5751    if let Some(ref user_agent) = configuration.user_agent {
5752        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5753    }
5754    if let Some(ref token) = configuration.bearer_access_token {
5755        req_builder = req_builder.bearer_auth(token.to_owned());
5756    };
5757    req_builder = req_builder.json(&p_body_o_auth_source_request);
5758
5759    let req = req_builder.build()?;
5760    let resp = configuration.client.execute(req).await?;
5761
5762    let status = resp.status();
5763    let content_type = resp
5764        .headers()
5765        .get("content-type")
5766        .and_then(|v| v.to_str().ok())
5767        .unwrap_or("application/octet-stream");
5768    let content_type = super::ContentType::from(content_type);
5769
5770    if !status.is_client_error() && !status.is_server_error() {
5771        let content = resp.text().await?;
5772        match content_type {
5773            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5774            ContentType::Text => {
5775                return Err(Error::from(serde_json::Error::custom(
5776                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5777                )))
5778            }
5779            ContentType::Unsupported(unknown_type) => {
5780                return Err(Error::from(serde_json::Error::custom(format!(
5781                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5782                ))))
5783            }
5784        }
5785    } else {
5786        let content = resp.text().await?;
5787        let entity: Option<SourcesOauthCreateError> = serde_json::from_str(&content).ok();
5788        Err(Error::ResponseError(ResponseContent {
5789            status,
5790            content,
5791            entity,
5792        }))
5793    }
5794}
5795
5796/// Source Viewset
5797pub async fn sources_oauth_destroy(
5798    configuration: &configuration::Configuration,
5799    slug: &str,
5800) -> Result<(), Error<SourcesOauthDestroyError>> {
5801    // add a prefix to parameters to efficiently prevent name collisions
5802    let p_path_slug = slug;
5803
5804    let uri_str = format!(
5805        "{}/sources/oauth/{slug}/",
5806        configuration.base_path,
5807        slug = crate::apis::urlencode(p_path_slug)
5808    );
5809    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5810
5811    if let Some(ref user_agent) = configuration.user_agent {
5812        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5813    }
5814    if let Some(ref token) = configuration.bearer_access_token {
5815        req_builder = req_builder.bearer_auth(token.to_owned());
5816    };
5817
5818    let req = req_builder.build()?;
5819    let resp = configuration.client.execute(req).await?;
5820
5821    let status = resp.status();
5822
5823    if !status.is_client_error() && !status.is_server_error() {
5824        Ok(())
5825    } else {
5826        let content = resp.text().await?;
5827        let entity: Option<SourcesOauthDestroyError> = serde_json::from_str(&content).ok();
5828        Err(Error::ResponseError(ResponseContent {
5829            status,
5830            content,
5831            entity,
5832        }))
5833    }
5834}
5835
5836/// Source Viewset
5837pub async fn sources_oauth_list(
5838    configuration: &configuration::Configuration,
5839    access_token_url: Option<&str>,
5840    additional_scopes: Option<&str>,
5841    authentication_flow: Option<&str>,
5842    authorization_url: Option<&str>,
5843    consumer_key: Option<&str>,
5844    enabled: Option<bool>,
5845    enrollment_flow: Option<&str>,
5846    group_matching_mode: Option<&str>,
5847    has_jwks: Option<bool>,
5848    name: Option<&str>,
5849    ordering: Option<&str>,
5850    page: Option<i32>,
5851    page_size: Option<i32>,
5852    pbm_uuid: Option<&str>,
5853    policy_engine_mode: Option<&str>,
5854    profile_url: Option<&str>,
5855    provider_type: Option<&str>,
5856    request_token_url: Option<&str>,
5857    search: Option<&str>,
5858    slug: Option<&str>,
5859    user_matching_mode: Option<&str>,
5860) -> Result<models::PaginatedOAuthSourceList, Error<SourcesOauthListError>> {
5861    // add a prefix to parameters to efficiently prevent name collisions
5862    let p_query_access_token_url = access_token_url;
5863    let p_query_additional_scopes = additional_scopes;
5864    let p_query_authentication_flow = authentication_flow;
5865    let p_query_authorization_url = authorization_url;
5866    let p_query_consumer_key = consumer_key;
5867    let p_query_enabled = enabled;
5868    let p_query_enrollment_flow = enrollment_flow;
5869    let p_query_group_matching_mode = group_matching_mode;
5870    let p_query_has_jwks = has_jwks;
5871    let p_query_name = name;
5872    let p_query_ordering = ordering;
5873    let p_query_page = page;
5874    let p_query_page_size = page_size;
5875    let p_query_pbm_uuid = pbm_uuid;
5876    let p_query_policy_engine_mode = policy_engine_mode;
5877    let p_query_profile_url = profile_url;
5878    let p_query_provider_type = provider_type;
5879    let p_query_request_token_url = request_token_url;
5880    let p_query_search = search;
5881    let p_query_slug = slug;
5882    let p_query_user_matching_mode = user_matching_mode;
5883
5884    let uri_str = format!("{}/sources/oauth/", configuration.base_path);
5885    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5886
5887    if let Some(ref param_value) = p_query_access_token_url {
5888        req_builder = req_builder.query(&[("access_token_url", &param_value.to_string())]);
5889    }
5890    if let Some(ref param_value) = p_query_additional_scopes {
5891        req_builder = req_builder.query(&[("additional_scopes", &param_value.to_string())]);
5892    }
5893    if let Some(ref param_value) = p_query_authentication_flow {
5894        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
5895    }
5896    if let Some(ref param_value) = p_query_authorization_url {
5897        req_builder = req_builder.query(&[("authorization_url", &param_value.to_string())]);
5898    }
5899    if let Some(ref param_value) = p_query_consumer_key {
5900        req_builder = req_builder.query(&[("consumer_key", &param_value.to_string())]);
5901    }
5902    if let Some(ref param_value) = p_query_enabled {
5903        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
5904    }
5905    if let Some(ref param_value) = p_query_enrollment_flow {
5906        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
5907    }
5908    if let Some(ref param_value) = p_query_group_matching_mode {
5909        req_builder = req_builder.query(&[("group_matching_mode", &param_value.to_string())]);
5910    }
5911    if let Some(ref param_value) = p_query_has_jwks {
5912        req_builder = req_builder.query(&[("has_jwks", &param_value.to_string())]);
5913    }
5914    if let Some(ref param_value) = p_query_name {
5915        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5916    }
5917    if let Some(ref param_value) = p_query_ordering {
5918        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5919    }
5920    if let Some(ref param_value) = p_query_page {
5921        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5922    }
5923    if let Some(ref param_value) = p_query_page_size {
5924        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5925    }
5926    if let Some(ref param_value) = p_query_pbm_uuid {
5927        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
5928    }
5929    if let Some(ref param_value) = p_query_policy_engine_mode {
5930        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
5931    }
5932    if let Some(ref param_value) = p_query_profile_url {
5933        req_builder = req_builder.query(&[("profile_url", &param_value.to_string())]);
5934    }
5935    if let Some(ref param_value) = p_query_provider_type {
5936        req_builder = req_builder.query(&[("provider_type", &param_value.to_string())]);
5937    }
5938    if let Some(ref param_value) = p_query_request_token_url {
5939        req_builder = req_builder.query(&[("request_token_url", &param_value.to_string())]);
5940    }
5941    if let Some(ref param_value) = p_query_search {
5942        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5943    }
5944    if let Some(ref param_value) = p_query_slug {
5945        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
5946    }
5947    if let Some(ref param_value) = p_query_user_matching_mode {
5948        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
5949    }
5950    if let Some(ref user_agent) = configuration.user_agent {
5951        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5952    }
5953    if let Some(ref token) = configuration.bearer_access_token {
5954        req_builder = req_builder.bearer_auth(token.to_owned());
5955    };
5956
5957    let req = req_builder.build()?;
5958    let resp = configuration.client.execute(req).await?;
5959
5960    let status = resp.status();
5961    let content_type = resp
5962        .headers()
5963        .get("content-type")
5964        .and_then(|v| v.to_str().ok())
5965        .unwrap_or("application/octet-stream");
5966    let content_type = super::ContentType::from(content_type);
5967
5968    if !status.is_client_error() && !status.is_server_error() {
5969        let content = resp.text().await?;
5970        match content_type {
5971            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5972            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOAuthSourceList`"))),
5973            ContentType::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`")))),
5974        }
5975    } else {
5976        let content = resp.text().await?;
5977        let entity: Option<SourcesOauthListError> = serde_json::from_str(&content).ok();
5978        Err(Error::ResponseError(ResponseContent {
5979            status,
5980            content,
5981            entity,
5982        }))
5983    }
5984}
5985
5986/// Source Viewset
5987pub async fn sources_oauth_partial_update(
5988    configuration: &configuration::Configuration,
5989    slug: &str,
5990    patched_o_auth_source_request: Option<models::PatchedOAuthSourceRequest>,
5991) -> Result<models::OAuthSource, Error<SourcesOauthPartialUpdateError>> {
5992    // add a prefix to parameters to efficiently prevent name collisions
5993    let p_path_slug = slug;
5994    let p_body_patched_o_auth_source_request = patched_o_auth_source_request;
5995
5996    let uri_str = format!(
5997        "{}/sources/oauth/{slug}/",
5998        configuration.base_path,
5999        slug = crate::apis::urlencode(p_path_slug)
6000    );
6001    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6002
6003    if let Some(ref user_agent) = configuration.user_agent {
6004        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6005    }
6006    if let Some(ref token) = configuration.bearer_access_token {
6007        req_builder = req_builder.bearer_auth(token.to_owned());
6008    };
6009    req_builder = req_builder.json(&p_body_patched_o_auth_source_request);
6010
6011    let req = req_builder.build()?;
6012    let resp = configuration.client.execute(req).await?;
6013
6014    let status = resp.status();
6015    let content_type = resp
6016        .headers()
6017        .get("content-type")
6018        .and_then(|v| v.to_str().ok())
6019        .unwrap_or("application/octet-stream");
6020    let content_type = super::ContentType::from(content_type);
6021
6022    if !status.is_client_error() && !status.is_server_error() {
6023        let content = resp.text().await?;
6024        match content_type {
6025            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6026            ContentType::Text => {
6027                return Err(Error::from(serde_json::Error::custom(
6028                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
6029                )))
6030            }
6031            ContentType::Unsupported(unknown_type) => {
6032                return Err(Error::from(serde_json::Error::custom(format!(
6033                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
6034                ))))
6035            }
6036        }
6037    } else {
6038        let content = resp.text().await?;
6039        let entity: Option<SourcesOauthPartialUpdateError> = serde_json::from_str(&content).ok();
6040        Err(Error::ResponseError(ResponseContent {
6041            status,
6042            content,
6043            entity,
6044        }))
6045    }
6046}
6047
6048/// Source Viewset
6049pub async fn sources_oauth_retrieve(
6050    configuration: &configuration::Configuration,
6051    slug: &str,
6052) -> Result<models::OAuthSource, Error<SourcesOauthRetrieveError>> {
6053    // add a prefix to parameters to efficiently prevent name collisions
6054    let p_path_slug = slug;
6055
6056    let uri_str = format!(
6057        "{}/sources/oauth/{slug}/",
6058        configuration.base_path,
6059        slug = crate::apis::urlencode(p_path_slug)
6060    );
6061    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6062
6063    if let Some(ref user_agent) = configuration.user_agent {
6064        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6065    }
6066    if let Some(ref token) = configuration.bearer_access_token {
6067        req_builder = req_builder.bearer_auth(token.to_owned());
6068    };
6069
6070    let req = req_builder.build()?;
6071    let resp = configuration.client.execute(req).await?;
6072
6073    let status = resp.status();
6074    let content_type = resp
6075        .headers()
6076        .get("content-type")
6077        .and_then(|v| v.to_str().ok())
6078        .unwrap_or("application/octet-stream");
6079    let content_type = super::ContentType::from(content_type);
6080
6081    if !status.is_client_error() && !status.is_server_error() {
6082        let content = resp.text().await?;
6083        match content_type {
6084            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6085            ContentType::Text => {
6086                return Err(Error::from(serde_json::Error::custom(
6087                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
6088                )))
6089            }
6090            ContentType::Unsupported(unknown_type) => {
6091                return Err(Error::from(serde_json::Error::custom(format!(
6092                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
6093                ))))
6094            }
6095        }
6096    } else {
6097        let content = resp.text().await?;
6098        let entity: Option<SourcesOauthRetrieveError> = serde_json::from_str(&content).ok();
6099        Err(Error::ResponseError(ResponseContent {
6100            status,
6101            content,
6102            entity,
6103        }))
6104    }
6105}
6106
6107/// Get all creatable source types. If ?name is set, only returns the type for <name>. If <name> isn't found, returns the default type.
6108pub async fn sources_oauth_source_types_list(
6109    configuration: &configuration::Configuration,
6110    name: Option<&str>,
6111) -> Result<Vec<models::SourceType>, Error<SourcesOauthSourceTypesListError>> {
6112    // add a prefix to parameters to efficiently prevent name collisions
6113    let p_query_name = name;
6114
6115    let uri_str = format!("{}/sources/oauth/source_types/", configuration.base_path);
6116    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6117
6118    if let Some(ref param_value) = p_query_name {
6119        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
6120    }
6121    if let Some(ref user_agent) = configuration.user_agent {
6122        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6123    }
6124    if let Some(ref token) = configuration.bearer_access_token {
6125        req_builder = req_builder.bearer_auth(token.to_owned());
6126    };
6127
6128    let req = req_builder.build()?;
6129    let resp = configuration.client.execute(req).await?;
6130
6131    let status = resp.status();
6132    let content_type = resp
6133        .headers()
6134        .get("content-type")
6135        .and_then(|v| v.to_str().ok())
6136        .unwrap_or("application/octet-stream");
6137    let content_type = super::ContentType::from(content_type);
6138
6139    if !status.is_client_error() && !status.is_server_error() {
6140        let content = resp.text().await?;
6141        match content_type {
6142            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6143            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;`"))),
6144            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;`")))),
6145        }
6146    } else {
6147        let content = resp.text().await?;
6148        let entity: Option<SourcesOauthSourceTypesListError> = serde_json::from_str(&content).ok();
6149        Err(Error::ResponseError(ResponseContent {
6150            status,
6151            content,
6152            entity,
6153        }))
6154    }
6155}
6156
6157/// Source Viewset
6158pub async fn sources_oauth_update(
6159    configuration: &configuration::Configuration,
6160    slug: &str,
6161    o_auth_source_request: models::OAuthSourceRequest,
6162) -> Result<models::OAuthSource, Error<SourcesOauthUpdateError>> {
6163    // add a prefix to parameters to efficiently prevent name collisions
6164    let p_path_slug = slug;
6165    let p_body_o_auth_source_request = o_auth_source_request;
6166
6167    let uri_str = format!(
6168        "{}/sources/oauth/{slug}/",
6169        configuration.base_path,
6170        slug = crate::apis::urlencode(p_path_slug)
6171    );
6172    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6173
6174    if let Some(ref user_agent) = configuration.user_agent {
6175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6176    }
6177    if let Some(ref token) = configuration.bearer_access_token {
6178        req_builder = req_builder.bearer_auth(token.to_owned());
6179    };
6180    req_builder = req_builder.json(&p_body_o_auth_source_request);
6181
6182    let req = req_builder.build()?;
6183    let resp = configuration.client.execute(req).await?;
6184
6185    let status = resp.status();
6186    let content_type = resp
6187        .headers()
6188        .get("content-type")
6189        .and_then(|v| v.to_str().ok())
6190        .unwrap_or("application/octet-stream");
6191    let content_type = super::ContentType::from(content_type);
6192
6193    if !status.is_client_error() && !status.is_server_error() {
6194        let content = resp.text().await?;
6195        match content_type {
6196            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6197            ContentType::Text => {
6198                return Err(Error::from(serde_json::Error::custom(
6199                    "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
6200                )))
6201            }
6202            ContentType::Unsupported(unknown_type) => {
6203                return Err(Error::from(serde_json::Error::custom(format!(
6204                    "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
6205                ))))
6206            }
6207        }
6208    } else {
6209        let content = resp.text().await?;
6210        let entity: Option<SourcesOauthUpdateError> = serde_json::from_str(&content).ok();
6211        Err(Error::ResponseError(ResponseContent {
6212            status,
6213            content,
6214            entity,
6215        }))
6216    }
6217}
6218
6219/// Get a list of all objects that use this object
6220pub async fn sources_oauth_used_by_list(
6221    configuration: &configuration::Configuration,
6222    slug: &str,
6223) -> Result<Vec<models::UsedBy>, Error<SourcesOauthUsedByListError>> {
6224    // add a prefix to parameters to efficiently prevent name collisions
6225    let p_path_slug = slug;
6226
6227    let uri_str = format!(
6228        "{}/sources/oauth/{slug}/used_by/",
6229        configuration.base_path,
6230        slug = crate::apis::urlencode(p_path_slug)
6231    );
6232    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6233
6234    if let Some(ref user_agent) = configuration.user_agent {
6235        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6236    }
6237    if let Some(ref token) = configuration.bearer_access_token {
6238        req_builder = req_builder.bearer_auth(token.to_owned());
6239    };
6240
6241    let req = req_builder.build()?;
6242    let resp = configuration.client.execute(req).await?;
6243
6244    let status = resp.status();
6245    let content_type = resp
6246        .headers()
6247        .get("content-type")
6248        .and_then(|v| v.to_str().ok())
6249        .unwrap_or("application/octet-stream");
6250    let content_type = super::ContentType::from(content_type);
6251
6252    if !status.is_client_error() && !status.is_server_error() {
6253        let content = resp.text().await?;
6254        match content_type {
6255            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6256            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;`"))),
6257            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;`")))),
6258        }
6259    } else {
6260        let content = resp.text().await?;
6261        let entity: Option<SourcesOauthUsedByListError> = serde_json::from_str(&content).ok();
6262        Err(Error::ResponseError(ResponseContent {
6263            status,
6264            content,
6265            entity,
6266        }))
6267    }
6268}
6269
6270/// Plex source Viewset
6271pub async fn sources_plex_create(
6272    configuration: &configuration::Configuration,
6273    plex_source_request: models::PlexSourceRequest,
6274) -> Result<models::PlexSource, Error<SourcesPlexCreateError>> {
6275    // add a prefix to parameters to efficiently prevent name collisions
6276    let p_body_plex_source_request = plex_source_request;
6277
6278    let uri_str = format!("{}/sources/plex/", configuration.base_path);
6279    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6280
6281    if let Some(ref user_agent) = configuration.user_agent {
6282        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6283    }
6284    if let Some(ref token) = configuration.bearer_access_token {
6285        req_builder = req_builder.bearer_auth(token.to_owned());
6286    };
6287    req_builder = req_builder.json(&p_body_plex_source_request);
6288
6289    let req = req_builder.build()?;
6290    let resp = configuration.client.execute(req).await?;
6291
6292    let status = resp.status();
6293    let content_type = resp
6294        .headers()
6295        .get("content-type")
6296        .and_then(|v| v.to_str().ok())
6297        .unwrap_or("application/octet-stream");
6298    let content_type = super::ContentType::from(content_type);
6299
6300    if !status.is_client_error() && !status.is_server_error() {
6301        let content = resp.text().await?;
6302        match content_type {
6303            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6304            ContentType::Text => {
6305                return Err(Error::from(serde_json::Error::custom(
6306                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6307                )))
6308            }
6309            ContentType::Unsupported(unknown_type) => {
6310                return Err(Error::from(serde_json::Error::custom(format!(
6311                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6312                ))))
6313            }
6314        }
6315    } else {
6316        let content = resp.text().await?;
6317        let entity: Option<SourcesPlexCreateError> = serde_json::from_str(&content).ok();
6318        Err(Error::ResponseError(ResponseContent {
6319            status,
6320            content,
6321            entity,
6322        }))
6323    }
6324}
6325
6326/// Plex source Viewset
6327pub async fn sources_plex_destroy(
6328    configuration: &configuration::Configuration,
6329    slug: &str,
6330) -> Result<(), Error<SourcesPlexDestroyError>> {
6331    // add a prefix to parameters to efficiently prevent name collisions
6332    let p_path_slug = slug;
6333
6334    let uri_str = format!(
6335        "{}/sources/plex/{slug}/",
6336        configuration.base_path,
6337        slug = crate::apis::urlencode(p_path_slug)
6338    );
6339    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6340
6341    if let Some(ref user_agent) = configuration.user_agent {
6342        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6343    }
6344    if let Some(ref token) = configuration.bearer_access_token {
6345        req_builder = req_builder.bearer_auth(token.to_owned());
6346    };
6347
6348    let req = req_builder.build()?;
6349    let resp = configuration.client.execute(req).await?;
6350
6351    let status = resp.status();
6352
6353    if !status.is_client_error() && !status.is_server_error() {
6354        Ok(())
6355    } else {
6356        let content = resp.text().await?;
6357        let entity: Option<SourcesPlexDestroyError> = serde_json::from_str(&content).ok();
6358        Err(Error::ResponseError(ResponseContent {
6359            status,
6360            content,
6361            entity,
6362        }))
6363    }
6364}
6365
6366/// Plex source Viewset
6367pub async fn sources_plex_list(
6368    configuration: &configuration::Configuration,
6369    allow_friends: Option<bool>,
6370    authentication_flow: Option<&str>,
6371    client_id: Option<&str>,
6372    enabled: Option<bool>,
6373    enrollment_flow: Option<&str>,
6374    group_matching_mode: Option<&str>,
6375    name: Option<&str>,
6376    ordering: Option<&str>,
6377    page: Option<i32>,
6378    page_size: Option<i32>,
6379    pbm_uuid: Option<&str>,
6380    policy_engine_mode: Option<&str>,
6381    search: Option<&str>,
6382    slug: Option<&str>,
6383    user_matching_mode: Option<&str>,
6384) -> Result<models::PaginatedPlexSourceList, Error<SourcesPlexListError>> {
6385    // add a prefix to parameters to efficiently prevent name collisions
6386    let p_query_allow_friends = allow_friends;
6387    let p_query_authentication_flow = authentication_flow;
6388    let p_query_client_id = client_id;
6389    let p_query_enabled = enabled;
6390    let p_query_enrollment_flow = enrollment_flow;
6391    let p_query_group_matching_mode = group_matching_mode;
6392    let p_query_name = name;
6393    let p_query_ordering = ordering;
6394    let p_query_page = page;
6395    let p_query_page_size = page_size;
6396    let p_query_pbm_uuid = pbm_uuid;
6397    let p_query_policy_engine_mode = policy_engine_mode;
6398    let p_query_search = search;
6399    let p_query_slug = slug;
6400    let p_query_user_matching_mode = user_matching_mode;
6401
6402    let uri_str = format!("{}/sources/plex/", configuration.base_path);
6403    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6404
6405    if let Some(ref param_value) = p_query_allow_friends {
6406        req_builder = req_builder.query(&[("allow_friends", &param_value.to_string())]);
6407    }
6408    if let Some(ref param_value) = p_query_authentication_flow {
6409        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
6410    }
6411    if let Some(ref param_value) = p_query_client_id {
6412        req_builder = req_builder.query(&[("client_id", &param_value.to_string())]);
6413    }
6414    if let Some(ref param_value) = p_query_enabled {
6415        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
6416    }
6417    if let Some(ref param_value) = p_query_enrollment_flow {
6418        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
6419    }
6420    if let Some(ref param_value) = p_query_group_matching_mode {
6421        req_builder = req_builder.query(&[("group_matching_mode", &param_value.to_string())]);
6422    }
6423    if let Some(ref param_value) = p_query_name {
6424        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
6425    }
6426    if let Some(ref param_value) = p_query_ordering {
6427        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
6428    }
6429    if let Some(ref param_value) = p_query_page {
6430        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
6431    }
6432    if let Some(ref param_value) = p_query_page_size {
6433        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
6434    }
6435    if let Some(ref param_value) = p_query_pbm_uuid {
6436        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
6437    }
6438    if let Some(ref param_value) = p_query_policy_engine_mode {
6439        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
6440    }
6441    if let Some(ref param_value) = p_query_search {
6442        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
6443    }
6444    if let Some(ref param_value) = p_query_slug {
6445        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
6446    }
6447    if let Some(ref param_value) = p_query_user_matching_mode {
6448        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
6449    }
6450    if let Some(ref user_agent) = configuration.user_agent {
6451        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6452    }
6453    if let Some(ref token) = configuration.bearer_access_token {
6454        req_builder = req_builder.bearer_auth(token.to_owned());
6455    };
6456
6457    let req = req_builder.build()?;
6458    let resp = configuration.client.execute(req).await?;
6459
6460    let status = resp.status();
6461    let content_type = resp
6462        .headers()
6463        .get("content-type")
6464        .and_then(|v| v.to_str().ok())
6465        .unwrap_or("application/octet-stream");
6466    let content_type = super::ContentType::from(content_type);
6467
6468    if !status.is_client_error() && !status.is_server_error() {
6469        let content = resp.text().await?;
6470        match content_type {
6471            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6472            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPlexSourceList`"))),
6473            ContentType::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`")))),
6474        }
6475    } else {
6476        let content = resp.text().await?;
6477        let entity: Option<SourcesPlexListError> = serde_json::from_str(&content).ok();
6478        Err(Error::ResponseError(ResponseContent {
6479            status,
6480            content,
6481            entity,
6482        }))
6483    }
6484}
6485
6486/// Plex source Viewset
6487pub async fn sources_plex_partial_update(
6488    configuration: &configuration::Configuration,
6489    slug: &str,
6490    patched_plex_source_request: Option<models::PatchedPlexSourceRequest>,
6491) -> Result<models::PlexSource, Error<SourcesPlexPartialUpdateError>> {
6492    // add a prefix to parameters to efficiently prevent name collisions
6493    let p_path_slug = slug;
6494    let p_body_patched_plex_source_request = patched_plex_source_request;
6495
6496    let uri_str = format!(
6497        "{}/sources/plex/{slug}/",
6498        configuration.base_path,
6499        slug = crate::apis::urlencode(p_path_slug)
6500    );
6501    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6502
6503    if let Some(ref user_agent) = configuration.user_agent {
6504        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6505    }
6506    if let Some(ref token) = configuration.bearer_access_token {
6507        req_builder = req_builder.bearer_auth(token.to_owned());
6508    };
6509    req_builder = req_builder.json(&p_body_patched_plex_source_request);
6510
6511    let req = req_builder.build()?;
6512    let resp = configuration.client.execute(req).await?;
6513
6514    let status = resp.status();
6515    let content_type = resp
6516        .headers()
6517        .get("content-type")
6518        .and_then(|v| v.to_str().ok())
6519        .unwrap_or("application/octet-stream");
6520    let content_type = super::ContentType::from(content_type);
6521
6522    if !status.is_client_error() && !status.is_server_error() {
6523        let content = resp.text().await?;
6524        match content_type {
6525            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6526            ContentType::Text => {
6527                return Err(Error::from(serde_json::Error::custom(
6528                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6529                )))
6530            }
6531            ContentType::Unsupported(unknown_type) => {
6532                return Err(Error::from(serde_json::Error::custom(format!(
6533                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6534                ))))
6535            }
6536        }
6537    } else {
6538        let content = resp.text().await?;
6539        let entity: Option<SourcesPlexPartialUpdateError> = serde_json::from_str(&content).ok();
6540        Err(Error::ResponseError(ResponseContent {
6541            status,
6542            content,
6543            entity,
6544        }))
6545    }
6546}
6547
6548/// Redeem a plex token for an authenticated user, creating a connection
6549pub async fn sources_plex_redeem_token_authenticated_create(
6550    configuration: &configuration::Configuration,
6551    plex_token_redeem_request: models::PlexTokenRedeemRequest,
6552    slug: Option<&str>,
6553) -> Result<(), Error<SourcesPlexRedeemTokenAuthenticatedCreateError>> {
6554    // add a prefix to parameters to efficiently prevent name collisions
6555    let p_body_plex_token_redeem_request = plex_token_redeem_request;
6556    let p_query_slug = slug;
6557
6558    let uri_str = format!("{}/sources/plex/redeem_token_authenticated/", configuration.base_path);
6559    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6560
6561    if let Some(ref param_value) = p_query_slug {
6562        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
6563    }
6564    if let Some(ref user_agent) = configuration.user_agent {
6565        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6566    }
6567    if let Some(ref token) = configuration.bearer_access_token {
6568        req_builder = req_builder.bearer_auth(token.to_owned());
6569    };
6570    req_builder = req_builder.json(&p_body_plex_token_redeem_request);
6571
6572    let req = req_builder.build()?;
6573    let resp = configuration.client.execute(req).await?;
6574
6575    let status = resp.status();
6576
6577    if !status.is_client_error() && !status.is_server_error() {
6578        Ok(())
6579    } else {
6580        let content = resp.text().await?;
6581        let entity: Option<SourcesPlexRedeemTokenAuthenticatedCreateError> = serde_json::from_str(&content).ok();
6582        Err(Error::ResponseError(ResponseContent {
6583            status,
6584            content,
6585            entity,
6586        }))
6587    }
6588}
6589
6590/// Redeem a plex token, check it's access to resources against what's allowed for the source, and redirect to an authentication/enrollment flow.
6591pub async fn sources_plex_redeem_token_create(
6592    configuration: &configuration::Configuration,
6593    plex_token_redeem_request: models::PlexTokenRedeemRequest,
6594    slug: Option<&str>,
6595) -> Result<models::RedirectChallenge, Error<SourcesPlexRedeemTokenCreateError>> {
6596    // add a prefix to parameters to efficiently prevent name collisions
6597    let p_body_plex_token_redeem_request = plex_token_redeem_request;
6598    let p_query_slug = slug;
6599
6600    let uri_str = format!("{}/sources/plex/redeem_token/", configuration.base_path);
6601    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6602
6603    if let Some(ref param_value) = p_query_slug {
6604        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
6605    }
6606    if let Some(ref user_agent) = configuration.user_agent {
6607        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6608    }
6609    if let Some(ref token) = configuration.bearer_access_token {
6610        req_builder = req_builder.bearer_auth(token.to_owned());
6611    };
6612    req_builder = req_builder.json(&p_body_plex_token_redeem_request);
6613
6614    let req = req_builder.build()?;
6615    let resp = configuration.client.execute(req).await?;
6616
6617    let status = resp.status();
6618    let content_type = resp
6619        .headers()
6620        .get("content-type")
6621        .and_then(|v| v.to_str().ok())
6622        .unwrap_or("application/octet-stream");
6623    let content_type = super::ContentType::from(content_type);
6624
6625    if !status.is_client_error() && !status.is_server_error() {
6626        let content = resp.text().await?;
6627        match content_type {
6628            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6629            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RedirectChallenge`"))),
6630            ContentType::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`")))),
6631        }
6632    } else {
6633        let content = resp.text().await?;
6634        let entity: Option<SourcesPlexRedeemTokenCreateError> = serde_json::from_str(&content).ok();
6635        Err(Error::ResponseError(ResponseContent {
6636            status,
6637            content,
6638            entity,
6639        }))
6640    }
6641}
6642
6643/// Plex source Viewset
6644pub async fn sources_plex_retrieve(
6645    configuration: &configuration::Configuration,
6646    slug: &str,
6647) -> Result<models::PlexSource, Error<SourcesPlexRetrieveError>> {
6648    // add a prefix to parameters to efficiently prevent name collisions
6649    let p_path_slug = slug;
6650
6651    let uri_str = format!(
6652        "{}/sources/plex/{slug}/",
6653        configuration.base_path,
6654        slug = crate::apis::urlencode(p_path_slug)
6655    );
6656    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6657
6658    if let Some(ref user_agent) = configuration.user_agent {
6659        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6660    }
6661    if let Some(ref token) = configuration.bearer_access_token {
6662        req_builder = req_builder.bearer_auth(token.to_owned());
6663    };
6664
6665    let req = req_builder.build()?;
6666    let resp = configuration.client.execute(req).await?;
6667
6668    let status = resp.status();
6669    let content_type = resp
6670        .headers()
6671        .get("content-type")
6672        .and_then(|v| v.to_str().ok())
6673        .unwrap_or("application/octet-stream");
6674    let content_type = super::ContentType::from(content_type);
6675
6676    if !status.is_client_error() && !status.is_server_error() {
6677        let content = resp.text().await?;
6678        match content_type {
6679            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6680            ContentType::Text => {
6681                return Err(Error::from(serde_json::Error::custom(
6682                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6683                )))
6684            }
6685            ContentType::Unsupported(unknown_type) => {
6686                return Err(Error::from(serde_json::Error::custom(format!(
6687                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6688                ))))
6689            }
6690        }
6691    } else {
6692        let content = resp.text().await?;
6693        let entity: Option<SourcesPlexRetrieveError> = serde_json::from_str(&content).ok();
6694        Err(Error::ResponseError(ResponseContent {
6695            status,
6696            content,
6697            entity,
6698        }))
6699    }
6700}
6701
6702/// Plex source Viewset
6703pub async fn sources_plex_update(
6704    configuration: &configuration::Configuration,
6705    slug: &str,
6706    plex_source_request: models::PlexSourceRequest,
6707) -> Result<models::PlexSource, Error<SourcesPlexUpdateError>> {
6708    // add a prefix to parameters to efficiently prevent name collisions
6709    let p_path_slug = slug;
6710    let p_body_plex_source_request = plex_source_request;
6711
6712    let uri_str = format!(
6713        "{}/sources/plex/{slug}/",
6714        configuration.base_path,
6715        slug = crate::apis::urlencode(p_path_slug)
6716    );
6717    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6718
6719    if let Some(ref user_agent) = configuration.user_agent {
6720        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6721    }
6722    if let Some(ref token) = configuration.bearer_access_token {
6723        req_builder = req_builder.bearer_auth(token.to_owned());
6724    };
6725    req_builder = req_builder.json(&p_body_plex_source_request);
6726
6727    let req = req_builder.build()?;
6728    let resp = configuration.client.execute(req).await?;
6729
6730    let status = resp.status();
6731    let content_type = resp
6732        .headers()
6733        .get("content-type")
6734        .and_then(|v| v.to_str().ok())
6735        .unwrap_or("application/octet-stream");
6736    let content_type = super::ContentType::from(content_type);
6737
6738    if !status.is_client_error() && !status.is_server_error() {
6739        let content = resp.text().await?;
6740        match content_type {
6741            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6742            ContentType::Text => {
6743                return Err(Error::from(serde_json::Error::custom(
6744                    "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6745                )))
6746            }
6747            ContentType::Unsupported(unknown_type) => {
6748                return Err(Error::from(serde_json::Error::custom(format!(
6749                    "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6750                ))))
6751            }
6752        }
6753    } else {
6754        let content = resp.text().await?;
6755        let entity: Option<SourcesPlexUpdateError> = serde_json::from_str(&content).ok();
6756        Err(Error::ResponseError(ResponseContent {
6757            status,
6758            content,
6759            entity,
6760        }))
6761    }
6762}
6763
6764/// Get a list of all objects that use this object
6765pub async fn sources_plex_used_by_list(
6766    configuration: &configuration::Configuration,
6767    slug: &str,
6768) -> Result<Vec<models::UsedBy>, Error<SourcesPlexUsedByListError>> {
6769    // add a prefix to parameters to efficiently prevent name collisions
6770    let p_path_slug = slug;
6771
6772    let uri_str = format!(
6773        "{}/sources/plex/{slug}/used_by/",
6774        configuration.base_path,
6775        slug = crate::apis::urlencode(p_path_slug)
6776    );
6777    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6778
6779    if let Some(ref user_agent) = configuration.user_agent {
6780        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6781    }
6782    if let Some(ref token) = configuration.bearer_access_token {
6783        req_builder = req_builder.bearer_auth(token.to_owned());
6784    };
6785
6786    let req = req_builder.build()?;
6787    let resp = configuration.client.execute(req).await?;
6788
6789    let status = resp.status();
6790    let content_type = resp
6791        .headers()
6792        .get("content-type")
6793        .and_then(|v| v.to_str().ok())
6794        .unwrap_or("application/octet-stream");
6795    let content_type = super::ContentType::from(content_type);
6796
6797    if !status.is_client_error() && !status.is_server_error() {
6798        let content = resp.text().await?;
6799        match content_type {
6800            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6801            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;`"))),
6802            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;`")))),
6803        }
6804    } else {
6805        let content = resp.text().await?;
6806        let entity: Option<SourcesPlexUsedByListError> = serde_json::from_str(&content).ok();
6807        Err(Error::ResponseError(ResponseContent {
6808            status,
6809            content,
6810            entity,
6811        }))
6812    }
6813}
6814
6815/// SAMLSource Viewset
6816pub async fn sources_saml_create(
6817    configuration: &configuration::Configuration,
6818    saml_source_request: models::SamlSourceRequest,
6819) -> Result<models::SamlSource, Error<SourcesSamlCreateError>> {
6820    // add a prefix to parameters to efficiently prevent name collisions
6821    let p_body_saml_source_request = saml_source_request;
6822
6823    let uri_str = format!("{}/sources/saml/", configuration.base_path);
6824    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6825
6826    if let Some(ref user_agent) = configuration.user_agent {
6827        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6828    }
6829    if let Some(ref token) = configuration.bearer_access_token {
6830        req_builder = req_builder.bearer_auth(token.to_owned());
6831    };
6832    req_builder = req_builder.json(&p_body_saml_source_request);
6833
6834    let req = req_builder.build()?;
6835    let resp = configuration.client.execute(req).await?;
6836
6837    let status = resp.status();
6838    let content_type = resp
6839        .headers()
6840        .get("content-type")
6841        .and_then(|v| v.to_str().ok())
6842        .unwrap_or("application/octet-stream");
6843    let content_type = super::ContentType::from(content_type);
6844
6845    if !status.is_client_error() && !status.is_server_error() {
6846        let content = resp.text().await?;
6847        match content_type {
6848            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6849            ContentType::Text => {
6850                return Err(Error::from(serde_json::Error::custom(
6851                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
6852                )))
6853            }
6854            ContentType::Unsupported(unknown_type) => {
6855                return Err(Error::from(serde_json::Error::custom(format!(
6856                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
6857                ))))
6858            }
6859        }
6860    } else {
6861        let content = resp.text().await?;
6862        let entity: Option<SourcesSamlCreateError> = serde_json::from_str(&content).ok();
6863        Err(Error::ResponseError(ResponseContent {
6864            status,
6865            content,
6866            entity,
6867        }))
6868    }
6869}
6870
6871/// SAMLSource Viewset
6872pub async fn sources_saml_destroy(
6873    configuration: &configuration::Configuration,
6874    slug: &str,
6875) -> Result<(), Error<SourcesSamlDestroyError>> {
6876    // add a prefix to parameters to efficiently prevent name collisions
6877    let p_path_slug = slug;
6878
6879    let uri_str = format!(
6880        "{}/sources/saml/{slug}/",
6881        configuration.base_path,
6882        slug = crate::apis::urlencode(p_path_slug)
6883    );
6884    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6885
6886    if let Some(ref user_agent) = configuration.user_agent {
6887        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6888    }
6889    if let Some(ref token) = configuration.bearer_access_token {
6890        req_builder = req_builder.bearer_auth(token.to_owned());
6891    };
6892
6893    let req = req_builder.build()?;
6894    let resp = configuration.client.execute(req).await?;
6895
6896    let status = resp.status();
6897
6898    if !status.is_client_error() && !status.is_server_error() {
6899        Ok(())
6900    } else {
6901        let content = resp.text().await?;
6902        let entity: Option<SourcesSamlDestroyError> = serde_json::from_str(&content).ok();
6903        Err(Error::ResponseError(ResponseContent {
6904            status,
6905            content,
6906            entity,
6907        }))
6908    }
6909}
6910
6911/// SAMLSource Viewset
6912pub async fn sources_saml_list(
6913    configuration: &configuration::Configuration,
6914    allow_idp_initiated: Option<bool>,
6915    authentication_flow: Option<&str>,
6916    binding_type: Option<&str>,
6917    digest_algorithm: Option<&str>,
6918    enabled: Option<bool>,
6919    enrollment_flow: Option<&str>,
6920    issuer: Option<&str>,
6921    managed: Option<&str>,
6922    name: Option<&str>,
6923    name_id_policy: Option<&str>,
6924    ordering: Option<&str>,
6925    page: Option<i32>,
6926    page_size: Option<i32>,
6927    pbm_uuid: Option<&str>,
6928    policy_engine_mode: Option<&str>,
6929    pre_authentication_flow: Option<&str>,
6930    search: Option<&str>,
6931    signature_algorithm: Option<&str>,
6932    signed_assertion: Option<bool>,
6933    signed_response: Option<bool>,
6934    signing_kp: Option<&str>,
6935    slo_url: Option<&str>,
6936    slug: Option<&str>,
6937    sso_url: Option<&str>,
6938    temporary_user_delete_after: Option<&str>,
6939    user_matching_mode: Option<&str>,
6940    verification_kp: Option<&str>,
6941) -> Result<models::PaginatedSamlSourceList, Error<SourcesSamlListError>> {
6942    // add a prefix to parameters to efficiently prevent name collisions
6943    let p_query_allow_idp_initiated = allow_idp_initiated;
6944    let p_query_authentication_flow = authentication_flow;
6945    let p_query_binding_type = binding_type;
6946    let p_query_digest_algorithm = digest_algorithm;
6947    let p_query_enabled = enabled;
6948    let p_query_enrollment_flow = enrollment_flow;
6949    let p_query_issuer = issuer;
6950    let p_query_managed = managed;
6951    let p_query_name = name;
6952    let p_query_name_id_policy = name_id_policy;
6953    let p_query_ordering = ordering;
6954    let p_query_page = page;
6955    let p_query_page_size = page_size;
6956    let p_query_pbm_uuid = pbm_uuid;
6957    let p_query_policy_engine_mode = policy_engine_mode;
6958    let p_query_pre_authentication_flow = pre_authentication_flow;
6959    let p_query_search = search;
6960    let p_query_signature_algorithm = signature_algorithm;
6961    let p_query_signed_assertion = signed_assertion;
6962    let p_query_signed_response = signed_response;
6963    let p_query_signing_kp = signing_kp;
6964    let p_query_slo_url = slo_url;
6965    let p_query_slug = slug;
6966    let p_query_sso_url = sso_url;
6967    let p_query_temporary_user_delete_after = temporary_user_delete_after;
6968    let p_query_user_matching_mode = user_matching_mode;
6969    let p_query_verification_kp = verification_kp;
6970
6971    let uri_str = format!("{}/sources/saml/", configuration.base_path);
6972    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6973
6974    if let Some(ref param_value) = p_query_allow_idp_initiated {
6975        req_builder = req_builder.query(&[("allow_idp_initiated", &param_value.to_string())]);
6976    }
6977    if let Some(ref param_value) = p_query_authentication_flow {
6978        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
6979    }
6980    if let Some(ref param_value) = p_query_binding_type {
6981        req_builder = req_builder.query(&[("binding_type", &param_value.to_string())]);
6982    }
6983    if let Some(ref param_value) = p_query_digest_algorithm {
6984        req_builder = req_builder.query(&[("digest_algorithm", &param_value.to_string())]);
6985    }
6986    if let Some(ref param_value) = p_query_enabled {
6987        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
6988    }
6989    if let Some(ref param_value) = p_query_enrollment_flow {
6990        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
6991    }
6992    if let Some(ref param_value) = p_query_issuer {
6993        req_builder = req_builder.query(&[("issuer", &param_value.to_string())]);
6994    }
6995    if let Some(ref param_value) = p_query_managed {
6996        req_builder = req_builder.query(&[("managed", &param_value.to_string())]);
6997    }
6998    if let Some(ref param_value) = p_query_name {
6999        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
7000    }
7001    if let Some(ref param_value) = p_query_name_id_policy {
7002        req_builder = req_builder.query(&[("name_id_policy", &param_value.to_string())]);
7003    }
7004    if let Some(ref param_value) = p_query_ordering {
7005        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7006    }
7007    if let Some(ref param_value) = p_query_page {
7008        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7009    }
7010    if let Some(ref param_value) = p_query_page_size {
7011        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7012    }
7013    if let Some(ref param_value) = p_query_pbm_uuid {
7014        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
7015    }
7016    if let Some(ref param_value) = p_query_policy_engine_mode {
7017        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
7018    }
7019    if let Some(ref param_value) = p_query_pre_authentication_flow {
7020        req_builder = req_builder.query(&[("pre_authentication_flow", &param_value.to_string())]);
7021    }
7022    if let Some(ref param_value) = p_query_search {
7023        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7024    }
7025    if let Some(ref param_value) = p_query_signature_algorithm {
7026        req_builder = req_builder.query(&[("signature_algorithm", &param_value.to_string())]);
7027    }
7028    if let Some(ref param_value) = p_query_signed_assertion {
7029        req_builder = req_builder.query(&[("signed_assertion", &param_value.to_string())]);
7030    }
7031    if let Some(ref param_value) = p_query_signed_response {
7032        req_builder = req_builder.query(&[("signed_response", &param_value.to_string())]);
7033    }
7034    if let Some(ref param_value) = p_query_signing_kp {
7035        req_builder = req_builder.query(&[("signing_kp", &param_value.to_string())]);
7036    }
7037    if let Some(ref param_value) = p_query_slo_url {
7038        req_builder = req_builder.query(&[("slo_url", &param_value.to_string())]);
7039    }
7040    if let Some(ref param_value) = p_query_slug {
7041        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
7042    }
7043    if let Some(ref param_value) = p_query_sso_url {
7044        req_builder = req_builder.query(&[("sso_url", &param_value.to_string())]);
7045    }
7046    if let Some(ref param_value) = p_query_temporary_user_delete_after {
7047        req_builder = req_builder.query(&[("temporary_user_delete_after", &param_value.to_string())]);
7048    }
7049    if let Some(ref param_value) = p_query_user_matching_mode {
7050        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
7051    }
7052    if let Some(ref param_value) = p_query_verification_kp {
7053        req_builder = req_builder.query(&[("verification_kp", &param_value.to_string())]);
7054    }
7055    if let Some(ref user_agent) = configuration.user_agent {
7056        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7057    }
7058    if let Some(ref token) = configuration.bearer_access_token {
7059        req_builder = req_builder.bearer_auth(token.to_owned());
7060    };
7061
7062    let req = req_builder.build()?;
7063    let resp = configuration.client.execute(req).await?;
7064
7065    let status = resp.status();
7066    let content_type = resp
7067        .headers()
7068        .get("content-type")
7069        .and_then(|v| v.to_str().ok())
7070        .unwrap_or("application/octet-stream");
7071    let content_type = super::ContentType::from(content_type);
7072
7073    if !status.is_client_error() && !status.is_server_error() {
7074        let content = resp.text().await?;
7075        match content_type {
7076            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7077            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlSourceList`"))),
7078            ContentType::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`")))),
7079        }
7080    } else {
7081        let content = resp.text().await?;
7082        let entity: Option<SourcesSamlListError> = serde_json::from_str(&content).ok();
7083        Err(Error::ResponseError(ResponseContent {
7084            status,
7085            content,
7086            entity,
7087        }))
7088    }
7089}
7090
7091/// Return metadata as XML string
7092pub async fn sources_saml_metadata_retrieve(
7093    configuration: &configuration::Configuration,
7094    slug: &str,
7095) -> Result<models::SamlMetadata, Error<SourcesSamlMetadataRetrieveError>> {
7096    // add a prefix to parameters to efficiently prevent name collisions
7097    let p_path_slug = slug;
7098
7099    let uri_str = format!(
7100        "{}/sources/saml/{slug}/metadata/",
7101        configuration.base_path,
7102        slug = crate::apis::urlencode(p_path_slug)
7103    );
7104    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7105
7106    if let Some(ref user_agent) = configuration.user_agent {
7107        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7108    }
7109    if let Some(ref token) = configuration.bearer_access_token {
7110        req_builder = req_builder.bearer_auth(token.to_owned());
7111    };
7112
7113    let req = req_builder.build()?;
7114    let resp = configuration.client.execute(req).await?;
7115
7116    let status = resp.status();
7117    let content_type = resp
7118        .headers()
7119        .get("content-type")
7120        .and_then(|v| v.to_str().ok())
7121        .unwrap_or("application/octet-stream");
7122    let content_type = super::ContentType::from(content_type);
7123
7124    if !status.is_client_error() && !status.is_server_error() {
7125        let content = resp.text().await?;
7126        match content_type {
7127            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7128            ContentType::Text => {
7129                return Err(Error::from(serde_json::Error::custom(
7130                    "Received `text/plain` content type response that cannot be converted to `models::SamlMetadata`",
7131                )))
7132            }
7133            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7134                "Received `{unknown_type}` content type response that cannot be converted to `models::SamlMetadata`"
7135            )))),
7136        }
7137    } else {
7138        let content = resp.text().await?;
7139        let entity: Option<SourcesSamlMetadataRetrieveError> = serde_json::from_str(&content).ok();
7140        Err(Error::ResponseError(ResponseContent {
7141            status,
7142            content,
7143            entity,
7144        }))
7145    }
7146}
7147
7148/// SAMLSource Viewset
7149pub async fn sources_saml_partial_update(
7150    configuration: &configuration::Configuration,
7151    slug: &str,
7152    patched_saml_source_request: Option<models::PatchedSamlSourceRequest>,
7153) -> Result<models::SamlSource, Error<SourcesSamlPartialUpdateError>> {
7154    // add a prefix to parameters to efficiently prevent name collisions
7155    let p_path_slug = slug;
7156    let p_body_patched_saml_source_request = patched_saml_source_request;
7157
7158    let uri_str = format!(
7159        "{}/sources/saml/{slug}/",
7160        configuration.base_path,
7161        slug = crate::apis::urlencode(p_path_slug)
7162    );
7163    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7164
7165    if let Some(ref user_agent) = configuration.user_agent {
7166        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7167    }
7168    if let Some(ref token) = configuration.bearer_access_token {
7169        req_builder = req_builder.bearer_auth(token.to_owned());
7170    };
7171    req_builder = req_builder.json(&p_body_patched_saml_source_request);
7172
7173    let req = req_builder.build()?;
7174    let resp = configuration.client.execute(req).await?;
7175
7176    let status = resp.status();
7177    let content_type = resp
7178        .headers()
7179        .get("content-type")
7180        .and_then(|v| v.to_str().ok())
7181        .unwrap_or("application/octet-stream");
7182    let content_type = super::ContentType::from(content_type);
7183
7184    if !status.is_client_error() && !status.is_server_error() {
7185        let content = resp.text().await?;
7186        match content_type {
7187            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7188            ContentType::Text => {
7189                return Err(Error::from(serde_json::Error::custom(
7190                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
7191                )))
7192            }
7193            ContentType::Unsupported(unknown_type) => {
7194                return Err(Error::from(serde_json::Error::custom(format!(
7195                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
7196                ))))
7197            }
7198        }
7199    } else {
7200        let content = resp.text().await?;
7201        let entity: Option<SourcesSamlPartialUpdateError> = serde_json::from_str(&content).ok();
7202        Err(Error::ResponseError(ResponseContent {
7203            status,
7204            content,
7205            entity,
7206        }))
7207    }
7208}
7209
7210/// SAMLSource Viewset
7211pub async fn sources_saml_retrieve(
7212    configuration: &configuration::Configuration,
7213    slug: &str,
7214) -> Result<models::SamlSource, Error<SourcesSamlRetrieveError>> {
7215    // add a prefix to parameters to efficiently prevent name collisions
7216    let p_path_slug = slug;
7217
7218    let uri_str = format!(
7219        "{}/sources/saml/{slug}/",
7220        configuration.base_path,
7221        slug = crate::apis::urlencode(p_path_slug)
7222    );
7223    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7224
7225    if let Some(ref user_agent) = configuration.user_agent {
7226        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7227    }
7228    if let Some(ref token) = configuration.bearer_access_token {
7229        req_builder = req_builder.bearer_auth(token.to_owned());
7230    };
7231
7232    let req = req_builder.build()?;
7233    let resp = configuration.client.execute(req).await?;
7234
7235    let status = resp.status();
7236    let content_type = resp
7237        .headers()
7238        .get("content-type")
7239        .and_then(|v| v.to_str().ok())
7240        .unwrap_or("application/octet-stream");
7241    let content_type = super::ContentType::from(content_type);
7242
7243    if !status.is_client_error() && !status.is_server_error() {
7244        let content = resp.text().await?;
7245        match content_type {
7246            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7247            ContentType::Text => {
7248                return Err(Error::from(serde_json::Error::custom(
7249                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
7250                )))
7251            }
7252            ContentType::Unsupported(unknown_type) => {
7253                return Err(Error::from(serde_json::Error::custom(format!(
7254                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
7255                ))))
7256            }
7257        }
7258    } else {
7259        let content = resp.text().await?;
7260        let entity: Option<SourcesSamlRetrieveError> = serde_json::from_str(&content).ok();
7261        Err(Error::ResponseError(ResponseContent {
7262            status,
7263            content,
7264            entity,
7265        }))
7266    }
7267}
7268
7269/// SAMLSource Viewset
7270pub async fn sources_saml_update(
7271    configuration: &configuration::Configuration,
7272    slug: &str,
7273    saml_source_request: models::SamlSourceRequest,
7274) -> Result<models::SamlSource, Error<SourcesSamlUpdateError>> {
7275    // add a prefix to parameters to efficiently prevent name collisions
7276    let p_path_slug = slug;
7277    let p_body_saml_source_request = saml_source_request;
7278
7279    let uri_str = format!(
7280        "{}/sources/saml/{slug}/",
7281        configuration.base_path,
7282        slug = crate::apis::urlencode(p_path_slug)
7283    );
7284    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7285
7286    if let Some(ref user_agent) = configuration.user_agent {
7287        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7288    }
7289    if let Some(ref token) = configuration.bearer_access_token {
7290        req_builder = req_builder.bearer_auth(token.to_owned());
7291    };
7292    req_builder = req_builder.json(&p_body_saml_source_request);
7293
7294    let req = req_builder.build()?;
7295    let resp = configuration.client.execute(req).await?;
7296
7297    let status = resp.status();
7298    let content_type = resp
7299        .headers()
7300        .get("content-type")
7301        .and_then(|v| v.to_str().ok())
7302        .unwrap_or("application/octet-stream");
7303    let content_type = super::ContentType::from(content_type);
7304
7305    if !status.is_client_error() && !status.is_server_error() {
7306        let content = resp.text().await?;
7307        match content_type {
7308            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7309            ContentType::Text => {
7310                return Err(Error::from(serde_json::Error::custom(
7311                    "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
7312                )))
7313            }
7314            ContentType::Unsupported(unknown_type) => {
7315                return Err(Error::from(serde_json::Error::custom(format!(
7316                    "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
7317                ))))
7318            }
7319        }
7320    } else {
7321        let content = resp.text().await?;
7322        let entity: Option<SourcesSamlUpdateError> = serde_json::from_str(&content).ok();
7323        Err(Error::ResponseError(ResponseContent {
7324            status,
7325            content,
7326            entity,
7327        }))
7328    }
7329}
7330
7331/// Get a list of all objects that use this object
7332pub async fn sources_saml_used_by_list(
7333    configuration: &configuration::Configuration,
7334    slug: &str,
7335) -> Result<Vec<models::UsedBy>, Error<SourcesSamlUsedByListError>> {
7336    // add a prefix to parameters to efficiently prevent name collisions
7337    let p_path_slug = slug;
7338
7339    let uri_str = format!(
7340        "{}/sources/saml/{slug}/used_by/",
7341        configuration.base_path,
7342        slug = crate::apis::urlencode(p_path_slug)
7343    );
7344    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7345
7346    if let Some(ref user_agent) = configuration.user_agent {
7347        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7348    }
7349    if let Some(ref token) = configuration.bearer_access_token {
7350        req_builder = req_builder.bearer_auth(token.to_owned());
7351    };
7352
7353    let req = req_builder.build()?;
7354    let resp = configuration.client.execute(req).await?;
7355
7356    let status = resp.status();
7357    let content_type = resp
7358        .headers()
7359        .get("content-type")
7360        .and_then(|v| v.to_str().ok())
7361        .unwrap_or("application/octet-stream");
7362    let content_type = super::ContentType::from(content_type);
7363
7364    if !status.is_client_error() && !status.is_server_error() {
7365        let content = resp.text().await?;
7366        match content_type {
7367            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7368            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;`"))),
7369            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;`")))),
7370        }
7371    } else {
7372        let content = resp.text().await?;
7373        let entity: Option<SourcesSamlUsedByListError> = serde_json::from_str(&content).ok();
7374        Err(Error::ResponseError(ResponseContent {
7375            status,
7376            content,
7377            entity,
7378        }))
7379    }
7380}
7381
7382/// SCIMSource Viewset
7383pub async fn sources_scim_create(
7384    configuration: &configuration::Configuration,
7385    scim_source_request: models::ScimSourceRequest,
7386) -> Result<models::ScimSource, Error<SourcesScimCreateError>> {
7387    // add a prefix to parameters to efficiently prevent name collisions
7388    let p_body_scim_source_request = scim_source_request;
7389
7390    let uri_str = format!("{}/sources/scim/", configuration.base_path);
7391    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7392
7393    if let Some(ref user_agent) = configuration.user_agent {
7394        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7395    }
7396    if let Some(ref token) = configuration.bearer_access_token {
7397        req_builder = req_builder.bearer_auth(token.to_owned());
7398    };
7399    req_builder = req_builder.json(&p_body_scim_source_request);
7400
7401    let req = req_builder.build()?;
7402    let resp = configuration.client.execute(req).await?;
7403
7404    let status = resp.status();
7405    let content_type = resp
7406        .headers()
7407        .get("content-type")
7408        .and_then(|v| v.to_str().ok())
7409        .unwrap_or("application/octet-stream");
7410    let content_type = super::ContentType::from(content_type);
7411
7412    if !status.is_client_error() && !status.is_server_error() {
7413        let content = resp.text().await?;
7414        match content_type {
7415            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7416            ContentType::Text => {
7417                return Err(Error::from(serde_json::Error::custom(
7418                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7419                )))
7420            }
7421            ContentType::Unsupported(unknown_type) => {
7422                return Err(Error::from(serde_json::Error::custom(format!(
7423                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7424                ))))
7425            }
7426        }
7427    } else {
7428        let content = resp.text().await?;
7429        let entity: Option<SourcesScimCreateError> = serde_json::from_str(&content).ok();
7430        Err(Error::ResponseError(ResponseContent {
7431            status,
7432            content,
7433            entity,
7434        }))
7435    }
7436}
7437
7438/// SCIMSource Viewset
7439pub async fn sources_scim_destroy(
7440    configuration: &configuration::Configuration,
7441    slug: &str,
7442) -> Result<(), Error<SourcesScimDestroyError>> {
7443    // add a prefix to parameters to efficiently prevent name collisions
7444    let p_path_slug = slug;
7445
7446    let uri_str = format!(
7447        "{}/sources/scim/{slug}/",
7448        configuration.base_path,
7449        slug = crate::apis::urlencode(p_path_slug)
7450    );
7451    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7452
7453    if let Some(ref user_agent) = configuration.user_agent {
7454        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7455    }
7456    if let Some(ref token) = configuration.bearer_access_token {
7457        req_builder = req_builder.bearer_auth(token.to_owned());
7458    };
7459
7460    let req = req_builder.build()?;
7461    let resp = configuration.client.execute(req).await?;
7462
7463    let status = resp.status();
7464
7465    if !status.is_client_error() && !status.is_server_error() {
7466        Ok(())
7467    } else {
7468        let content = resp.text().await?;
7469        let entity: Option<SourcesScimDestroyError> = serde_json::from_str(&content).ok();
7470        Err(Error::ResponseError(ResponseContent {
7471            status,
7472            content,
7473            entity,
7474        }))
7475    }
7476}
7477
7478/// SCIMSourceGroup Viewset
7479pub async fn sources_scim_groups_create(
7480    configuration: &configuration::Configuration,
7481    scim_source_group_request: models::ScimSourceGroupRequest,
7482) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsCreateError>> {
7483    // add a prefix to parameters to efficiently prevent name collisions
7484    let p_body_scim_source_group_request = scim_source_group_request;
7485
7486    let uri_str = format!("{}/sources/scim_groups/", configuration.base_path);
7487    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7488
7489    if let Some(ref user_agent) = configuration.user_agent {
7490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7491    }
7492    if let Some(ref token) = configuration.bearer_access_token {
7493        req_builder = req_builder.bearer_auth(token.to_owned());
7494    };
7495    req_builder = req_builder.json(&p_body_scim_source_group_request);
7496
7497    let req = req_builder.build()?;
7498    let resp = configuration.client.execute(req).await?;
7499
7500    let status = resp.status();
7501    let content_type = resp
7502        .headers()
7503        .get("content-type")
7504        .and_then(|v| v.to_str().ok())
7505        .unwrap_or("application/octet-stream");
7506    let content_type = super::ContentType::from(content_type);
7507
7508    if !status.is_client_error() && !status.is_server_error() {
7509        let content = resp.text().await?;
7510        match content_type {
7511            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7512            ContentType::Text => {
7513                return Err(Error::from(serde_json::Error::custom(
7514                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7515                )))
7516            }
7517            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7518                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7519            )))),
7520        }
7521    } else {
7522        let content = resp.text().await?;
7523        let entity: Option<SourcesScimGroupsCreateError> = serde_json::from_str(&content).ok();
7524        Err(Error::ResponseError(ResponseContent {
7525            status,
7526            content,
7527            entity,
7528        }))
7529    }
7530}
7531
7532/// SCIMSourceGroup Viewset
7533pub async fn sources_scim_groups_destroy(
7534    configuration: &configuration::Configuration,
7535    id: &str,
7536) -> Result<(), Error<SourcesScimGroupsDestroyError>> {
7537    // add a prefix to parameters to efficiently prevent name collisions
7538    let p_path_id = id;
7539
7540    let uri_str = format!(
7541        "{}/sources/scim_groups/{id}/",
7542        configuration.base_path,
7543        id = crate::apis::urlencode(p_path_id)
7544    );
7545    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7546
7547    if let Some(ref user_agent) = configuration.user_agent {
7548        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7549    }
7550    if let Some(ref token) = configuration.bearer_access_token {
7551        req_builder = req_builder.bearer_auth(token.to_owned());
7552    };
7553
7554    let req = req_builder.build()?;
7555    let resp = configuration.client.execute(req).await?;
7556
7557    let status = resp.status();
7558
7559    if !status.is_client_error() && !status.is_server_error() {
7560        Ok(())
7561    } else {
7562        let content = resp.text().await?;
7563        let entity: Option<SourcesScimGroupsDestroyError> = serde_json::from_str(&content).ok();
7564        Err(Error::ResponseError(ResponseContent {
7565            status,
7566            content,
7567            entity,
7568        }))
7569    }
7570}
7571
7572/// SCIMSourceGroup Viewset
7573pub async fn sources_scim_groups_list(
7574    configuration: &configuration::Configuration,
7575    group__group_uuid: Option<&str>,
7576    group__name: Option<&str>,
7577    ordering: Option<&str>,
7578    page: Option<i32>,
7579    page_size: Option<i32>,
7580    search: Option<&str>,
7581    source__slug: Option<&str>,
7582) -> Result<models::PaginatedScimSourceGroupList, Error<SourcesScimGroupsListError>> {
7583    // add a prefix to parameters to efficiently prevent name collisions
7584    let p_query_group__group_uuid = group__group_uuid;
7585    let p_query_group__name = group__name;
7586    let p_query_ordering = ordering;
7587    let p_query_page = page;
7588    let p_query_page_size = page_size;
7589    let p_query_search = search;
7590    let p_query_source__slug = source__slug;
7591
7592    let uri_str = format!("{}/sources/scim_groups/", configuration.base_path);
7593    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7594
7595    if let Some(ref param_value) = p_query_group__group_uuid {
7596        req_builder = req_builder.query(&[("group__group_uuid", &param_value.to_string())]);
7597    }
7598    if let Some(ref param_value) = p_query_group__name {
7599        req_builder = req_builder.query(&[("group__name", &param_value.to_string())]);
7600    }
7601    if let Some(ref param_value) = p_query_ordering {
7602        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7603    }
7604    if let Some(ref param_value) = p_query_page {
7605        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7606    }
7607    if let Some(ref param_value) = p_query_page_size {
7608        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7609    }
7610    if let Some(ref param_value) = p_query_search {
7611        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7612    }
7613    if let Some(ref param_value) = p_query_source__slug {
7614        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
7615    }
7616    if let Some(ref user_agent) = configuration.user_agent {
7617        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7618    }
7619    if let Some(ref token) = configuration.bearer_access_token {
7620        req_builder = req_builder.bearer_auth(token.to_owned());
7621    };
7622
7623    let req = req_builder.build()?;
7624    let resp = configuration.client.execute(req).await?;
7625
7626    let status = resp.status();
7627    let content_type = resp
7628        .headers()
7629        .get("content-type")
7630        .and_then(|v| v.to_str().ok())
7631        .unwrap_or("application/octet-stream");
7632    let content_type = super::ContentType::from(content_type);
7633
7634    if !status.is_client_error() && !status.is_server_error() {
7635        let content = resp.text().await?;
7636        match content_type {
7637            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7638            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceGroupList`"))),
7639            ContentType::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`")))),
7640        }
7641    } else {
7642        let content = resp.text().await?;
7643        let entity: Option<SourcesScimGroupsListError> = serde_json::from_str(&content).ok();
7644        Err(Error::ResponseError(ResponseContent {
7645            status,
7646            content,
7647            entity,
7648        }))
7649    }
7650}
7651
7652/// SCIMSourceGroup Viewset
7653pub async fn sources_scim_groups_partial_update(
7654    configuration: &configuration::Configuration,
7655    id: &str,
7656    patched_scim_source_group_request: Option<models::PatchedScimSourceGroupRequest>,
7657) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsPartialUpdateError>> {
7658    // add a prefix to parameters to efficiently prevent name collisions
7659    let p_path_id = id;
7660    let p_body_patched_scim_source_group_request = patched_scim_source_group_request;
7661
7662    let uri_str = format!(
7663        "{}/sources/scim_groups/{id}/",
7664        configuration.base_path,
7665        id = crate::apis::urlencode(p_path_id)
7666    );
7667    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7668
7669    if let Some(ref user_agent) = configuration.user_agent {
7670        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7671    }
7672    if let Some(ref token) = configuration.bearer_access_token {
7673        req_builder = req_builder.bearer_auth(token.to_owned());
7674    };
7675    req_builder = req_builder.json(&p_body_patched_scim_source_group_request);
7676
7677    let req = req_builder.build()?;
7678    let resp = configuration.client.execute(req).await?;
7679
7680    let status = resp.status();
7681    let content_type = resp
7682        .headers()
7683        .get("content-type")
7684        .and_then(|v| v.to_str().ok())
7685        .unwrap_or("application/octet-stream");
7686    let content_type = super::ContentType::from(content_type);
7687
7688    if !status.is_client_error() && !status.is_server_error() {
7689        let content = resp.text().await?;
7690        match content_type {
7691            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7692            ContentType::Text => {
7693                return Err(Error::from(serde_json::Error::custom(
7694                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7695                )))
7696            }
7697            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7698                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7699            )))),
7700        }
7701    } else {
7702        let content = resp.text().await?;
7703        let entity: Option<SourcesScimGroupsPartialUpdateError> = serde_json::from_str(&content).ok();
7704        Err(Error::ResponseError(ResponseContent {
7705            status,
7706            content,
7707            entity,
7708        }))
7709    }
7710}
7711
7712/// SCIMSourceGroup Viewset
7713pub async fn sources_scim_groups_retrieve(
7714    configuration: &configuration::Configuration,
7715    id: &str,
7716) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsRetrieveError>> {
7717    // add a prefix to parameters to efficiently prevent name collisions
7718    let p_path_id = id;
7719
7720    let uri_str = format!(
7721        "{}/sources/scim_groups/{id}/",
7722        configuration.base_path,
7723        id = crate::apis::urlencode(p_path_id)
7724    );
7725    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7726
7727    if let Some(ref user_agent) = configuration.user_agent {
7728        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7729    }
7730    if let Some(ref token) = configuration.bearer_access_token {
7731        req_builder = req_builder.bearer_auth(token.to_owned());
7732    };
7733
7734    let req = req_builder.build()?;
7735    let resp = configuration.client.execute(req).await?;
7736
7737    let status = resp.status();
7738    let content_type = resp
7739        .headers()
7740        .get("content-type")
7741        .and_then(|v| v.to_str().ok())
7742        .unwrap_or("application/octet-stream");
7743    let content_type = super::ContentType::from(content_type);
7744
7745    if !status.is_client_error() && !status.is_server_error() {
7746        let content = resp.text().await?;
7747        match content_type {
7748            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7749            ContentType::Text => {
7750                return Err(Error::from(serde_json::Error::custom(
7751                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7752                )))
7753            }
7754            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7755                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7756            )))),
7757        }
7758    } else {
7759        let content = resp.text().await?;
7760        let entity: Option<SourcesScimGroupsRetrieveError> = serde_json::from_str(&content).ok();
7761        Err(Error::ResponseError(ResponseContent {
7762            status,
7763            content,
7764            entity,
7765        }))
7766    }
7767}
7768
7769/// SCIMSourceGroup Viewset
7770pub async fn sources_scim_groups_update(
7771    configuration: &configuration::Configuration,
7772    id: &str,
7773    scim_source_group_request: models::ScimSourceGroupRequest,
7774) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsUpdateError>> {
7775    // add a prefix to parameters to efficiently prevent name collisions
7776    let p_path_id = id;
7777    let p_body_scim_source_group_request = scim_source_group_request;
7778
7779    let uri_str = format!(
7780        "{}/sources/scim_groups/{id}/",
7781        configuration.base_path,
7782        id = crate::apis::urlencode(p_path_id)
7783    );
7784    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7785
7786    if let Some(ref user_agent) = configuration.user_agent {
7787        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7788    }
7789    if let Some(ref token) = configuration.bearer_access_token {
7790        req_builder = req_builder.bearer_auth(token.to_owned());
7791    };
7792    req_builder = req_builder.json(&p_body_scim_source_group_request);
7793
7794    let req = req_builder.build()?;
7795    let resp = configuration.client.execute(req).await?;
7796
7797    let status = resp.status();
7798    let content_type = resp
7799        .headers()
7800        .get("content-type")
7801        .and_then(|v| v.to_str().ok())
7802        .unwrap_or("application/octet-stream");
7803    let content_type = super::ContentType::from(content_type);
7804
7805    if !status.is_client_error() && !status.is_server_error() {
7806        let content = resp.text().await?;
7807        match content_type {
7808            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7809            ContentType::Text => {
7810                return Err(Error::from(serde_json::Error::custom(
7811                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7812                )))
7813            }
7814            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7815                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7816            )))),
7817        }
7818    } else {
7819        let content = resp.text().await?;
7820        let entity: Option<SourcesScimGroupsUpdateError> = serde_json::from_str(&content).ok();
7821        Err(Error::ResponseError(ResponseContent {
7822            status,
7823            content,
7824            entity,
7825        }))
7826    }
7827}
7828
7829/// Get a list of all objects that use this object
7830pub async fn sources_scim_groups_used_by_list(
7831    configuration: &configuration::Configuration,
7832    id: &str,
7833) -> Result<Vec<models::UsedBy>, Error<SourcesScimGroupsUsedByListError>> {
7834    // add a prefix to parameters to efficiently prevent name collisions
7835    let p_path_id = id;
7836
7837    let uri_str = format!(
7838        "{}/sources/scim_groups/{id}/used_by/",
7839        configuration.base_path,
7840        id = crate::apis::urlencode(p_path_id)
7841    );
7842    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7843
7844    if let Some(ref user_agent) = configuration.user_agent {
7845        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7846    }
7847    if let Some(ref token) = configuration.bearer_access_token {
7848        req_builder = req_builder.bearer_auth(token.to_owned());
7849    };
7850
7851    let req = req_builder.build()?;
7852    let resp = configuration.client.execute(req).await?;
7853
7854    let status = resp.status();
7855    let content_type = resp
7856        .headers()
7857        .get("content-type")
7858        .and_then(|v| v.to_str().ok())
7859        .unwrap_or("application/octet-stream");
7860    let content_type = super::ContentType::from(content_type);
7861
7862    if !status.is_client_error() && !status.is_server_error() {
7863        let content = resp.text().await?;
7864        match content_type {
7865            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7866            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;`"))),
7867            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;`")))),
7868        }
7869    } else {
7870        let content = resp.text().await?;
7871        let entity: Option<SourcesScimGroupsUsedByListError> = serde_json::from_str(&content).ok();
7872        Err(Error::ResponseError(ResponseContent {
7873            status,
7874            content,
7875            entity,
7876        }))
7877    }
7878}
7879
7880/// SCIMSource Viewset
7881pub async fn sources_scim_list(
7882    configuration: &configuration::Configuration,
7883    name: Option<&str>,
7884    ordering: Option<&str>,
7885    page: Option<i32>,
7886    page_size: Option<i32>,
7887    pbm_uuid: Option<&str>,
7888    search: Option<&str>,
7889    slug: Option<&str>,
7890) -> Result<models::PaginatedScimSourceList, Error<SourcesScimListError>> {
7891    // add a prefix to parameters to efficiently prevent name collisions
7892    let p_query_name = name;
7893    let p_query_ordering = ordering;
7894    let p_query_page = page;
7895    let p_query_page_size = page_size;
7896    let p_query_pbm_uuid = pbm_uuid;
7897    let p_query_search = search;
7898    let p_query_slug = slug;
7899
7900    let uri_str = format!("{}/sources/scim/", configuration.base_path);
7901    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7902
7903    if let Some(ref param_value) = p_query_name {
7904        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
7905    }
7906    if let Some(ref param_value) = p_query_ordering {
7907        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7908    }
7909    if let Some(ref param_value) = p_query_page {
7910        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7911    }
7912    if let Some(ref param_value) = p_query_page_size {
7913        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7914    }
7915    if let Some(ref param_value) = p_query_pbm_uuid {
7916        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
7917    }
7918    if let Some(ref param_value) = p_query_search {
7919        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7920    }
7921    if let Some(ref param_value) = p_query_slug {
7922        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
7923    }
7924    if let Some(ref user_agent) = configuration.user_agent {
7925        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7926    }
7927    if let Some(ref token) = configuration.bearer_access_token {
7928        req_builder = req_builder.bearer_auth(token.to_owned());
7929    };
7930
7931    let req = req_builder.build()?;
7932    let resp = configuration.client.execute(req).await?;
7933
7934    let status = resp.status();
7935    let content_type = resp
7936        .headers()
7937        .get("content-type")
7938        .and_then(|v| v.to_str().ok())
7939        .unwrap_or("application/octet-stream");
7940    let content_type = super::ContentType::from(content_type);
7941
7942    if !status.is_client_error() && !status.is_server_error() {
7943        let content = resp.text().await?;
7944        match content_type {
7945            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7946            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceList`"))),
7947            ContentType::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`")))),
7948        }
7949    } else {
7950        let content = resp.text().await?;
7951        let entity: Option<SourcesScimListError> = serde_json::from_str(&content).ok();
7952        Err(Error::ResponseError(ResponseContent {
7953            status,
7954            content,
7955            entity,
7956        }))
7957    }
7958}
7959
7960/// SCIMSource Viewset
7961pub async fn sources_scim_partial_update(
7962    configuration: &configuration::Configuration,
7963    slug: &str,
7964    patched_scim_source_request: Option<models::PatchedScimSourceRequest>,
7965) -> Result<models::ScimSource, Error<SourcesScimPartialUpdateError>> {
7966    // add a prefix to parameters to efficiently prevent name collisions
7967    let p_path_slug = slug;
7968    let p_body_patched_scim_source_request = patched_scim_source_request;
7969
7970    let uri_str = format!(
7971        "{}/sources/scim/{slug}/",
7972        configuration.base_path,
7973        slug = crate::apis::urlencode(p_path_slug)
7974    );
7975    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7976
7977    if let Some(ref user_agent) = configuration.user_agent {
7978        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7979    }
7980    if let Some(ref token) = configuration.bearer_access_token {
7981        req_builder = req_builder.bearer_auth(token.to_owned());
7982    };
7983    req_builder = req_builder.json(&p_body_patched_scim_source_request);
7984
7985    let req = req_builder.build()?;
7986    let resp = configuration.client.execute(req).await?;
7987
7988    let status = resp.status();
7989    let content_type = resp
7990        .headers()
7991        .get("content-type")
7992        .and_then(|v| v.to_str().ok())
7993        .unwrap_or("application/octet-stream");
7994    let content_type = super::ContentType::from(content_type);
7995
7996    if !status.is_client_error() && !status.is_server_error() {
7997        let content = resp.text().await?;
7998        match content_type {
7999            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8000            ContentType::Text => {
8001                return Err(Error::from(serde_json::Error::custom(
8002                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
8003                )))
8004            }
8005            ContentType::Unsupported(unknown_type) => {
8006                return Err(Error::from(serde_json::Error::custom(format!(
8007                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
8008                ))))
8009            }
8010        }
8011    } else {
8012        let content = resp.text().await?;
8013        let entity: Option<SourcesScimPartialUpdateError> = serde_json::from_str(&content).ok();
8014        Err(Error::ResponseError(ResponseContent {
8015            status,
8016            content,
8017            entity,
8018        }))
8019    }
8020}
8021
8022/// SCIMSource Viewset
8023pub async fn sources_scim_retrieve(
8024    configuration: &configuration::Configuration,
8025    slug: &str,
8026) -> Result<models::ScimSource, Error<SourcesScimRetrieveError>> {
8027    // add a prefix to parameters to efficiently prevent name collisions
8028    let p_path_slug = slug;
8029
8030    let uri_str = format!(
8031        "{}/sources/scim/{slug}/",
8032        configuration.base_path,
8033        slug = crate::apis::urlencode(p_path_slug)
8034    );
8035    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8036
8037    if let Some(ref user_agent) = configuration.user_agent {
8038        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8039    }
8040    if let Some(ref token) = configuration.bearer_access_token {
8041        req_builder = req_builder.bearer_auth(token.to_owned());
8042    };
8043
8044    let req = req_builder.build()?;
8045    let resp = configuration.client.execute(req).await?;
8046
8047    let status = resp.status();
8048    let content_type = resp
8049        .headers()
8050        .get("content-type")
8051        .and_then(|v| v.to_str().ok())
8052        .unwrap_or("application/octet-stream");
8053    let content_type = super::ContentType::from(content_type);
8054
8055    if !status.is_client_error() && !status.is_server_error() {
8056        let content = resp.text().await?;
8057        match content_type {
8058            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8059            ContentType::Text => {
8060                return Err(Error::from(serde_json::Error::custom(
8061                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
8062                )))
8063            }
8064            ContentType::Unsupported(unknown_type) => {
8065                return Err(Error::from(serde_json::Error::custom(format!(
8066                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
8067                ))))
8068            }
8069        }
8070    } else {
8071        let content = resp.text().await?;
8072        let entity: Option<SourcesScimRetrieveError> = serde_json::from_str(&content).ok();
8073        Err(Error::ResponseError(ResponseContent {
8074            status,
8075            content,
8076            entity,
8077        }))
8078    }
8079}
8080
8081/// SCIMSource Viewset
8082pub async fn sources_scim_update(
8083    configuration: &configuration::Configuration,
8084    slug: &str,
8085    scim_source_request: models::ScimSourceRequest,
8086) -> Result<models::ScimSource, Error<SourcesScimUpdateError>> {
8087    // add a prefix to parameters to efficiently prevent name collisions
8088    let p_path_slug = slug;
8089    let p_body_scim_source_request = scim_source_request;
8090
8091    let uri_str = format!(
8092        "{}/sources/scim/{slug}/",
8093        configuration.base_path,
8094        slug = crate::apis::urlencode(p_path_slug)
8095    );
8096    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8097
8098    if let Some(ref user_agent) = configuration.user_agent {
8099        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8100    }
8101    if let Some(ref token) = configuration.bearer_access_token {
8102        req_builder = req_builder.bearer_auth(token.to_owned());
8103    };
8104    req_builder = req_builder.json(&p_body_scim_source_request);
8105
8106    let req = req_builder.build()?;
8107    let resp = configuration.client.execute(req).await?;
8108
8109    let status = resp.status();
8110    let content_type = resp
8111        .headers()
8112        .get("content-type")
8113        .and_then(|v| v.to_str().ok())
8114        .unwrap_or("application/octet-stream");
8115    let content_type = super::ContentType::from(content_type);
8116
8117    if !status.is_client_error() && !status.is_server_error() {
8118        let content = resp.text().await?;
8119        match content_type {
8120            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8121            ContentType::Text => {
8122                return Err(Error::from(serde_json::Error::custom(
8123                    "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
8124                )))
8125            }
8126            ContentType::Unsupported(unknown_type) => {
8127                return Err(Error::from(serde_json::Error::custom(format!(
8128                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
8129                ))))
8130            }
8131        }
8132    } else {
8133        let content = resp.text().await?;
8134        let entity: Option<SourcesScimUpdateError> = serde_json::from_str(&content).ok();
8135        Err(Error::ResponseError(ResponseContent {
8136            status,
8137            content,
8138            entity,
8139        }))
8140    }
8141}
8142
8143/// Get a list of all objects that use this object
8144pub async fn sources_scim_used_by_list(
8145    configuration: &configuration::Configuration,
8146    slug: &str,
8147) -> Result<Vec<models::UsedBy>, Error<SourcesScimUsedByListError>> {
8148    // add a prefix to parameters to efficiently prevent name collisions
8149    let p_path_slug = slug;
8150
8151    let uri_str = format!(
8152        "{}/sources/scim/{slug}/used_by/",
8153        configuration.base_path,
8154        slug = crate::apis::urlencode(p_path_slug)
8155    );
8156    let mut req_builder = configuration.client.request(reqwest::Method::GET, &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
8165    let req = req_builder.build()?;
8166    let resp = configuration.client.execute(req).await?;
8167
8168    let status = resp.status();
8169    let content_type = resp
8170        .headers()
8171        .get("content-type")
8172        .and_then(|v| v.to_str().ok())
8173        .unwrap_or("application/octet-stream");
8174    let content_type = super::ContentType::from(content_type);
8175
8176    if !status.is_client_error() && !status.is_server_error() {
8177        let content = resp.text().await?;
8178        match content_type {
8179            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8180            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;`"))),
8181            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;`")))),
8182        }
8183    } else {
8184        let content = resp.text().await?;
8185        let entity: Option<SourcesScimUsedByListError> = serde_json::from_str(&content).ok();
8186        Err(Error::ResponseError(ResponseContent {
8187            status,
8188            content,
8189            entity,
8190        }))
8191    }
8192}
8193
8194/// SCIMSourceUser Viewset
8195pub async fn sources_scim_users_create(
8196    configuration: &configuration::Configuration,
8197    scim_source_user_request: models::ScimSourceUserRequest,
8198) -> Result<models::ScimSourceUser, Error<SourcesScimUsersCreateError>> {
8199    // add a prefix to parameters to efficiently prevent name collisions
8200    let p_body_scim_source_user_request = scim_source_user_request;
8201
8202    let uri_str = format!("{}/sources/scim_users/", configuration.base_path);
8203    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8204
8205    if let Some(ref user_agent) = configuration.user_agent {
8206        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8207    }
8208    if let Some(ref token) = configuration.bearer_access_token {
8209        req_builder = req_builder.bearer_auth(token.to_owned());
8210    };
8211    req_builder = req_builder.json(&p_body_scim_source_user_request);
8212
8213    let req = req_builder.build()?;
8214    let resp = configuration.client.execute(req).await?;
8215
8216    let status = resp.status();
8217    let content_type = resp
8218        .headers()
8219        .get("content-type")
8220        .and_then(|v| v.to_str().ok())
8221        .unwrap_or("application/octet-stream");
8222    let content_type = super::ContentType::from(content_type);
8223
8224    if !status.is_client_error() && !status.is_server_error() {
8225        let content = resp.text().await?;
8226        match content_type {
8227            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8228            ContentType::Text => {
8229                return Err(Error::from(serde_json::Error::custom(
8230                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8231                )))
8232            }
8233            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8234                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8235            )))),
8236        }
8237    } else {
8238        let content = resp.text().await?;
8239        let entity: Option<SourcesScimUsersCreateError> = serde_json::from_str(&content).ok();
8240        Err(Error::ResponseError(ResponseContent {
8241            status,
8242            content,
8243            entity,
8244        }))
8245    }
8246}
8247
8248/// SCIMSourceUser Viewset
8249pub async fn sources_scim_users_destroy(
8250    configuration: &configuration::Configuration,
8251    id: &str,
8252) -> Result<(), Error<SourcesScimUsersDestroyError>> {
8253    // add a prefix to parameters to efficiently prevent name collisions
8254    let p_path_id = id;
8255
8256    let uri_str = format!(
8257        "{}/sources/scim_users/{id}/",
8258        configuration.base_path,
8259        id = crate::apis::urlencode(p_path_id)
8260    );
8261    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &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
8270    let req = req_builder.build()?;
8271    let resp = configuration.client.execute(req).await?;
8272
8273    let status = resp.status();
8274
8275    if !status.is_client_error() && !status.is_server_error() {
8276        Ok(())
8277    } else {
8278        let content = resp.text().await?;
8279        let entity: Option<SourcesScimUsersDestroyError> = serde_json::from_str(&content).ok();
8280        Err(Error::ResponseError(ResponseContent {
8281            status,
8282            content,
8283            entity,
8284        }))
8285    }
8286}
8287
8288/// SCIMSourceUser Viewset
8289pub async fn sources_scim_users_list(
8290    configuration: &configuration::Configuration,
8291    ordering: Option<&str>,
8292    page: Option<i32>,
8293    page_size: Option<i32>,
8294    search: Option<&str>,
8295    source__slug: Option<&str>,
8296    user__id: Option<i32>,
8297    user__username: Option<&str>,
8298) -> Result<models::PaginatedScimSourceUserList, Error<SourcesScimUsersListError>> {
8299    // add a prefix to parameters to efficiently prevent name collisions
8300    let p_query_ordering = ordering;
8301    let p_query_page = page;
8302    let p_query_page_size = page_size;
8303    let p_query_search = search;
8304    let p_query_source__slug = source__slug;
8305    let p_query_user__id = user__id;
8306    let p_query_user__username = user__username;
8307
8308    let uri_str = format!("{}/sources/scim_users/", configuration.base_path);
8309    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8310
8311    if let Some(ref param_value) = p_query_ordering {
8312        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
8313    }
8314    if let Some(ref param_value) = p_query_page {
8315        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
8316    }
8317    if let Some(ref param_value) = p_query_page_size {
8318        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
8319    }
8320    if let Some(ref param_value) = p_query_search {
8321        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
8322    }
8323    if let Some(ref param_value) = p_query_source__slug {
8324        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
8325    }
8326    if let Some(ref param_value) = p_query_user__id {
8327        req_builder = req_builder.query(&[("user__id", &param_value.to_string())]);
8328    }
8329    if let Some(ref param_value) = p_query_user__username {
8330        req_builder = req_builder.query(&[("user__username", &param_value.to_string())]);
8331    }
8332    if let Some(ref user_agent) = configuration.user_agent {
8333        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8334    }
8335    if let Some(ref token) = configuration.bearer_access_token {
8336        req_builder = req_builder.bearer_auth(token.to_owned());
8337    };
8338
8339    let req = req_builder.build()?;
8340    let resp = configuration.client.execute(req).await?;
8341
8342    let status = resp.status();
8343    let content_type = resp
8344        .headers()
8345        .get("content-type")
8346        .and_then(|v| v.to_str().ok())
8347        .unwrap_or("application/octet-stream");
8348    let content_type = super::ContentType::from(content_type);
8349
8350    if !status.is_client_error() && !status.is_server_error() {
8351        let content = resp.text().await?;
8352        match content_type {
8353            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8354            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceUserList`"))),
8355            ContentType::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`")))),
8356        }
8357    } else {
8358        let content = resp.text().await?;
8359        let entity: Option<SourcesScimUsersListError> = serde_json::from_str(&content).ok();
8360        Err(Error::ResponseError(ResponseContent {
8361            status,
8362            content,
8363            entity,
8364        }))
8365    }
8366}
8367
8368/// SCIMSourceUser Viewset
8369pub async fn sources_scim_users_partial_update(
8370    configuration: &configuration::Configuration,
8371    id: &str,
8372    patched_scim_source_user_request: Option<models::PatchedScimSourceUserRequest>,
8373) -> Result<models::ScimSourceUser, Error<SourcesScimUsersPartialUpdateError>> {
8374    // add a prefix to parameters to efficiently prevent name collisions
8375    let p_path_id = id;
8376    let p_body_patched_scim_source_user_request = patched_scim_source_user_request;
8377
8378    let uri_str = format!(
8379        "{}/sources/scim_users/{id}/",
8380        configuration.base_path,
8381        id = crate::apis::urlencode(p_path_id)
8382    );
8383    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8384
8385    if let Some(ref user_agent) = configuration.user_agent {
8386        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8387    }
8388    if let Some(ref token) = configuration.bearer_access_token {
8389        req_builder = req_builder.bearer_auth(token.to_owned());
8390    };
8391    req_builder = req_builder.json(&p_body_patched_scim_source_user_request);
8392
8393    let req = req_builder.build()?;
8394    let resp = configuration.client.execute(req).await?;
8395
8396    let status = resp.status();
8397    let content_type = resp
8398        .headers()
8399        .get("content-type")
8400        .and_then(|v| v.to_str().ok())
8401        .unwrap_or("application/octet-stream");
8402    let content_type = super::ContentType::from(content_type);
8403
8404    if !status.is_client_error() && !status.is_server_error() {
8405        let content = resp.text().await?;
8406        match content_type {
8407            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8408            ContentType::Text => {
8409                return Err(Error::from(serde_json::Error::custom(
8410                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8411                )))
8412            }
8413            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8414                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8415            )))),
8416        }
8417    } else {
8418        let content = resp.text().await?;
8419        let entity: Option<SourcesScimUsersPartialUpdateError> = serde_json::from_str(&content).ok();
8420        Err(Error::ResponseError(ResponseContent {
8421            status,
8422            content,
8423            entity,
8424        }))
8425    }
8426}
8427
8428/// SCIMSourceUser Viewset
8429pub async fn sources_scim_users_retrieve(
8430    configuration: &configuration::Configuration,
8431    id: &str,
8432) -> Result<models::ScimSourceUser, Error<SourcesScimUsersRetrieveError>> {
8433    // add a prefix to parameters to efficiently prevent name collisions
8434    let p_path_id = id;
8435
8436    let uri_str = format!(
8437        "{}/sources/scim_users/{id}/",
8438        configuration.base_path,
8439        id = crate::apis::urlencode(p_path_id)
8440    );
8441    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8442
8443    if let Some(ref user_agent) = configuration.user_agent {
8444        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8445    }
8446    if let Some(ref token) = configuration.bearer_access_token {
8447        req_builder = req_builder.bearer_auth(token.to_owned());
8448    };
8449
8450    let req = req_builder.build()?;
8451    let resp = configuration.client.execute(req).await?;
8452
8453    let status = resp.status();
8454    let content_type = resp
8455        .headers()
8456        .get("content-type")
8457        .and_then(|v| v.to_str().ok())
8458        .unwrap_or("application/octet-stream");
8459    let content_type = super::ContentType::from(content_type);
8460
8461    if !status.is_client_error() && !status.is_server_error() {
8462        let content = resp.text().await?;
8463        match content_type {
8464            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8465            ContentType::Text => {
8466                return Err(Error::from(serde_json::Error::custom(
8467                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8468                )))
8469            }
8470            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8471                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8472            )))),
8473        }
8474    } else {
8475        let content = resp.text().await?;
8476        let entity: Option<SourcesScimUsersRetrieveError> = serde_json::from_str(&content).ok();
8477        Err(Error::ResponseError(ResponseContent {
8478            status,
8479            content,
8480            entity,
8481        }))
8482    }
8483}
8484
8485/// SCIMSourceUser Viewset
8486pub async fn sources_scim_users_update(
8487    configuration: &configuration::Configuration,
8488    id: &str,
8489    scim_source_user_request: models::ScimSourceUserRequest,
8490) -> Result<models::ScimSourceUser, Error<SourcesScimUsersUpdateError>> {
8491    // add a prefix to parameters to efficiently prevent name collisions
8492    let p_path_id = id;
8493    let p_body_scim_source_user_request = scim_source_user_request;
8494
8495    let uri_str = format!(
8496        "{}/sources/scim_users/{id}/",
8497        configuration.base_path,
8498        id = crate::apis::urlencode(p_path_id)
8499    );
8500    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8501
8502    if let Some(ref user_agent) = configuration.user_agent {
8503        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8504    }
8505    if let Some(ref token) = configuration.bearer_access_token {
8506        req_builder = req_builder.bearer_auth(token.to_owned());
8507    };
8508    req_builder = req_builder.json(&p_body_scim_source_user_request);
8509
8510    let req = req_builder.build()?;
8511    let resp = configuration.client.execute(req).await?;
8512
8513    let status = resp.status();
8514    let content_type = resp
8515        .headers()
8516        .get("content-type")
8517        .and_then(|v| v.to_str().ok())
8518        .unwrap_or("application/octet-stream");
8519    let content_type = super::ContentType::from(content_type);
8520
8521    if !status.is_client_error() && !status.is_server_error() {
8522        let content = resp.text().await?;
8523        match content_type {
8524            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8525            ContentType::Text => {
8526                return Err(Error::from(serde_json::Error::custom(
8527                    "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8528                )))
8529            }
8530            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8531                "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8532            )))),
8533        }
8534    } else {
8535        let content = resp.text().await?;
8536        let entity: Option<SourcesScimUsersUpdateError> = serde_json::from_str(&content).ok();
8537        Err(Error::ResponseError(ResponseContent {
8538            status,
8539            content,
8540            entity,
8541        }))
8542    }
8543}
8544
8545/// Get a list of all objects that use this object
8546pub async fn sources_scim_users_used_by_list(
8547    configuration: &configuration::Configuration,
8548    id: &str,
8549) -> Result<Vec<models::UsedBy>, Error<SourcesScimUsersUsedByListError>> {
8550    // add a prefix to parameters to efficiently prevent name collisions
8551    let p_path_id = id;
8552
8553    let uri_str = format!(
8554        "{}/sources/scim_users/{id}/used_by/",
8555        configuration.base_path,
8556        id = crate::apis::urlencode(p_path_id)
8557    );
8558    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8559
8560    if let Some(ref user_agent) = configuration.user_agent {
8561        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8562    }
8563    if let Some(ref token) = configuration.bearer_access_token {
8564        req_builder = req_builder.bearer_auth(token.to_owned());
8565    };
8566
8567    let req = req_builder.build()?;
8568    let resp = configuration.client.execute(req).await?;
8569
8570    let status = resp.status();
8571    let content_type = resp
8572        .headers()
8573        .get("content-type")
8574        .and_then(|v| v.to_str().ok())
8575        .unwrap_or("application/octet-stream");
8576    let content_type = super::ContentType::from(content_type);
8577
8578    if !status.is_client_error() && !status.is_server_error() {
8579        let content = resp.text().await?;
8580        match content_type {
8581            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8582            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;`"))),
8583            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;`")))),
8584        }
8585    } else {
8586        let content = resp.text().await?;
8587        let entity: Option<SourcesScimUsersUsedByListError> = serde_json::from_str(&content).ok();
8588        Err(Error::ResponseError(ResponseContent {
8589            status,
8590            content,
8591            entity,
8592        }))
8593    }
8594}
8595
8596/// Mixin to add a used_by endpoint to return a list of all objects using this object
8597pub async fn sources_telegram_create(
8598    configuration: &configuration::Configuration,
8599    telegram_source_request: models::TelegramSourceRequest,
8600) -> Result<models::TelegramSource, Error<SourcesTelegramCreateError>> {
8601    // add a prefix to parameters to efficiently prevent name collisions
8602    let p_body_telegram_source_request = telegram_source_request;
8603
8604    let uri_str = format!("{}/sources/telegram/", configuration.base_path);
8605    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8606
8607    if let Some(ref user_agent) = configuration.user_agent {
8608        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8609    }
8610    if let Some(ref token) = configuration.bearer_access_token {
8611        req_builder = req_builder.bearer_auth(token.to_owned());
8612    };
8613    req_builder = req_builder.json(&p_body_telegram_source_request);
8614
8615    let req = req_builder.build()?;
8616    let resp = configuration.client.execute(req).await?;
8617
8618    let status = resp.status();
8619    let content_type = resp
8620        .headers()
8621        .get("content-type")
8622        .and_then(|v| v.to_str().ok())
8623        .unwrap_or("application/octet-stream");
8624    let content_type = super::ContentType::from(content_type);
8625
8626    if !status.is_client_error() && !status.is_server_error() {
8627        let content = resp.text().await?;
8628        match content_type {
8629            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8630            ContentType::Text => {
8631                return Err(Error::from(serde_json::Error::custom(
8632                    "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8633                )))
8634            }
8635            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8636                "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8637            )))),
8638        }
8639    } else {
8640        let content = resp.text().await?;
8641        let entity: Option<SourcesTelegramCreateError> = serde_json::from_str(&content).ok();
8642        Err(Error::ResponseError(ResponseContent {
8643            status,
8644            content,
8645            entity,
8646        }))
8647    }
8648}
8649
8650/// Mixin to add a used_by endpoint to return a list of all objects using this object
8651pub async fn sources_telegram_destroy(
8652    configuration: &configuration::Configuration,
8653    slug: &str,
8654) -> Result<(), Error<SourcesTelegramDestroyError>> {
8655    // add a prefix to parameters to efficiently prevent name collisions
8656    let p_path_slug = slug;
8657
8658    let uri_str = format!(
8659        "{}/sources/telegram/{slug}/",
8660        configuration.base_path,
8661        slug = crate::apis::urlencode(p_path_slug)
8662    );
8663    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8664
8665    if let Some(ref user_agent) = configuration.user_agent {
8666        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8667    }
8668    if let Some(ref token) = configuration.bearer_access_token {
8669        req_builder = req_builder.bearer_auth(token.to_owned());
8670    };
8671
8672    let req = req_builder.build()?;
8673    let resp = configuration.client.execute(req).await?;
8674
8675    let status = resp.status();
8676
8677    if !status.is_client_error() && !status.is_server_error() {
8678        Ok(())
8679    } else {
8680        let content = resp.text().await?;
8681        let entity: Option<SourcesTelegramDestroyError> = serde_json::from_str(&content).ok();
8682        Err(Error::ResponseError(ResponseContent {
8683            status,
8684            content,
8685            entity,
8686        }))
8687    }
8688}
8689
8690/// Mixin to add a used_by endpoint to return a list of all objects using this object
8691pub async fn sources_telegram_list(
8692    configuration: &configuration::Configuration,
8693    authentication_flow: Option<&str>,
8694    bot_username: Option<&str>,
8695    enabled: Option<bool>,
8696    enrollment_flow: Option<&str>,
8697    group_matching_mode: Option<&str>,
8698    name: Option<&str>,
8699    ordering: Option<&str>,
8700    page: Option<i32>,
8701    page_size: Option<i32>,
8702    pbm_uuid: Option<&str>,
8703    policy_engine_mode: Option<&str>,
8704    request_message_access: Option<bool>,
8705    search: Option<&str>,
8706    slug: Option<&str>,
8707    user_matching_mode: Option<&str>,
8708) -> Result<models::PaginatedTelegramSourceList, Error<SourcesTelegramListError>> {
8709    // add a prefix to parameters to efficiently prevent name collisions
8710    let p_query_authentication_flow = authentication_flow;
8711    let p_query_bot_username = bot_username;
8712    let p_query_enabled = enabled;
8713    let p_query_enrollment_flow = enrollment_flow;
8714    let p_query_group_matching_mode = group_matching_mode;
8715    let p_query_name = name;
8716    let p_query_ordering = ordering;
8717    let p_query_page = page;
8718    let p_query_page_size = page_size;
8719    let p_query_pbm_uuid = pbm_uuid;
8720    let p_query_policy_engine_mode = policy_engine_mode;
8721    let p_query_request_message_access = request_message_access;
8722    let p_query_search = search;
8723    let p_query_slug = slug;
8724    let p_query_user_matching_mode = user_matching_mode;
8725
8726    let uri_str = format!("{}/sources/telegram/", configuration.base_path);
8727    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8728
8729    if let Some(ref param_value) = p_query_authentication_flow {
8730        req_builder = req_builder.query(&[("authentication_flow", &param_value.to_string())]);
8731    }
8732    if let Some(ref param_value) = p_query_bot_username {
8733        req_builder = req_builder.query(&[("bot_username", &param_value.to_string())]);
8734    }
8735    if let Some(ref param_value) = p_query_enabled {
8736        req_builder = req_builder.query(&[("enabled", &param_value.to_string())]);
8737    }
8738    if let Some(ref param_value) = p_query_enrollment_flow {
8739        req_builder = req_builder.query(&[("enrollment_flow", &param_value.to_string())]);
8740    }
8741    if let Some(ref param_value) = p_query_group_matching_mode {
8742        req_builder = req_builder.query(&[("group_matching_mode", &param_value.to_string())]);
8743    }
8744    if let Some(ref param_value) = p_query_name {
8745        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
8746    }
8747    if let Some(ref param_value) = p_query_ordering {
8748        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
8749    }
8750    if let Some(ref param_value) = p_query_page {
8751        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
8752    }
8753    if let Some(ref param_value) = p_query_page_size {
8754        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
8755    }
8756    if let Some(ref param_value) = p_query_pbm_uuid {
8757        req_builder = req_builder.query(&[("pbm_uuid", &param_value.to_string())]);
8758    }
8759    if let Some(ref param_value) = p_query_policy_engine_mode {
8760        req_builder = req_builder.query(&[("policy_engine_mode", &param_value.to_string())]);
8761    }
8762    if let Some(ref param_value) = p_query_request_message_access {
8763        req_builder = req_builder.query(&[("request_message_access", &param_value.to_string())]);
8764    }
8765    if let Some(ref param_value) = p_query_search {
8766        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
8767    }
8768    if let Some(ref param_value) = p_query_slug {
8769        req_builder = req_builder.query(&[("slug", &param_value.to_string())]);
8770    }
8771    if let Some(ref param_value) = p_query_user_matching_mode {
8772        req_builder = req_builder.query(&[("user_matching_mode", &param_value.to_string())]);
8773    }
8774    if let Some(ref user_agent) = configuration.user_agent {
8775        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8776    }
8777    if let Some(ref token) = configuration.bearer_access_token {
8778        req_builder = req_builder.bearer_auth(token.to_owned());
8779    };
8780
8781    let req = req_builder.build()?;
8782    let resp = configuration.client.execute(req).await?;
8783
8784    let status = resp.status();
8785    let content_type = resp
8786        .headers()
8787        .get("content-type")
8788        .and_then(|v| v.to_str().ok())
8789        .unwrap_or("application/octet-stream");
8790    let content_type = super::ContentType::from(content_type);
8791
8792    if !status.is_client_error() && !status.is_server_error() {
8793        let content = resp.text().await?;
8794        match content_type {
8795            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8796            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedTelegramSourceList`"))),
8797            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedTelegramSourceList`")))),
8798        }
8799    } else {
8800        let content = resp.text().await?;
8801        let entity: Option<SourcesTelegramListError> = serde_json::from_str(&content).ok();
8802        Err(Error::ResponseError(ResponseContent {
8803            status,
8804            content,
8805            entity,
8806        }))
8807    }
8808}
8809
8810/// Mixin to add a used_by endpoint to return a list of all objects using this object
8811pub async fn sources_telegram_partial_update(
8812    configuration: &configuration::Configuration,
8813    slug: &str,
8814    patched_telegram_source_request: Option<models::PatchedTelegramSourceRequest>,
8815) -> Result<models::TelegramSource, Error<SourcesTelegramPartialUpdateError>> {
8816    // add a prefix to parameters to efficiently prevent name collisions
8817    let p_path_slug = slug;
8818    let p_body_patched_telegram_source_request = patched_telegram_source_request;
8819
8820    let uri_str = format!(
8821        "{}/sources/telegram/{slug}/",
8822        configuration.base_path,
8823        slug = crate::apis::urlencode(p_path_slug)
8824    );
8825    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8826
8827    if let Some(ref user_agent) = configuration.user_agent {
8828        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8829    }
8830    if let Some(ref token) = configuration.bearer_access_token {
8831        req_builder = req_builder.bearer_auth(token.to_owned());
8832    };
8833    req_builder = req_builder.json(&p_body_patched_telegram_source_request);
8834
8835    let req = req_builder.build()?;
8836    let resp = configuration.client.execute(req).await?;
8837
8838    let status = resp.status();
8839    let content_type = resp
8840        .headers()
8841        .get("content-type")
8842        .and_then(|v| v.to_str().ok())
8843        .unwrap_or("application/octet-stream");
8844    let content_type = super::ContentType::from(content_type);
8845
8846    if !status.is_client_error() && !status.is_server_error() {
8847        let content = resp.text().await?;
8848        match content_type {
8849            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8850            ContentType::Text => {
8851                return Err(Error::from(serde_json::Error::custom(
8852                    "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8853                )))
8854            }
8855            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8856                "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8857            )))),
8858        }
8859    } else {
8860        let content = resp.text().await?;
8861        let entity: Option<SourcesTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
8862        Err(Error::ResponseError(ResponseContent {
8863            status,
8864            content,
8865            entity,
8866        }))
8867    }
8868}
8869
8870/// Mixin to add a used_by endpoint to return a list of all objects using this object
8871pub async fn sources_telegram_retrieve(
8872    configuration: &configuration::Configuration,
8873    slug: &str,
8874) -> Result<models::TelegramSource, Error<SourcesTelegramRetrieveError>> {
8875    // add a prefix to parameters to efficiently prevent name collisions
8876    let p_path_slug = slug;
8877
8878    let uri_str = format!(
8879        "{}/sources/telegram/{slug}/",
8880        configuration.base_path,
8881        slug = crate::apis::urlencode(p_path_slug)
8882    );
8883    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8884
8885    if let Some(ref user_agent) = configuration.user_agent {
8886        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8887    }
8888    if let Some(ref token) = configuration.bearer_access_token {
8889        req_builder = req_builder.bearer_auth(token.to_owned());
8890    };
8891
8892    let req = req_builder.build()?;
8893    let resp = configuration.client.execute(req).await?;
8894
8895    let status = resp.status();
8896    let content_type = resp
8897        .headers()
8898        .get("content-type")
8899        .and_then(|v| v.to_str().ok())
8900        .unwrap_or("application/octet-stream");
8901    let content_type = super::ContentType::from(content_type);
8902
8903    if !status.is_client_error() && !status.is_server_error() {
8904        let content = resp.text().await?;
8905        match content_type {
8906            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8907            ContentType::Text => {
8908                return Err(Error::from(serde_json::Error::custom(
8909                    "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8910                )))
8911            }
8912            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8913                "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8914            )))),
8915        }
8916    } else {
8917        let content = resp.text().await?;
8918        let entity: Option<SourcesTelegramRetrieveError> = serde_json::from_str(&content).ok();
8919        Err(Error::ResponseError(ResponseContent {
8920            status,
8921            content,
8922            entity,
8923        }))
8924    }
8925}
8926
8927/// Mixin to add a used_by endpoint to return a list of all objects using this object
8928pub async fn sources_telegram_update(
8929    configuration: &configuration::Configuration,
8930    slug: &str,
8931    telegram_source_request: models::TelegramSourceRequest,
8932) -> Result<models::TelegramSource, Error<SourcesTelegramUpdateError>> {
8933    // add a prefix to parameters to efficiently prevent name collisions
8934    let p_path_slug = slug;
8935    let p_body_telegram_source_request = telegram_source_request;
8936
8937    let uri_str = format!(
8938        "{}/sources/telegram/{slug}/",
8939        configuration.base_path,
8940        slug = crate::apis::urlencode(p_path_slug)
8941    );
8942    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8943
8944    if let Some(ref user_agent) = configuration.user_agent {
8945        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8946    }
8947    if let Some(ref token) = configuration.bearer_access_token {
8948        req_builder = req_builder.bearer_auth(token.to_owned());
8949    };
8950    req_builder = req_builder.json(&p_body_telegram_source_request);
8951
8952    let req = req_builder.build()?;
8953    let resp = configuration.client.execute(req).await?;
8954
8955    let status = resp.status();
8956    let content_type = resp
8957        .headers()
8958        .get("content-type")
8959        .and_then(|v| v.to_str().ok())
8960        .unwrap_or("application/octet-stream");
8961    let content_type = super::ContentType::from(content_type);
8962
8963    if !status.is_client_error() && !status.is_server_error() {
8964        let content = resp.text().await?;
8965        match content_type {
8966            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8967            ContentType::Text => {
8968                return Err(Error::from(serde_json::Error::custom(
8969                    "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8970                )))
8971            }
8972            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8973                "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8974            )))),
8975        }
8976    } else {
8977        let content = resp.text().await?;
8978        let entity: Option<SourcesTelegramUpdateError> = serde_json::from_str(&content).ok();
8979        Err(Error::ResponseError(ResponseContent {
8980            status,
8981            content,
8982            entity,
8983        }))
8984    }
8985}
8986
8987/// Get a list of all objects that use this object
8988pub async fn sources_telegram_used_by_list(
8989    configuration: &configuration::Configuration,
8990    slug: &str,
8991) -> Result<Vec<models::UsedBy>, Error<SourcesTelegramUsedByListError>> {
8992    // add a prefix to parameters to efficiently prevent name collisions
8993    let p_path_slug = slug;
8994
8995    let uri_str = format!(
8996        "{}/sources/telegram/{slug}/used_by/",
8997        configuration.base_path,
8998        slug = crate::apis::urlencode(p_path_slug)
8999    );
9000    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9001
9002    if let Some(ref user_agent) = configuration.user_agent {
9003        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9004    }
9005    if let Some(ref token) = configuration.bearer_access_token {
9006        req_builder = req_builder.bearer_auth(token.to_owned());
9007    };
9008
9009    let req = req_builder.build()?;
9010    let resp = configuration.client.execute(req).await?;
9011
9012    let status = resp.status();
9013    let content_type = resp
9014        .headers()
9015        .get("content-type")
9016        .and_then(|v| v.to_str().ok())
9017        .unwrap_or("application/octet-stream");
9018    let content_type = super::ContentType::from(content_type);
9019
9020    if !status.is_client_error() && !status.is_server_error() {
9021        let content = resp.text().await?;
9022        match content_type {
9023            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9024            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;`"))),
9025            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;`")))),
9026        }
9027    } else {
9028        let content = resp.text().await?;
9029        let entity: Option<SourcesTelegramUsedByListError> = serde_json::from_str(&content).ok();
9030        Err(Error::ResponseError(ResponseContent {
9031            status,
9032            content,
9033            entity,
9034        }))
9035    }
9036}
9037
9038/// User-source connection Viewset
9039pub async fn sources_user_connections_all_destroy(
9040    configuration: &configuration::Configuration,
9041    id: i32,
9042) -> Result<(), Error<SourcesUserConnectionsAllDestroyError>> {
9043    // add a prefix to parameters to efficiently prevent name collisions
9044    let p_path_id = id;
9045
9046    let uri_str = format!(
9047        "{}/sources/user_connections/all/{id}/",
9048        configuration.base_path,
9049        id = p_path_id
9050    );
9051    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9052
9053    if let Some(ref user_agent) = configuration.user_agent {
9054        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9055    }
9056    if let Some(ref token) = configuration.bearer_access_token {
9057        req_builder = req_builder.bearer_auth(token.to_owned());
9058    };
9059
9060    let req = req_builder.build()?;
9061    let resp = configuration.client.execute(req).await?;
9062
9063    let status = resp.status();
9064
9065    if !status.is_client_error() && !status.is_server_error() {
9066        Ok(())
9067    } else {
9068        let content = resp.text().await?;
9069        let entity: Option<SourcesUserConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
9070        Err(Error::ResponseError(ResponseContent {
9071            status,
9072            content,
9073            entity,
9074        }))
9075    }
9076}
9077
9078/// User-source connection Viewset
9079pub async fn sources_user_connections_all_list(
9080    configuration: &configuration::Configuration,
9081    ordering: Option<&str>,
9082    page: Option<i32>,
9083    page_size: Option<i32>,
9084    search: Option<&str>,
9085    source__slug: Option<&str>,
9086    user: Option<i32>,
9087) -> Result<models::PaginatedUserSourceConnectionList, Error<SourcesUserConnectionsAllListError>> {
9088    // add a prefix to parameters to efficiently prevent name collisions
9089    let p_query_ordering = ordering;
9090    let p_query_page = page;
9091    let p_query_page_size = page_size;
9092    let p_query_search = search;
9093    let p_query_source__slug = source__slug;
9094    let p_query_user = user;
9095
9096    let uri_str = format!("{}/sources/user_connections/all/", configuration.base_path);
9097    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9098
9099    if let Some(ref param_value) = p_query_ordering {
9100        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
9101    }
9102    if let Some(ref param_value) = p_query_page {
9103        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
9104    }
9105    if let Some(ref param_value) = p_query_page_size {
9106        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
9107    }
9108    if let Some(ref param_value) = p_query_search {
9109        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
9110    }
9111    if let Some(ref param_value) = p_query_source__slug {
9112        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
9113    }
9114    if let Some(ref param_value) = p_query_user {
9115        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
9116    }
9117    if let Some(ref user_agent) = configuration.user_agent {
9118        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9119    }
9120    if let Some(ref token) = configuration.bearer_access_token {
9121        req_builder = req_builder.bearer_auth(token.to_owned());
9122    };
9123
9124    let req = req_builder.build()?;
9125    let resp = configuration.client.execute(req).await?;
9126
9127    let status = resp.status();
9128    let content_type = resp
9129        .headers()
9130        .get("content-type")
9131        .and_then(|v| v.to_str().ok())
9132        .unwrap_or("application/octet-stream");
9133    let content_type = super::ContentType::from(content_type);
9134
9135    if !status.is_client_error() && !status.is_server_error() {
9136        let content = resp.text().await?;
9137        match content_type {
9138            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9139            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserSourceConnectionList`"))),
9140            ContentType::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`")))),
9141        }
9142    } else {
9143        let content = resp.text().await?;
9144        let entity: Option<SourcesUserConnectionsAllListError> = serde_json::from_str(&content).ok();
9145        Err(Error::ResponseError(ResponseContent {
9146            status,
9147            content,
9148            entity,
9149        }))
9150    }
9151}
9152
9153/// User-source connection Viewset
9154pub async fn sources_user_connections_all_partial_update(
9155    configuration: &configuration::Configuration,
9156    id: i32,
9157    patched_user_source_connection_request: Option<models::PatchedUserSourceConnectionRequest>,
9158) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllPartialUpdateError>> {
9159    // add a prefix to parameters to efficiently prevent name collisions
9160    let p_path_id = id;
9161    let p_body_patched_user_source_connection_request = patched_user_source_connection_request;
9162
9163    let uri_str = format!(
9164        "{}/sources/user_connections/all/{id}/",
9165        configuration.base_path,
9166        id = p_path_id
9167    );
9168    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9169
9170    if let Some(ref user_agent) = configuration.user_agent {
9171        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9172    }
9173    if let Some(ref token) = configuration.bearer_access_token {
9174        req_builder = req_builder.bearer_auth(token.to_owned());
9175    };
9176    req_builder = req_builder.json(&p_body_patched_user_source_connection_request);
9177
9178    let req = req_builder.build()?;
9179    let resp = configuration.client.execute(req).await?;
9180
9181    let status = resp.status();
9182    let content_type = resp
9183        .headers()
9184        .get("content-type")
9185        .and_then(|v| v.to_str().ok())
9186        .unwrap_or("application/octet-stream");
9187    let content_type = super::ContentType::from(content_type);
9188
9189    if !status.is_client_error() && !status.is_server_error() {
9190        let content = resp.text().await?;
9191        match content_type {
9192            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9193            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
9194            ContentType::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`")))),
9195        }
9196    } else {
9197        let content = resp.text().await?;
9198        let entity: Option<SourcesUserConnectionsAllPartialUpdateError> = serde_json::from_str(&content).ok();
9199        Err(Error::ResponseError(ResponseContent {
9200            status,
9201            content,
9202            entity,
9203        }))
9204    }
9205}
9206
9207/// User-source connection Viewset
9208pub async fn sources_user_connections_all_retrieve(
9209    configuration: &configuration::Configuration,
9210    id: i32,
9211) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllRetrieveError>> {
9212    // add a prefix to parameters to efficiently prevent name collisions
9213    let p_path_id = id;
9214
9215    let uri_str = format!(
9216        "{}/sources/user_connections/all/{id}/",
9217        configuration.base_path,
9218        id = p_path_id
9219    );
9220    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9221
9222    if let Some(ref user_agent) = configuration.user_agent {
9223        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9224    }
9225    if let Some(ref token) = configuration.bearer_access_token {
9226        req_builder = req_builder.bearer_auth(token.to_owned());
9227    };
9228
9229    let req = req_builder.build()?;
9230    let resp = configuration.client.execute(req).await?;
9231
9232    let status = resp.status();
9233    let content_type = resp
9234        .headers()
9235        .get("content-type")
9236        .and_then(|v| v.to_str().ok())
9237        .unwrap_or("application/octet-stream");
9238    let content_type = super::ContentType::from(content_type);
9239
9240    if !status.is_client_error() && !status.is_server_error() {
9241        let content = resp.text().await?;
9242        match content_type {
9243            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9244            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
9245            ContentType::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`")))),
9246        }
9247    } else {
9248        let content = resp.text().await?;
9249        let entity: Option<SourcesUserConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
9250        Err(Error::ResponseError(ResponseContent {
9251            status,
9252            content,
9253            entity,
9254        }))
9255    }
9256}
9257
9258/// User-source connection Viewset
9259pub async fn sources_user_connections_all_update(
9260    configuration: &configuration::Configuration,
9261    id: i32,
9262    user_source_connection_request: models::UserSourceConnectionRequest,
9263) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllUpdateError>> {
9264    // add a prefix to parameters to efficiently prevent name collisions
9265    let p_path_id = id;
9266    let p_body_user_source_connection_request = user_source_connection_request;
9267
9268    let uri_str = format!(
9269        "{}/sources/user_connections/all/{id}/",
9270        configuration.base_path,
9271        id = p_path_id
9272    );
9273    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9274
9275    if let Some(ref user_agent) = configuration.user_agent {
9276        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9277    }
9278    if let Some(ref token) = configuration.bearer_access_token {
9279        req_builder = req_builder.bearer_auth(token.to_owned());
9280    };
9281    req_builder = req_builder.json(&p_body_user_source_connection_request);
9282
9283    let req = req_builder.build()?;
9284    let resp = configuration.client.execute(req).await?;
9285
9286    let status = resp.status();
9287    let content_type = resp
9288        .headers()
9289        .get("content-type")
9290        .and_then(|v| v.to_str().ok())
9291        .unwrap_or("application/octet-stream");
9292    let content_type = super::ContentType::from(content_type);
9293
9294    if !status.is_client_error() && !status.is_server_error() {
9295        let content = resp.text().await?;
9296        match content_type {
9297            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9298            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
9299            ContentType::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`")))),
9300        }
9301    } else {
9302        let content = resp.text().await?;
9303        let entity: Option<SourcesUserConnectionsAllUpdateError> = serde_json::from_str(&content).ok();
9304        Err(Error::ResponseError(ResponseContent {
9305            status,
9306            content,
9307            entity,
9308        }))
9309    }
9310}
9311
9312/// Get a list of all objects that use this object
9313pub async fn sources_user_connections_all_used_by_list(
9314    configuration: &configuration::Configuration,
9315    id: i32,
9316) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsAllUsedByListError>> {
9317    // add a prefix to parameters to efficiently prevent name collisions
9318    let p_path_id = id;
9319
9320    let uri_str = format!(
9321        "{}/sources/user_connections/all/{id}/used_by/",
9322        configuration.base_path,
9323        id = p_path_id
9324    );
9325    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9326
9327    if let Some(ref user_agent) = configuration.user_agent {
9328        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9329    }
9330    if let Some(ref token) = configuration.bearer_access_token {
9331        req_builder = req_builder.bearer_auth(token.to_owned());
9332    };
9333
9334    let req = req_builder.build()?;
9335    let resp = configuration.client.execute(req).await?;
9336
9337    let status = resp.status();
9338    let content_type = resp
9339        .headers()
9340        .get("content-type")
9341        .and_then(|v| v.to_str().ok())
9342        .unwrap_or("application/octet-stream");
9343    let content_type = super::ContentType::from(content_type);
9344
9345    if !status.is_client_error() && !status.is_server_error() {
9346        let content = resp.text().await?;
9347        match content_type {
9348            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9349            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;`"))),
9350            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;`")))),
9351        }
9352    } else {
9353        let content = resp.text().await?;
9354        let entity: Option<SourcesUserConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
9355        Err(Error::ResponseError(ResponseContent {
9356            status,
9357            content,
9358            entity,
9359        }))
9360    }
9361}
9362
9363/// User-source connection Viewset
9364pub async fn sources_user_connections_kerberos_create(
9365    configuration: &configuration::Configuration,
9366    user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest,
9367) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosCreateError>> {
9368    // add a prefix to parameters to efficiently prevent name collisions
9369    let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request;
9370
9371    let uri_str = format!("{}/sources/user_connections/kerberos/", configuration.base_path);
9372    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9373
9374    if let Some(ref user_agent) = configuration.user_agent {
9375        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9376    }
9377    if let Some(ref token) = configuration.bearer_access_token {
9378        req_builder = req_builder.bearer_auth(token.to_owned());
9379    };
9380    req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request);
9381
9382    let req = req_builder.build()?;
9383    let resp = configuration.client.execute(req).await?;
9384
9385    let status = resp.status();
9386    let content_type = resp
9387        .headers()
9388        .get("content-type")
9389        .and_then(|v| v.to_str().ok())
9390        .unwrap_or("application/octet-stream");
9391    let content_type = super::ContentType::from(content_type);
9392
9393    if !status.is_client_error() && !status.is_server_error() {
9394        let content = resp.text().await?;
9395        match content_type {
9396            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9397            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9398            ContentType::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`")))),
9399        }
9400    } else {
9401        let content = resp.text().await?;
9402        let entity: Option<SourcesUserConnectionsKerberosCreateError> = serde_json::from_str(&content).ok();
9403        Err(Error::ResponseError(ResponseContent {
9404            status,
9405            content,
9406            entity,
9407        }))
9408    }
9409}
9410
9411/// User-source connection Viewset
9412pub async fn sources_user_connections_kerberos_destroy(
9413    configuration: &configuration::Configuration,
9414    id: i32,
9415) -> Result<(), Error<SourcesUserConnectionsKerberosDestroyError>> {
9416    // add a prefix to parameters to efficiently prevent name collisions
9417    let p_path_id = id;
9418
9419    let uri_str = format!(
9420        "{}/sources/user_connections/kerberos/{id}/",
9421        configuration.base_path,
9422        id = p_path_id
9423    );
9424    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9425
9426    if let Some(ref user_agent) = configuration.user_agent {
9427        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9428    }
9429    if let Some(ref token) = configuration.bearer_access_token {
9430        req_builder = req_builder.bearer_auth(token.to_owned());
9431    };
9432
9433    let req = req_builder.build()?;
9434    let resp = configuration.client.execute(req).await?;
9435
9436    let status = resp.status();
9437
9438    if !status.is_client_error() && !status.is_server_error() {
9439        Ok(())
9440    } else {
9441        let content = resp.text().await?;
9442        let entity: Option<SourcesUserConnectionsKerberosDestroyError> = serde_json::from_str(&content).ok();
9443        Err(Error::ResponseError(ResponseContent {
9444            status,
9445            content,
9446            entity,
9447        }))
9448    }
9449}
9450
9451/// User-source connection Viewset
9452pub async fn sources_user_connections_kerberos_list(
9453    configuration: &configuration::Configuration,
9454    ordering: Option<&str>,
9455    page: Option<i32>,
9456    page_size: Option<i32>,
9457    search: Option<&str>,
9458    source__slug: Option<&str>,
9459    user: Option<i32>,
9460) -> Result<models::PaginatedUserKerberosSourceConnectionList, Error<SourcesUserConnectionsKerberosListError>> {
9461    // add a prefix to parameters to efficiently prevent name collisions
9462    let p_query_ordering = ordering;
9463    let p_query_page = page;
9464    let p_query_page_size = page_size;
9465    let p_query_search = search;
9466    let p_query_source__slug = source__slug;
9467    let p_query_user = user;
9468
9469    let uri_str = format!("{}/sources/user_connections/kerberos/", configuration.base_path);
9470    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9471
9472    if let Some(ref param_value) = p_query_ordering {
9473        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
9474    }
9475    if let Some(ref param_value) = p_query_page {
9476        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
9477    }
9478    if let Some(ref param_value) = p_query_page_size {
9479        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
9480    }
9481    if let Some(ref param_value) = p_query_search {
9482        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
9483    }
9484    if let Some(ref param_value) = p_query_source__slug {
9485        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
9486    }
9487    if let Some(ref param_value) = p_query_user {
9488        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
9489    }
9490    if let Some(ref user_agent) = configuration.user_agent {
9491        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9492    }
9493    if let Some(ref token) = configuration.bearer_access_token {
9494        req_builder = req_builder.bearer_auth(token.to_owned());
9495    };
9496
9497    let req = req_builder.build()?;
9498    let resp = configuration.client.execute(req).await?;
9499
9500    let status = resp.status();
9501    let content_type = resp
9502        .headers()
9503        .get("content-type")
9504        .and_then(|v| v.to_str().ok())
9505        .unwrap_or("application/octet-stream");
9506    let content_type = super::ContentType::from(content_type);
9507
9508    if !status.is_client_error() && !status.is_server_error() {
9509        let content = resp.text().await?;
9510        match content_type {
9511            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9512            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserKerberosSourceConnectionList`"))),
9513            ContentType::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`")))),
9514        }
9515    } else {
9516        let content = resp.text().await?;
9517        let entity: Option<SourcesUserConnectionsKerberosListError> = serde_json::from_str(&content).ok();
9518        Err(Error::ResponseError(ResponseContent {
9519            status,
9520            content,
9521            entity,
9522        }))
9523    }
9524}
9525
9526/// User-source connection Viewset
9527pub async fn sources_user_connections_kerberos_partial_update(
9528    configuration: &configuration::Configuration,
9529    id: i32,
9530    patched_user_kerberos_source_connection_request: Option<models::PatchedUserKerberosSourceConnectionRequest>,
9531) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosPartialUpdateError>> {
9532    // add a prefix to parameters to efficiently prevent name collisions
9533    let p_path_id = id;
9534    let p_body_patched_user_kerberos_source_connection_request = patched_user_kerberos_source_connection_request;
9535
9536    let uri_str = format!(
9537        "{}/sources/user_connections/kerberos/{id}/",
9538        configuration.base_path,
9539        id = p_path_id
9540    );
9541    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9542
9543    if let Some(ref user_agent) = configuration.user_agent {
9544        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9545    }
9546    if let Some(ref token) = configuration.bearer_access_token {
9547        req_builder = req_builder.bearer_auth(token.to_owned());
9548    };
9549    req_builder = req_builder.json(&p_body_patched_user_kerberos_source_connection_request);
9550
9551    let req = req_builder.build()?;
9552    let resp = configuration.client.execute(req).await?;
9553
9554    let status = resp.status();
9555    let content_type = resp
9556        .headers()
9557        .get("content-type")
9558        .and_then(|v| v.to_str().ok())
9559        .unwrap_or("application/octet-stream");
9560    let content_type = super::ContentType::from(content_type);
9561
9562    if !status.is_client_error() && !status.is_server_error() {
9563        let content = resp.text().await?;
9564        match content_type {
9565            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9566            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9567            ContentType::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`")))),
9568        }
9569    } else {
9570        let content = resp.text().await?;
9571        let entity: Option<SourcesUserConnectionsKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
9572        Err(Error::ResponseError(ResponseContent {
9573            status,
9574            content,
9575            entity,
9576        }))
9577    }
9578}
9579
9580/// User-source connection Viewset
9581pub async fn sources_user_connections_kerberos_retrieve(
9582    configuration: &configuration::Configuration,
9583    id: i32,
9584) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosRetrieveError>> {
9585    // add a prefix to parameters to efficiently prevent name collisions
9586    let p_path_id = id;
9587
9588    let uri_str = format!(
9589        "{}/sources/user_connections/kerberos/{id}/",
9590        configuration.base_path,
9591        id = p_path_id
9592    );
9593    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9594
9595    if let Some(ref user_agent) = configuration.user_agent {
9596        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9597    }
9598    if let Some(ref token) = configuration.bearer_access_token {
9599        req_builder = req_builder.bearer_auth(token.to_owned());
9600    };
9601
9602    let req = req_builder.build()?;
9603    let resp = configuration.client.execute(req).await?;
9604
9605    let status = resp.status();
9606    let content_type = resp
9607        .headers()
9608        .get("content-type")
9609        .and_then(|v| v.to_str().ok())
9610        .unwrap_or("application/octet-stream");
9611    let content_type = super::ContentType::from(content_type);
9612
9613    if !status.is_client_error() && !status.is_server_error() {
9614        let content = resp.text().await?;
9615        match content_type {
9616            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9617            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9618            ContentType::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`")))),
9619        }
9620    } else {
9621        let content = resp.text().await?;
9622        let entity: Option<SourcesUserConnectionsKerberosRetrieveError> = serde_json::from_str(&content).ok();
9623        Err(Error::ResponseError(ResponseContent {
9624            status,
9625            content,
9626            entity,
9627        }))
9628    }
9629}
9630
9631/// User-source connection Viewset
9632pub async fn sources_user_connections_kerberos_update(
9633    configuration: &configuration::Configuration,
9634    id: i32,
9635    user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest,
9636) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosUpdateError>> {
9637    // add a prefix to parameters to efficiently prevent name collisions
9638    let p_path_id = id;
9639    let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request;
9640
9641    let uri_str = format!(
9642        "{}/sources/user_connections/kerberos/{id}/",
9643        configuration.base_path,
9644        id = p_path_id
9645    );
9646    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9647
9648    if let Some(ref user_agent) = configuration.user_agent {
9649        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9650    }
9651    if let Some(ref token) = configuration.bearer_access_token {
9652        req_builder = req_builder.bearer_auth(token.to_owned());
9653    };
9654    req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request);
9655
9656    let req = req_builder.build()?;
9657    let resp = configuration.client.execute(req).await?;
9658
9659    let status = resp.status();
9660    let content_type = resp
9661        .headers()
9662        .get("content-type")
9663        .and_then(|v| v.to_str().ok())
9664        .unwrap_or("application/octet-stream");
9665    let content_type = super::ContentType::from(content_type);
9666
9667    if !status.is_client_error() && !status.is_server_error() {
9668        let content = resp.text().await?;
9669        match content_type {
9670            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9671            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9672            ContentType::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`")))),
9673        }
9674    } else {
9675        let content = resp.text().await?;
9676        let entity: Option<SourcesUserConnectionsKerberosUpdateError> = serde_json::from_str(&content).ok();
9677        Err(Error::ResponseError(ResponseContent {
9678            status,
9679            content,
9680            entity,
9681        }))
9682    }
9683}
9684
9685/// Get a list of all objects that use this object
9686pub async fn sources_user_connections_kerberos_used_by_list(
9687    configuration: &configuration::Configuration,
9688    id: i32,
9689) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsKerberosUsedByListError>> {
9690    // add a prefix to parameters to efficiently prevent name collisions
9691    let p_path_id = id;
9692
9693    let uri_str = format!(
9694        "{}/sources/user_connections/kerberos/{id}/used_by/",
9695        configuration.base_path,
9696        id = p_path_id
9697    );
9698    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9699
9700    if let Some(ref user_agent) = configuration.user_agent {
9701        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9702    }
9703    if let Some(ref token) = configuration.bearer_access_token {
9704        req_builder = req_builder.bearer_auth(token.to_owned());
9705    };
9706
9707    let req = req_builder.build()?;
9708    let resp = configuration.client.execute(req).await?;
9709
9710    let status = resp.status();
9711    let content_type = resp
9712        .headers()
9713        .get("content-type")
9714        .and_then(|v| v.to_str().ok())
9715        .unwrap_or("application/octet-stream");
9716    let content_type = super::ContentType::from(content_type);
9717
9718    if !status.is_client_error() && !status.is_server_error() {
9719        let content = resp.text().await?;
9720        match content_type {
9721            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9722            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;`"))),
9723            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;`")))),
9724        }
9725    } else {
9726        let content = resp.text().await?;
9727        let entity: Option<SourcesUserConnectionsKerberosUsedByListError> = serde_json::from_str(&content).ok();
9728        Err(Error::ResponseError(ResponseContent {
9729            status,
9730            content,
9731            entity,
9732        }))
9733    }
9734}
9735
9736/// User-source connection Viewset
9737pub async fn sources_user_connections_ldap_create(
9738    configuration: &configuration::Configuration,
9739    user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest,
9740) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapCreateError>> {
9741    // add a prefix to parameters to efficiently prevent name collisions
9742    let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request;
9743
9744    let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path);
9745    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9746
9747    if let Some(ref user_agent) = configuration.user_agent {
9748        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9749    }
9750    if let Some(ref token) = configuration.bearer_access_token {
9751        req_builder = req_builder.bearer_auth(token.to_owned());
9752    };
9753    req_builder = req_builder.json(&p_body_user_ldap_source_connection_request);
9754
9755    let req = req_builder.build()?;
9756    let resp = configuration.client.execute(req).await?;
9757
9758    let status = resp.status();
9759    let content_type = resp
9760        .headers()
9761        .get("content-type")
9762        .and_then(|v| v.to_str().ok())
9763        .unwrap_or("application/octet-stream");
9764    let content_type = super::ContentType::from(content_type);
9765
9766    if !status.is_client_error() && !status.is_server_error() {
9767        let content = resp.text().await?;
9768        match content_type {
9769            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9770            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9771            ContentType::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`")))),
9772        }
9773    } else {
9774        let content = resp.text().await?;
9775        let entity: Option<SourcesUserConnectionsLdapCreateError> = serde_json::from_str(&content).ok();
9776        Err(Error::ResponseError(ResponseContent {
9777            status,
9778            content,
9779            entity,
9780        }))
9781    }
9782}
9783
9784/// User-source connection Viewset
9785pub async fn sources_user_connections_ldap_destroy(
9786    configuration: &configuration::Configuration,
9787    id: i32,
9788) -> Result<(), Error<SourcesUserConnectionsLdapDestroyError>> {
9789    // add a prefix to parameters to efficiently prevent name collisions
9790    let p_path_id = id;
9791
9792    let uri_str = format!(
9793        "{}/sources/user_connections/ldap/{id}/",
9794        configuration.base_path,
9795        id = p_path_id
9796    );
9797    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9798
9799    if let Some(ref user_agent) = configuration.user_agent {
9800        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9801    }
9802    if let Some(ref token) = configuration.bearer_access_token {
9803        req_builder = req_builder.bearer_auth(token.to_owned());
9804    };
9805
9806    let req = req_builder.build()?;
9807    let resp = configuration.client.execute(req).await?;
9808
9809    let status = resp.status();
9810
9811    if !status.is_client_error() && !status.is_server_error() {
9812        Ok(())
9813    } else {
9814        let content = resp.text().await?;
9815        let entity: Option<SourcesUserConnectionsLdapDestroyError> = serde_json::from_str(&content).ok();
9816        Err(Error::ResponseError(ResponseContent {
9817            status,
9818            content,
9819            entity,
9820        }))
9821    }
9822}
9823
9824/// User-source connection Viewset
9825pub async fn sources_user_connections_ldap_list(
9826    configuration: &configuration::Configuration,
9827    ordering: Option<&str>,
9828    page: Option<i32>,
9829    page_size: Option<i32>,
9830    search: Option<&str>,
9831    source__slug: Option<&str>,
9832    user: Option<i32>,
9833) -> Result<models::PaginatedUserLdapSourceConnectionList, Error<SourcesUserConnectionsLdapListError>> {
9834    // add a prefix to parameters to efficiently prevent name collisions
9835    let p_query_ordering = ordering;
9836    let p_query_page = page;
9837    let p_query_page_size = page_size;
9838    let p_query_search = search;
9839    let p_query_source__slug = source__slug;
9840    let p_query_user = user;
9841
9842    let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path);
9843    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9844
9845    if let Some(ref param_value) = p_query_ordering {
9846        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
9847    }
9848    if let Some(ref param_value) = p_query_page {
9849        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
9850    }
9851    if let Some(ref param_value) = p_query_page_size {
9852        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
9853    }
9854    if let Some(ref param_value) = p_query_search {
9855        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
9856    }
9857    if let Some(ref param_value) = p_query_source__slug {
9858        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
9859    }
9860    if let Some(ref param_value) = p_query_user {
9861        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
9862    }
9863    if let Some(ref user_agent) = configuration.user_agent {
9864        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9865    }
9866    if let Some(ref token) = configuration.bearer_access_token {
9867        req_builder = req_builder.bearer_auth(token.to_owned());
9868    };
9869
9870    let req = req_builder.build()?;
9871    let resp = configuration.client.execute(req).await?;
9872
9873    let status = resp.status();
9874    let content_type = resp
9875        .headers()
9876        .get("content-type")
9877        .and_then(|v| v.to_str().ok())
9878        .unwrap_or("application/octet-stream");
9879    let content_type = super::ContentType::from(content_type);
9880
9881    if !status.is_client_error() && !status.is_server_error() {
9882        let content = resp.text().await?;
9883        match content_type {
9884            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9885            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserLdapSourceConnectionList`"))),
9886            ContentType::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`")))),
9887        }
9888    } else {
9889        let content = resp.text().await?;
9890        let entity: Option<SourcesUserConnectionsLdapListError> = serde_json::from_str(&content).ok();
9891        Err(Error::ResponseError(ResponseContent {
9892            status,
9893            content,
9894            entity,
9895        }))
9896    }
9897}
9898
9899/// User-source connection Viewset
9900pub async fn sources_user_connections_ldap_partial_update(
9901    configuration: &configuration::Configuration,
9902    id: i32,
9903    patched_user_ldap_source_connection_request: Option<models::PatchedUserLdapSourceConnectionRequest>,
9904) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapPartialUpdateError>> {
9905    // add a prefix to parameters to efficiently prevent name collisions
9906    let p_path_id = id;
9907    let p_body_patched_user_ldap_source_connection_request = patched_user_ldap_source_connection_request;
9908
9909    let uri_str = format!(
9910        "{}/sources/user_connections/ldap/{id}/",
9911        configuration.base_path,
9912        id = p_path_id
9913    );
9914    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9915
9916    if let Some(ref user_agent) = configuration.user_agent {
9917        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9918    }
9919    if let Some(ref token) = configuration.bearer_access_token {
9920        req_builder = req_builder.bearer_auth(token.to_owned());
9921    };
9922    req_builder = req_builder.json(&p_body_patched_user_ldap_source_connection_request);
9923
9924    let req = req_builder.build()?;
9925    let resp = configuration.client.execute(req).await?;
9926
9927    let status = resp.status();
9928    let content_type = resp
9929        .headers()
9930        .get("content-type")
9931        .and_then(|v| v.to_str().ok())
9932        .unwrap_or("application/octet-stream");
9933    let content_type = super::ContentType::from(content_type);
9934
9935    if !status.is_client_error() && !status.is_server_error() {
9936        let content = resp.text().await?;
9937        match content_type {
9938            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9939            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9940            ContentType::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`")))),
9941        }
9942    } else {
9943        let content = resp.text().await?;
9944        let entity: Option<SourcesUserConnectionsLdapPartialUpdateError> = serde_json::from_str(&content).ok();
9945        Err(Error::ResponseError(ResponseContent {
9946            status,
9947            content,
9948            entity,
9949        }))
9950    }
9951}
9952
9953/// User-source connection Viewset
9954pub async fn sources_user_connections_ldap_retrieve(
9955    configuration: &configuration::Configuration,
9956    id: i32,
9957) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapRetrieveError>> {
9958    // add a prefix to parameters to efficiently prevent name collisions
9959    let p_path_id = id;
9960
9961    let uri_str = format!(
9962        "{}/sources/user_connections/ldap/{id}/",
9963        configuration.base_path,
9964        id = p_path_id
9965    );
9966    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9967
9968    if let Some(ref user_agent) = configuration.user_agent {
9969        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9970    }
9971    if let Some(ref token) = configuration.bearer_access_token {
9972        req_builder = req_builder.bearer_auth(token.to_owned());
9973    };
9974
9975    let req = req_builder.build()?;
9976    let resp = configuration.client.execute(req).await?;
9977
9978    let status = resp.status();
9979    let content_type = resp
9980        .headers()
9981        .get("content-type")
9982        .and_then(|v| v.to_str().ok())
9983        .unwrap_or("application/octet-stream");
9984    let content_type = super::ContentType::from(content_type);
9985
9986    if !status.is_client_error() && !status.is_server_error() {
9987        let content = resp.text().await?;
9988        match content_type {
9989            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9990            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9991            ContentType::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`")))),
9992        }
9993    } else {
9994        let content = resp.text().await?;
9995        let entity: Option<SourcesUserConnectionsLdapRetrieveError> = serde_json::from_str(&content).ok();
9996        Err(Error::ResponseError(ResponseContent {
9997            status,
9998            content,
9999            entity,
10000        }))
10001    }
10002}
10003
10004/// User-source connection Viewset
10005pub async fn sources_user_connections_ldap_update(
10006    configuration: &configuration::Configuration,
10007    id: i32,
10008    user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest,
10009) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapUpdateError>> {
10010    // add a prefix to parameters to efficiently prevent name collisions
10011    let p_path_id = id;
10012    let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request;
10013
10014    let uri_str = format!(
10015        "{}/sources/user_connections/ldap/{id}/",
10016        configuration.base_path,
10017        id = p_path_id
10018    );
10019    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10020
10021    if let Some(ref user_agent) = configuration.user_agent {
10022        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10023    }
10024    if let Some(ref token) = configuration.bearer_access_token {
10025        req_builder = req_builder.bearer_auth(token.to_owned());
10026    };
10027    req_builder = req_builder.json(&p_body_user_ldap_source_connection_request);
10028
10029    let req = req_builder.build()?;
10030    let resp = configuration.client.execute(req).await?;
10031
10032    let status = resp.status();
10033    let content_type = resp
10034        .headers()
10035        .get("content-type")
10036        .and_then(|v| v.to_str().ok())
10037        .unwrap_or("application/octet-stream");
10038    let content_type = super::ContentType::from(content_type);
10039
10040    if !status.is_client_error() && !status.is_server_error() {
10041        let content = resp.text().await?;
10042        match content_type {
10043            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10044            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
10045            ContentType::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`")))),
10046        }
10047    } else {
10048        let content = resp.text().await?;
10049        let entity: Option<SourcesUserConnectionsLdapUpdateError> = serde_json::from_str(&content).ok();
10050        Err(Error::ResponseError(ResponseContent {
10051            status,
10052            content,
10053            entity,
10054        }))
10055    }
10056}
10057
10058/// Get a list of all objects that use this object
10059pub async fn sources_user_connections_ldap_used_by_list(
10060    configuration: &configuration::Configuration,
10061    id: i32,
10062) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsLdapUsedByListError>> {
10063    // add a prefix to parameters to efficiently prevent name collisions
10064    let p_path_id = id;
10065
10066    let uri_str = format!(
10067        "{}/sources/user_connections/ldap/{id}/used_by/",
10068        configuration.base_path,
10069        id = p_path_id
10070    );
10071    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10072
10073    if let Some(ref user_agent) = configuration.user_agent {
10074        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10075    }
10076    if let Some(ref token) = configuration.bearer_access_token {
10077        req_builder = req_builder.bearer_auth(token.to_owned());
10078    };
10079
10080    let req = req_builder.build()?;
10081    let resp = configuration.client.execute(req).await?;
10082
10083    let status = resp.status();
10084    let content_type = resp
10085        .headers()
10086        .get("content-type")
10087        .and_then(|v| v.to_str().ok())
10088        .unwrap_or("application/octet-stream");
10089    let content_type = super::ContentType::from(content_type);
10090
10091    if !status.is_client_error() && !status.is_server_error() {
10092        let content = resp.text().await?;
10093        match content_type {
10094            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10095            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;`"))),
10096            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;`")))),
10097        }
10098    } else {
10099        let content = resp.text().await?;
10100        let entity: Option<SourcesUserConnectionsLdapUsedByListError> = serde_json::from_str(&content).ok();
10101        Err(Error::ResponseError(ResponseContent {
10102            status,
10103            content,
10104            entity,
10105        }))
10106    }
10107}
10108
10109/// User-source connection Viewset
10110pub async fn sources_user_connections_oauth_create(
10111    configuration: &configuration::Configuration,
10112    user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest,
10113) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthCreateError>> {
10114    // add a prefix to parameters to efficiently prevent name collisions
10115    let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request;
10116
10117    let uri_str = format!("{}/sources/user_connections/oauth/", configuration.base_path);
10118    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10119
10120    if let Some(ref user_agent) = configuration.user_agent {
10121        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10122    }
10123    if let Some(ref token) = configuration.bearer_access_token {
10124        req_builder = req_builder.bearer_auth(token.to_owned());
10125    };
10126    req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request);
10127
10128    let req = req_builder.build()?;
10129    let resp = configuration.client.execute(req).await?;
10130
10131    let status = resp.status();
10132    let content_type = resp
10133        .headers()
10134        .get("content-type")
10135        .and_then(|v| v.to_str().ok())
10136        .unwrap_or("application/octet-stream");
10137    let content_type = super::ContentType::from(content_type);
10138
10139    if !status.is_client_error() && !status.is_server_error() {
10140        let content = resp.text().await?;
10141        match content_type {
10142            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10143            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10144            ContentType::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`")))),
10145        }
10146    } else {
10147        let content = resp.text().await?;
10148        let entity: Option<SourcesUserConnectionsOauthCreateError> = serde_json::from_str(&content).ok();
10149        Err(Error::ResponseError(ResponseContent {
10150            status,
10151            content,
10152            entity,
10153        }))
10154    }
10155}
10156
10157/// User-source connection Viewset
10158pub async fn sources_user_connections_oauth_destroy(
10159    configuration: &configuration::Configuration,
10160    id: i32,
10161) -> Result<(), Error<SourcesUserConnectionsOauthDestroyError>> {
10162    // add a prefix to parameters to efficiently prevent name collisions
10163    let p_path_id = id;
10164
10165    let uri_str = format!(
10166        "{}/sources/user_connections/oauth/{id}/",
10167        configuration.base_path,
10168        id = p_path_id
10169    );
10170    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10171
10172    if let Some(ref user_agent) = configuration.user_agent {
10173        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10174    }
10175    if let Some(ref token) = configuration.bearer_access_token {
10176        req_builder = req_builder.bearer_auth(token.to_owned());
10177    };
10178
10179    let req = req_builder.build()?;
10180    let resp = configuration.client.execute(req).await?;
10181
10182    let status = resp.status();
10183
10184    if !status.is_client_error() && !status.is_server_error() {
10185        Ok(())
10186    } else {
10187        let content = resp.text().await?;
10188        let entity: Option<SourcesUserConnectionsOauthDestroyError> = serde_json::from_str(&content).ok();
10189        Err(Error::ResponseError(ResponseContent {
10190            status,
10191            content,
10192            entity,
10193        }))
10194    }
10195}
10196
10197/// User-source connection Viewset
10198pub async fn sources_user_connections_oauth_list(
10199    configuration: &configuration::Configuration,
10200    ordering: Option<&str>,
10201    page: Option<i32>,
10202    page_size: Option<i32>,
10203    search: Option<&str>,
10204    source__slug: Option<&str>,
10205    user: Option<i32>,
10206) -> Result<models::PaginatedUserOAuthSourceConnectionList, Error<SourcesUserConnectionsOauthListError>> {
10207    // add a prefix to parameters to efficiently prevent name collisions
10208    let p_query_ordering = ordering;
10209    let p_query_page = page;
10210    let p_query_page_size = page_size;
10211    let p_query_search = search;
10212    let p_query_source__slug = source__slug;
10213    let p_query_user = user;
10214
10215    let uri_str = format!("{}/sources/user_connections/oauth/", configuration.base_path);
10216    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10217
10218    if let Some(ref param_value) = p_query_ordering {
10219        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
10220    }
10221    if let Some(ref param_value) = p_query_page {
10222        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
10223    }
10224    if let Some(ref param_value) = p_query_page_size {
10225        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
10226    }
10227    if let Some(ref param_value) = p_query_search {
10228        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
10229    }
10230    if let Some(ref param_value) = p_query_source__slug {
10231        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
10232    }
10233    if let Some(ref param_value) = p_query_user {
10234        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
10235    }
10236    if let Some(ref user_agent) = configuration.user_agent {
10237        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10238    }
10239    if let Some(ref token) = configuration.bearer_access_token {
10240        req_builder = req_builder.bearer_auth(token.to_owned());
10241    };
10242
10243    let req = req_builder.build()?;
10244    let resp = configuration.client.execute(req).await?;
10245
10246    let status = resp.status();
10247    let content_type = resp
10248        .headers()
10249        .get("content-type")
10250        .and_then(|v| v.to_str().ok())
10251        .unwrap_or("application/octet-stream");
10252    let content_type = super::ContentType::from(content_type);
10253
10254    if !status.is_client_error() && !status.is_server_error() {
10255        let content = resp.text().await?;
10256        match content_type {
10257            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10258            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserOAuthSourceConnectionList`"))),
10259            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserOAuthSourceConnectionList`")))),
10260        }
10261    } else {
10262        let content = resp.text().await?;
10263        let entity: Option<SourcesUserConnectionsOauthListError> = serde_json::from_str(&content).ok();
10264        Err(Error::ResponseError(ResponseContent {
10265            status,
10266            content,
10267            entity,
10268        }))
10269    }
10270}
10271
10272/// User-source connection Viewset
10273pub async fn sources_user_connections_oauth_partial_update(
10274    configuration: &configuration::Configuration,
10275    id: i32,
10276    patched_user_o_auth_source_connection_request: Option<models::PatchedUserOAuthSourceConnectionRequest>,
10277) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthPartialUpdateError>> {
10278    // add a prefix to parameters to efficiently prevent name collisions
10279    let p_path_id = id;
10280    let p_body_patched_user_o_auth_source_connection_request = patched_user_o_auth_source_connection_request;
10281
10282    let uri_str = format!(
10283        "{}/sources/user_connections/oauth/{id}/",
10284        configuration.base_path,
10285        id = p_path_id
10286    );
10287    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10288
10289    if let Some(ref user_agent) = configuration.user_agent {
10290        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10291    }
10292    if let Some(ref token) = configuration.bearer_access_token {
10293        req_builder = req_builder.bearer_auth(token.to_owned());
10294    };
10295    req_builder = req_builder.json(&p_body_patched_user_o_auth_source_connection_request);
10296
10297    let req = req_builder.build()?;
10298    let resp = configuration.client.execute(req).await?;
10299
10300    let status = resp.status();
10301    let content_type = resp
10302        .headers()
10303        .get("content-type")
10304        .and_then(|v| v.to_str().ok())
10305        .unwrap_or("application/octet-stream");
10306    let content_type = super::ContentType::from(content_type);
10307
10308    if !status.is_client_error() && !status.is_server_error() {
10309        let content = resp.text().await?;
10310        match content_type {
10311            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10312            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10313            ContentType::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`")))),
10314        }
10315    } else {
10316        let content = resp.text().await?;
10317        let entity: Option<SourcesUserConnectionsOauthPartialUpdateError> = serde_json::from_str(&content).ok();
10318        Err(Error::ResponseError(ResponseContent {
10319            status,
10320            content,
10321            entity,
10322        }))
10323    }
10324}
10325
10326/// User-source connection Viewset
10327pub async fn sources_user_connections_oauth_retrieve(
10328    configuration: &configuration::Configuration,
10329    id: i32,
10330) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthRetrieveError>> {
10331    // add a prefix to parameters to efficiently prevent name collisions
10332    let p_path_id = id;
10333
10334    let uri_str = format!(
10335        "{}/sources/user_connections/oauth/{id}/",
10336        configuration.base_path,
10337        id = p_path_id
10338    );
10339    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10340
10341    if let Some(ref user_agent) = configuration.user_agent {
10342        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10343    }
10344    if let Some(ref token) = configuration.bearer_access_token {
10345        req_builder = req_builder.bearer_auth(token.to_owned());
10346    };
10347
10348    let req = req_builder.build()?;
10349    let resp = configuration.client.execute(req).await?;
10350
10351    let status = resp.status();
10352    let content_type = resp
10353        .headers()
10354        .get("content-type")
10355        .and_then(|v| v.to_str().ok())
10356        .unwrap_or("application/octet-stream");
10357    let content_type = super::ContentType::from(content_type);
10358
10359    if !status.is_client_error() && !status.is_server_error() {
10360        let content = resp.text().await?;
10361        match content_type {
10362            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10363            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10364            ContentType::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`")))),
10365        }
10366    } else {
10367        let content = resp.text().await?;
10368        let entity: Option<SourcesUserConnectionsOauthRetrieveError> = serde_json::from_str(&content).ok();
10369        Err(Error::ResponseError(ResponseContent {
10370            status,
10371            content,
10372            entity,
10373        }))
10374    }
10375}
10376
10377/// User-source connection Viewset
10378pub async fn sources_user_connections_oauth_update(
10379    configuration: &configuration::Configuration,
10380    id: i32,
10381    user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest,
10382) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthUpdateError>> {
10383    // add a prefix to parameters to efficiently prevent name collisions
10384    let p_path_id = id;
10385    let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request;
10386
10387    let uri_str = format!(
10388        "{}/sources/user_connections/oauth/{id}/",
10389        configuration.base_path,
10390        id = p_path_id
10391    );
10392    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10393
10394    if let Some(ref user_agent) = configuration.user_agent {
10395        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10396    }
10397    if let Some(ref token) = configuration.bearer_access_token {
10398        req_builder = req_builder.bearer_auth(token.to_owned());
10399    };
10400    req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request);
10401
10402    let req = req_builder.build()?;
10403    let resp = configuration.client.execute(req).await?;
10404
10405    let status = resp.status();
10406    let content_type = resp
10407        .headers()
10408        .get("content-type")
10409        .and_then(|v| v.to_str().ok())
10410        .unwrap_or("application/octet-stream");
10411    let content_type = super::ContentType::from(content_type);
10412
10413    if !status.is_client_error() && !status.is_server_error() {
10414        let content = resp.text().await?;
10415        match content_type {
10416            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10417            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10418            ContentType::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`")))),
10419        }
10420    } else {
10421        let content = resp.text().await?;
10422        let entity: Option<SourcesUserConnectionsOauthUpdateError> = serde_json::from_str(&content).ok();
10423        Err(Error::ResponseError(ResponseContent {
10424            status,
10425            content,
10426            entity,
10427        }))
10428    }
10429}
10430
10431/// Get a list of all objects that use this object
10432pub async fn sources_user_connections_oauth_used_by_list(
10433    configuration: &configuration::Configuration,
10434    id: i32,
10435) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsOauthUsedByListError>> {
10436    // add a prefix to parameters to efficiently prevent name collisions
10437    let p_path_id = id;
10438
10439    let uri_str = format!(
10440        "{}/sources/user_connections/oauth/{id}/used_by/",
10441        configuration.base_path,
10442        id = p_path_id
10443    );
10444    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10445
10446    if let Some(ref user_agent) = configuration.user_agent {
10447        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10448    }
10449    if let Some(ref token) = configuration.bearer_access_token {
10450        req_builder = req_builder.bearer_auth(token.to_owned());
10451    };
10452
10453    let req = req_builder.build()?;
10454    let resp = configuration.client.execute(req).await?;
10455
10456    let status = resp.status();
10457    let content_type = resp
10458        .headers()
10459        .get("content-type")
10460        .and_then(|v| v.to_str().ok())
10461        .unwrap_or("application/octet-stream");
10462    let content_type = super::ContentType::from(content_type);
10463
10464    if !status.is_client_error() && !status.is_server_error() {
10465        let content = resp.text().await?;
10466        match content_type {
10467            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10468            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;`"))),
10469            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;`")))),
10470        }
10471    } else {
10472        let content = resp.text().await?;
10473        let entity: Option<SourcesUserConnectionsOauthUsedByListError> = serde_json::from_str(&content).ok();
10474        Err(Error::ResponseError(ResponseContent {
10475            status,
10476            content,
10477            entity,
10478        }))
10479    }
10480}
10481
10482/// User-source connection Viewset
10483pub async fn sources_user_connections_plex_create(
10484    configuration: &configuration::Configuration,
10485    user_plex_source_connection_request: models::UserPlexSourceConnectionRequest,
10486) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexCreateError>> {
10487    // add a prefix to parameters to efficiently prevent name collisions
10488    let p_body_user_plex_source_connection_request = user_plex_source_connection_request;
10489
10490    let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path);
10491    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10492
10493    if let Some(ref user_agent) = configuration.user_agent {
10494        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10495    }
10496    if let Some(ref token) = configuration.bearer_access_token {
10497        req_builder = req_builder.bearer_auth(token.to_owned());
10498    };
10499    req_builder = req_builder.json(&p_body_user_plex_source_connection_request);
10500
10501    let req = req_builder.build()?;
10502    let resp = configuration.client.execute(req).await?;
10503
10504    let status = resp.status();
10505    let content_type = resp
10506        .headers()
10507        .get("content-type")
10508        .and_then(|v| v.to_str().ok())
10509        .unwrap_or("application/octet-stream");
10510    let content_type = super::ContentType::from(content_type);
10511
10512    if !status.is_client_error() && !status.is_server_error() {
10513        let content = resp.text().await?;
10514        match content_type {
10515            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10516            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10517            ContentType::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`")))),
10518        }
10519    } else {
10520        let content = resp.text().await?;
10521        let entity: Option<SourcesUserConnectionsPlexCreateError> = serde_json::from_str(&content).ok();
10522        Err(Error::ResponseError(ResponseContent {
10523            status,
10524            content,
10525            entity,
10526        }))
10527    }
10528}
10529
10530/// User-source connection Viewset
10531pub async fn sources_user_connections_plex_destroy(
10532    configuration: &configuration::Configuration,
10533    id: i32,
10534) -> Result<(), Error<SourcesUserConnectionsPlexDestroyError>> {
10535    // add a prefix to parameters to efficiently prevent name collisions
10536    let p_path_id = id;
10537
10538    let uri_str = format!(
10539        "{}/sources/user_connections/plex/{id}/",
10540        configuration.base_path,
10541        id = p_path_id
10542    );
10543    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10544
10545    if let Some(ref user_agent) = configuration.user_agent {
10546        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10547    }
10548    if let Some(ref token) = configuration.bearer_access_token {
10549        req_builder = req_builder.bearer_auth(token.to_owned());
10550    };
10551
10552    let req = req_builder.build()?;
10553    let resp = configuration.client.execute(req).await?;
10554
10555    let status = resp.status();
10556
10557    if !status.is_client_error() && !status.is_server_error() {
10558        Ok(())
10559    } else {
10560        let content = resp.text().await?;
10561        let entity: Option<SourcesUserConnectionsPlexDestroyError> = serde_json::from_str(&content).ok();
10562        Err(Error::ResponseError(ResponseContent {
10563            status,
10564            content,
10565            entity,
10566        }))
10567    }
10568}
10569
10570/// User-source connection Viewset
10571pub async fn sources_user_connections_plex_list(
10572    configuration: &configuration::Configuration,
10573    ordering: Option<&str>,
10574    page: Option<i32>,
10575    page_size: Option<i32>,
10576    search: Option<&str>,
10577    source__slug: Option<&str>,
10578    user: Option<i32>,
10579) -> Result<models::PaginatedUserPlexSourceConnectionList, Error<SourcesUserConnectionsPlexListError>> {
10580    // add a prefix to parameters to efficiently prevent name collisions
10581    let p_query_ordering = ordering;
10582    let p_query_page = page;
10583    let p_query_page_size = page_size;
10584    let p_query_search = search;
10585    let p_query_source__slug = source__slug;
10586    let p_query_user = user;
10587
10588    let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path);
10589    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10590
10591    if let Some(ref param_value) = p_query_ordering {
10592        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
10593    }
10594    if let Some(ref param_value) = p_query_page {
10595        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
10596    }
10597    if let Some(ref param_value) = p_query_page_size {
10598        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
10599    }
10600    if let Some(ref param_value) = p_query_search {
10601        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
10602    }
10603    if let Some(ref param_value) = p_query_source__slug {
10604        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
10605    }
10606    if let Some(ref param_value) = p_query_user {
10607        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
10608    }
10609    if let Some(ref user_agent) = configuration.user_agent {
10610        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10611    }
10612    if let Some(ref token) = configuration.bearer_access_token {
10613        req_builder = req_builder.bearer_auth(token.to_owned());
10614    };
10615
10616    let req = req_builder.build()?;
10617    let resp = configuration.client.execute(req).await?;
10618
10619    let status = resp.status();
10620    let content_type = resp
10621        .headers()
10622        .get("content-type")
10623        .and_then(|v| v.to_str().ok())
10624        .unwrap_or("application/octet-stream");
10625    let content_type = super::ContentType::from(content_type);
10626
10627    if !status.is_client_error() && !status.is_server_error() {
10628        let content = resp.text().await?;
10629        match content_type {
10630            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10631            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserPlexSourceConnectionList`"))),
10632            ContentType::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`")))),
10633        }
10634    } else {
10635        let content = resp.text().await?;
10636        let entity: Option<SourcesUserConnectionsPlexListError> = serde_json::from_str(&content).ok();
10637        Err(Error::ResponseError(ResponseContent {
10638            status,
10639            content,
10640            entity,
10641        }))
10642    }
10643}
10644
10645/// User-source connection Viewset
10646pub async fn sources_user_connections_plex_partial_update(
10647    configuration: &configuration::Configuration,
10648    id: i32,
10649    patched_user_plex_source_connection_request: Option<models::PatchedUserPlexSourceConnectionRequest>,
10650) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexPartialUpdateError>> {
10651    // add a prefix to parameters to efficiently prevent name collisions
10652    let p_path_id = id;
10653    let p_body_patched_user_plex_source_connection_request = patched_user_plex_source_connection_request;
10654
10655    let uri_str = format!(
10656        "{}/sources/user_connections/plex/{id}/",
10657        configuration.base_path,
10658        id = p_path_id
10659    );
10660    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10661
10662    if let Some(ref user_agent) = configuration.user_agent {
10663        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10664    }
10665    if let Some(ref token) = configuration.bearer_access_token {
10666        req_builder = req_builder.bearer_auth(token.to_owned());
10667    };
10668    req_builder = req_builder.json(&p_body_patched_user_plex_source_connection_request);
10669
10670    let req = req_builder.build()?;
10671    let resp = configuration.client.execute(req).await?;
10672
10673    let status = resp.status();
10674    let content_type = resp
10675        .headers()
10676        .get("content-type")
10677        .and_then(|v| v.to_str().ok())
10678        .unwrap_or("application/octet-stream");
10679    let content_type = super::ContentType::from(content_type);
10680
10681    if !status.is_client_error() && !status.is_server_error() {
10682        let content = resp.text().await?;
10683        match content_type {
10684            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10685            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10686            ContentType::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`")))),
10687        }
10688    } else {
10689        let content = resp.text().await?;
10690        let entity: Option<SourcesUserConnectionsPlexPartialUpdateError> = serde_json::from_str(&content).ok();
10691        Err(Error::ResponseError(ResponseContent {
10692            status,
10693            content,
10694            entity,
10695        }))
10696    }
10697}
10698
10699/// User-source connection Viewset
10700pub async fn sources_user_connections_plex_retrieve(
10701    configuration: &configuration::Configuration,
10702    id: i32,
10703) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexRetrieveError>> {
10704    // add a prefix to parameters to efficiently prevent name collisions
10705    let p_path_id = id;
10706
10707    let uri_str = format!(
10708        "{}/sources/user_connections/plex/{id}/",
10709        configuration.base_path,
10710        id = p_path_id
10711    );
10712    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10713
10714    if let Some(ref user_agent) = configuration.user_agent {
10715        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10716    }
10717    if let Some(ref token) = configuration.bearer_access_token {
10718        req_builder = req_builder.bearer_auth(token.to_owned());
10719    };
10720
10721    let req = req_builder.build()?;
10722    let resp = configuration.client.execute(req).await?;
10723
10724    let status = resp.status();
10725    let content_type = resp
10726        .headers()
10727        .get("content-type")
10728        .and_then(|v| v.to_str().ok())
10729        .unwrap_or("application/octet-stream");
10730    let content_type = super::ContentType::from(content_type);
10731
10732    if !status.is_client_error() && !status.is_server_error() {
10733        let content = resp.text().await?;
10734        match content_type {
10735            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10736            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10737            ContentType::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`")))),
10738        }
10739    } else {
10740        let content = resp.text().await?;
10741        let entity: Option<SourcesUserConnectionsPlexRetrieveError> = serde_json::from_str(&content).ok();
10742        Err(Error::ResponseError(ResponseContent {
10743            status,
10744            content,
10745            entity,
10746        }))
10747    }
10748}
10749
10750/// User-source connection Viewset
10751pub async fn sources_user_connections_plex_update(
10752    configuration: &configuration::Configuration,
10753    id: i32,
10754    user_plex_source_connection_request: models::UserPlexSourceConnectionRequest,
10755) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexUpdateError>> {
10756    // add a prefix to parameters to efficiently prevent name collisions
10757    let p_path_id = id;
10758    let p_body_user_plex_source_connection_request = user_plex_source_connection_request;
10759
10760    let uri_str = format!(
10761        "{}/sources/user_connections/plex/{id}/",
10762        configuration.base_path,
10763        id = p_path_id
10764    );
10765    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10766
10767    if let Some(ref user_agent) = configuration.user_agent {
10768        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10769    }
10770    if let Some(ref token) = configuration.bearer_access_token {
10771        req_builder = req_builder.bearer_auth(token.to_owned());
10772    };
10773    req_builder = req_builder.json(&p_body_user_plex_source_connection_request);
10774
10775    let req = req_builder.build()?;
10776    let resp = configuration.client.execute(req).await?;
10777
10778    let status = resp.status();
10779    let content_type = resp
10780        .headers()
10781        .get("content-type")
10782        .and_then(|v| v.to_str().ok())
10783        .unwrap_or("application/octet-stream");
10784    let content_type = super::ContentType::from(content_type);
10785
10786    if !status.is_client_error() && !status.is_server_error() {
10787        let content = resp.text().await?;
10788        match content_type {
10789            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10790            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10791            ContentType::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`")))),
10792        }
10793    } else {
10794        let content = resp.text().await?;
10795        let entity: Option<SourcesUserConnectionsPlexUpdateError> = serde_json::from_str(&content).ok();
10796        Err(Error::ResponseError(ResponseContent {
10797            status,
10798            content,
10799            entity,
10800        }))
10801    }
10802}
10803
10804/// Get a list of all objects that use this object
10805pub async fn sources_user_connections_plex_used_by_list(
10806    configuration: &configuration::Configuration,
10807    id: i32,
10808) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsPlexUsedByListError>> {
10809    // add a prefix to parameters to efficiently prevent name collisions
10810    let p_path_id = id;
10811
10812    let uri_str = format!(
10813        "{}/sources/user_connections/plex/{id}/used_by/",
10814        configuration.base_path,
10815        id = p_path_id
10816    );
10817    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10818
10819    if let Some(ref user_agent) = configuration.user_agent {
10820        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10821    }
10822    if let Some(ref token) = configuration.bearer_access_token {
10823        req_builder = req_builder.bearer_auth(token.to_owned());
10824    };
10825
10826    let req = req_builder.build()?;
10827    let resp = configuration.client.execute(req).await?;
10828
10829    let status = resp.status();
10830    let content_type = resp
10831        .headers()
10832        .get("content-type")
10833        .and_then(|v| v.to_str().ok())
10834        .unwrap_or("application/octet-stream");
10835    let content_type = super::ContentType::from(content_type);
10836
10837    if !status.is_client_error() && !status.is_server_error() {
10838        let content = resp.text().await?;
10839        match content_type {
10840            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10841            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;`"))),
10842            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;`")))),
10843        }
10844    } else {
10845        let content = resp.text().await?;
10846        let entity: Option<SourcesUserConnectionsPlexUsedByListError> = serde_json::from_str(&content).ok();
10847        Err(Error::ResponseError(ResponseContent {
10848            status,
10849            content,
10850            entity,
10851        }))
10852    }
10853}
10854
10855/// User-source connection Viewset
10856pub async fn sources_user_connections_saml_create(
10857    configuration: &configuration::Configuration,
10858    user_saml_source_connection_request: models::UserSamlSourceConnectionRequest,
10859) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlCreateError>> {
10860    // add a prefix to parameters to efficiently prevent name collisions
10861    let p_body_user_saml_source_connection_request = user_saml_source_connection_request;
10862
10863    let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path);
10864    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10865
10866    if let Some(ref user_agent) = configuration.user_agent {
10867        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10868    }
10869    if let Some(ref token) = configuration.bearer_access_token {
10870        req_builder = req_builder.bearer_auth(token.to_owned());
10871    };
10872    req_builder = req_builder.json(&p_body_user_saml_source_connection_request);
10873
10874    let req = req_builder.build()?;
10875    let resp = configuration.client.execute(req).await?;
10876
10877    let status = resp.status();
10878    let content_type = resp
10879        .headers()
10880        .get("content-type")
10881        .and_then(|v| v.to_str().ok())
10882        .unwrap_or("application/octet-stream");
10883    let content_type = super::ContentType::from(content_type);
10884
10885    if !status.is_client_error() && !status.is_server_error() {
10886        let content = resp.text().await?;
10887        match content_type {
10888            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10889            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
10890            ContentType::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`")))),
10891        }
10892    } else {
10893        let content = resp.text().await?;
10894        let entity: Option<SourcesUserConnectionsSamlCreateError> = serde_json::from_str(&content).ok();
10895        Err(Error::ResponseError(ResponseContent {
10896            status,
10897            content,
10898            entity,
10899        }))
10900    }
10901}
10902
10903/// User-source connection Viewset
10904pub async fn sources_user_connections_saml_destroy(
10905    configuration: &configuration::Configuration,
10906    id: i32,
10907) -> Result<(), Error<SourcesUserConnectionsSamlDestroyError>> {
10908    // add a prefix to parameters to efficiently prevent name collisions
10909    let p_path_id = id;
10910
10911    let uri_str = format!(
10912        "{}/sources/user_connections/saml/{id}/",
10913        configuration.base_path,
10914        id = p_path_id
10915    );
10916    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10917
10918    if let Some(ref user_agent) = configuration.user_agent {
10919        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10920    }
10921    if let Some(ref token) = configuration.bearer_access_token {
10922        req_builder = req_builder.bearer_auth(token.to_owned());
10923    };
10924
10925    let req = req_builder.build()?;
10926    let resp = configuration.client.execute(req).await?;
10927
10928    let status = resp.status();
10929
10930    if !status.is_client_error() && !status.is_server_error() {
10931        Ok(())
10932    } else {
10933        let content = resp.text().await?;
10934        let entity: Option<SourcesUserConnectionsSamlDestroyError> = serde_json::from_str(&content).ok();
10935        Err(Error::ResponseError(ResponseContent {
10936            status,
10937            content,
10938            entity,
10939        }))
10940    }
10941}
10942
10943/// User-source connection Viewset
10944pub async fn sources_user_connections_saml_list(
10945    configuration: &configuration::Configuration,
10946    ordering: Option<&str>,
10947    page: Option<i32>,
10948    page_size: Option<i32>,
10949    search: Option<&str>,
10950    source__slug: Option<&str>,
10951    user: Option<i32>,
10952) -> Result<models::PaginatedUserSamlSourceConnectionList, Error<SourcesUserConnectionsSamlListError>> {
10953    // add a prefix to parameters to efficiently prevent name collisions
10954    let p_query_ordering = ordering;
10955    let p_query_page = page;
10956    let p_query_page_size = page_size;
10957    let p_query_search = search;
10958    let p_query_source__slug = source__slug;
10959    let p_query_user = user;
10960
10961    let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path);
10962    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10963
10964    if let Some(ref param_value) = p_query_ordering {
10965        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
10966    }
10967    if let Some(ref param_value) = p_query_page {
10968        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
10969    }
10970    if let Some(ref param_value) = p_query_page_size {
10971        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
10972    }
10973    if let Some(ref param_value) = p_query_search {
10974        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
10975    }
10976    if let Some(ref param_value) = p_query_source__slug {
10977        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
10978    }
10979    if let Some(ref param_value) = p_query_user {
10980        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
10981    }
10982    if let Some(ref user_agent) = configuration.user_agent {
10983        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10984    }
10985    if let Some(ref token) = configuration.bearer_access_token {
10986        req_builder = req_builder.bearer_auth(token.to_owned());
10987    };
10988
10989    let req = req_builder.build()?;
10990    let resp = configuration.client.execute(req).await?;
10991
10992    let status = resp.status();
10993    let content_type = resp
10994        .headers()
10995        .get("content-type")
10996        .and_then(|v| v.to_str().ok())
10997        .unwrap_or("application/octet-stream");
10998    let content_type = super::ContentType::from(content_type);
10999
11000    if !status.is_client_error() && !status.is_server_error() {
11001        let content = resp.text().await?;
11002        match content_type {
11003            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11004            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserSamlSourceConnectionList`"))),
11005            ContentType::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`")))),
11006        }
11007    } else {
11008        let content = resp.text().await?;
11009        let entity: Option<SourcesUserConnectionsSamlListError> = serde_json::from_str(&content).ok();
11010        Err(Error::ResponseError(ResponseContent {
11011            status,
11012            content,
11013            entity,
11014        }))
11015    }
11016}
11017
11018/// User-source connection Viewset
11019pub async fn sources_user_connections_saml_partial_update(
11020    configuration: &configuration::Configuration,
11021    id: i32,
11022    patched_user_saml_source_connection_request: Option<models::PatchedUserSamlSourceConnectionRequest>,
11023) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlPartialUpdateError>> {
11024    // add a prefix to parameters to efficiently prevent name collisions
11025    let p_path_id = id;
11026    let p_body_patched_user_saml_source_connection_request = patched_user_saml_source_connection_request;
11027
11028    let uri_str = format!(
11029        "{}/sources/user_connections/saml/{id}/",
11030        configuration.base_path,
11031        id = p_path_id
11032    );
11033    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
11034
11035    if let Some(ref user_agent) = configuration.user_agent {
11036        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11037    }
11038    if let Some(ref token) = configuration.bearer_access_token {
11039        req_builder = req_builder.bearer_auth(token.to_owned());
11040    };
11041    req_builder = req_builder.json(&p_body_patched_user_saml_source_connection_request);
11042
11043    let req = req_builder.build()?;
11044    let resp = configuration.client.execute(req).await?;
11045
11046    let status = resp.status();
11047    let content_type = resp
11048        .headers()
11049        .get("content-type")
11050        .and_then(|v| v.to_str().ok())
11051        .unwrap_or("application/octet-stream");
11052    let content_type = super::ContentType::from(content_type);
11053
11054    if !status.is_client_error() && !status.is_server_error() {
11055        let content = resp.text().await?;
11056        match content_type {
11057            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11058            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
11059            ContentType::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`")))),
11060        }
11061    } else {
11062        let content = resp.text().await?;
11063        let entity: Option<SourcesUserConnectionsSamlPartialUpdateError> = serde_json::from_str(&content).ok();
11064        Err(Error::ResponseError(ResponseContent {
11065            status,
11066            content,
11067            entity,
11068        }))
11069    }
11070}
11071
11072/// User-source connection Viewset
11073pub async fn sources_user_connections_saml_retrieve(
11074    configuration: &configuration::Configuration,
11075    id: i32,
11076) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlRetrieveError>> {
11077    // add a prefix to parameters to efficiently prevent name collisions
11078    let p_path_id = id;
11079
11080    let uri_str = format!(
11081        "{}/sources/user_connections/saml/{id}/",
11082        configuration.base_path,
11083        id = p_path_id
11084    );
11085    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11086
11087    if let Some(ref user_agent) = configuration.user_agent {
11088        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11089    }
11090    if let Some(ref token) = configuration.bearer_access_token {
11091        req_builder = req_builder.bearer_auth(token.to_owned());
11092    };
11093
11094    let req = req_builder.build()?;
11095    let resp = configuration.client.execute(req).await?;
11096
11097    let status = resp.status();
11098    let content_type = resp
11099        .headers()
11100        .get("content-type")
11101        .and_then(|v| v.to_str().ok())
11102        .unwrap_or("application/octet-stream");
11103    let content_type = super::ContentType::from(content_type);
11104
11105    if !status.is_client_error() && !status.is_server_error() {
11106        let content = resp.text().await?;
11107        match content_type {
11108            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11109            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
11110            ContentType::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`")))),
11111        }
11112    } else {
11113        let content = resp.text().await?;
11114        let entity: Option<SourcesUserConnectionsSamlRetrieveError> = serde_json::from_str(&content).ok();
11115        Err(Error::ResponseError(ResponseContent {
11116            status,
11117            content,
11118            entity,
11119        }))
11120    }
11121}
11122
11123/// User-source connection Viewset
11124pub async fn sources_user_connections_saml_update(
11125    configuration: &configuration::Configuration,
11126    id: i32,
11127    user_saml_source_connection_request: models::UserSamlSourceConnectionRequest,
11128) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlUpdateError>> {
11129    // add a prefix to parameters to efficiently prevent name collisions
11130    let p_path_id = id;
11131    let p_body_user_saml_source_connection_request = user_saml_source_connection_request;
11132
11133    let uri_str = format!(
11134        "{}/sources/user_connections/saml/{id}/",
11135        configuration.base_path,
11136        id = p_path_id
11137    );
11138    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
11139
11140    if let Some(ref user_agent) = configuration.user_agent {
11141        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11142    }
11143    if let Some(ref token) = configuration.bearer_access_token {
11144        req_builder = req_builder.bearer_auth(token.to_owned());
11145    };
11146    req_builder = req_builder.json(&p_body_user_saml_source_connection_request);
11147
11148    let req = req_builder.build()?;
11149    let resp = configuration.client.execute(req).await?;
11150
11151    let status = resp.status();
11152    let content_type = resp
11153        .headers()
11154        .get("content-type")
11155        .and_then(|v| v.to_str().ok())
11156        .unwrap_or("application/octet-stream");
11157    let content_type = super::ContentType::from(content_type);
11158
11159    if !status.is_client_error() && !status.is_server_error() {
11160        let content = resp.text().await?;
11161        match content_type {
11162            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11163            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
11164            ContentType::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`")))),
11165        }
11166    } else {
11167        let content = resp.text().await?;
11168        let entity: Option<SourcesUserConnectionsSamlUpdateError> = serde_json::from_str(&content).ok();
11169        Err(Error::ResponseError(ResponseContent {
11170            status,
11171            content,
11172            entity,
11173        }))
11174    }
11175}
11176
11177/// Get a list of all objects that use this object
11178pub async fn sources_user_connections_saml_used_by_list(
11179    configuration: &configuration::Configuration,
11180    id: i32,
11181) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsSamlUsedByListError>> {
11182    // add a prefix to parameters to efficiently prevent name collisions
11183    let p_path_id = id;
11184
11185    let uri_str = format!(
11186        "{}/sources/user_connections/saml/{id}/used_by/",
11187        configuration.base_path,
11188        id = p_path_id
11189    );
11190    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11191
11192    if let Some(ref user_agent) = configuration.user_agent {
11193        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11194    }
11195    if let Some(ref token) = configuration.bearer_access_token {
11196        req_builder = req_builder.bearer_auth(token.to_owned());
11197    };
11198
11199    let req = req_builder.build()?;
11200    let resp = configuration.client.execute(req).await?;
11201
11202    let status = resp.status();
11203    let content_type = resp
11204        .headers()
11205        .get("content-type")
11206        .and_then(|v| v.to_str().ok())
11207        .unwrap_or("application/octet-stream");
11208    let content_type = super::ContentType::from(content_type);
11209
11210    if !status.is_client_error() && !status.is_server_error() {
11211        let content = resp.text().await?;
11212        match content_type {
11213            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11214            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;`"))),
11215            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;`")))),
11216        }
11217    } else {
11218        let content = resp.text().await?;
11219        let entity: Option<SourcesUserConnectionsSamlUsedByListError> = serde_json::from_str(&content).ok();
11220        Err(Error::ResponseError(ResponseContent {
11221            status,
11222            content,
11223            entity,
11224        }))
11225    }
11226}
11227
11228/// User-source connection Viewset
11229pub async fn sources_user_connections_telegram_create(
11230    configuration: &configuration::Configuration,
11231    user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest,
11232) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramCreateError>> {
11233    // add a prefix to parameters to efficiently prevent name collisions
11234    let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request;
11235
11236    let uri_str = format!("{}/sources/user_connections/telegram/", configuration.base_path);
11237    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11238
11239    if let Some(ref user_agent) = configuration.user_agent {
11240        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11241    }
11242    if let Some(ref token) = configuration.bearer_access_token {
11243        req_builder = req_builder.bearer_auth(token.to_owned());
11244    };
11245    req_builder = req_builder.json(&p_body_user_telegram_source_connection_request);
11246
11247    let req = req_builder.build()?;
11248    let resp = configuration.client.execute(req).await?;
11249
11250    let status = resp.status();
11251    let content_type = resp
11252        .headers()
11253        .get("content-type")
11254        .and_then(|v| v.to_str().ok())
11255        .unwrap_or("application/octet-stream");
11256    let content_type = super::ContentType::from(content_type);
11257
11258    if !status.is_client_error() && !status.is_server_error() {
11259        let content = resp.text().await?;
11260        match content_type {
11261            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11262            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11263            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11264        }
11265    } else {
11266        let content = resp.text().await?;
11267        let entity: Option<SourcesUserConnectionsTelegramCreateError> = serde_json::from_str(&content).ok();
11268        Err(Error::ResponseError(ResponseContent {
11269            status,
11270            content,
11271            entity,
11272        }))
11273    }
11274}
11275
11276/// User-source connection Viewset
11277pub async fn sources_user_connections_telegram_destroy(
11278    configuration: &configuration::Configuration,
11279    id: i32,
11280) -> Result<(), Error<SourcesUserConnectionsTelegramDestroyError>> {
11281    // add a prefix to parameters to efficiently prevent name collisions
11282    let p_path_id = id;
11283
11284    let uri_str = format!(
11285        "{}/sources/user_connections/telegram/{id}/",
11286        configuration.base_path,
11287        id = p_path_id
11288    );
11289    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
11290
11291    if let Some(ref user_agent) = configuration.user_agent {
11292        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11293    }
11294    if let Some(ref token) = configuration.bearer_access_token {
11295        req_builder = req_builder.bearer_auth(token.to_owned());
11296    };
11297
11298    let req = req_builder.build()?;
11299    let resp = configuration.client.execute(req).await?;
11300
11301    let status = resp.status();
11302
11303    if !status.is_client_error() && !status.is_server_error() {
11304        Ok(())
11305    } else {
11306        let content = resp.text().await?;
11307        let entity: Option<SourcesUserConnectionsTelegramDestroyError> = serde_json::from_str(&content).ok();
11308        Err(Error::ResponseError(ResponseContent {
11309            status,
11310            content,
11311            entity,
11312        }))
11313    }
11314}
11315
11316/// User-source connection Viewset
11317pub async fn sources_user_connections_telegram_list(
11318    configuration: &configuration::Configuration,
11319    ordering: Option<&str>,
11320    page: Option<i32>,
11321    page_size: Option<i32>,
11322    search: Option<&str>,
11323    source__slug: Option<&str>,
11324    user: Option<i32>,
11325) -> Result<models::PaginatedUserTelegramSourceConnectionList, Error<SourcesUserConnectionsTelegramListError>> {
11326    // add a prefix to parameters to efficiently prevent name collisions
11327    let p_query_ordering = ordering;
11328    let p_query_page = page;
11329    let p_query_page_size = page_size;
11330    let p_query_search = search;
11331    let p_query_source__slug = source__slug;
11332    let p_query_user = user;
11333
11334    let uri_str = format!("{}/sources/user_connections/telegram/", configuration.base_path);
11335    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11336
11337    if let Some(ref param_value) = p_query_ordering {
11338        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
11339    }
11340    if let Some(ref param_value) = p_query_page {
11341        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
11342    }
11343    if let Some(ref param_value) = p_query_page_size {
11344        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
11345    }
11346    if let Some(ref param_value) = p_query_search {
11347        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
11348    }
11349    if let Some(ref param_value) = p_query_source__slug {
11350        req_builder = req_builder.query(&[("source__slug", &param_value.to_string())]);
11351    }
11352    if let Some(ref param_value) = p_query_user {
11353        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
11354    }
11355    if let Some(ref user_agent) = configuration.user_agent {
11356        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11357    }
11358    if let Some(ref token) = configuration.bearer_access_token {
11359        req_builder = req_builder.bearer_auth(token.to_owned());
11360    };
11361
11362    let req = req_builder.build()?;
11363    let resp = configuration.client.execute(req).await?;
11364
11365    let status = resp.status();
11366    let content_type = resp
11367        .headers()
11368        .get("content-type")
11369        .and_then(|v| v.to_str().ok())
11370        .unwrap_or("application/octet-stream");
11371    let content_type = super::ContentType::from(content_type);
11372
11373    if !status.is_client_error() && !status.is_server_error() {
11374        let content = resp.text().await?;
11375        match content_type {
11376            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11377            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserTelegramSourceConnectionList`"))),
11378            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserTelegramSourceConnectionList`")))),
11379        }
11380    } else {
11381        let content = resp.text().await?;
11382        let entity: Option<SourcesUserConnectionsTelegramListError> = serde_json::from_str(&content).ok();
11383        Err(Error::ResponseError(ResponseContent {
11384            status,
11385            content,
11386            entity,
11387        }))
11388    }
11389}
11390
11391/// User-source connection Viewset
11392pub async fn sources_user_connections_telegram_partial_update(
11393    configuration: &configuration::Configuration,
11394    id: i32,
11395    patched_user_telegram_source_connection_request: Option<models::PatchedUserTelegramSourceConnectionRequest>,
11396) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramPartialUpdateError>> {
11397    // add a prefix to parameters to efficiently prevent name collisions
11398    let p_path_id = id;
11399    let p_body_patched_user_telegram_source_connection_request = patched_user_telegram_source_connection_request;
11400
11401    let uri_str = format!(
11402        "{}/sources/user_connections/telegram/{id}/",
11403        configuration.base_path,
11404        id = p_path_id
11405    );
11406    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
11407
11408    if let Some(ref user_agent) = configuration.user_agent {
11409        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11410    }
11411    if let Some(ref token) = configuration.bearer_access_token {
11412        req_builder = req_builder.bearer_auth(token.to_owned());
11413    };
11414    req_builder = req_builder.json(&p_body_patched_user_telegram_source_connection_request);
11415
11416    let req = req_builder.build()?;
11417    let resp = configuration.client.execute(req).await?;
11418
11419    let status = resp.status();
11420    let content_type = resp
11421        .headers()
11422        .get("content-type")
11423        .and_then(|v| v.to_str().ok())
11424        .unwrap_or("application/octet-stream");
11425    let content_type = super::ContentType::from(content_type);
11426
11427    if !status.is_client_error() && !status.is_server_error() {
11428        let content = resp.text().await?;
11429        match content_type {
11430            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11431            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11432            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11433        }
11434    } else {
11435        let content = resp.text().await?;
11436        let entity: Option<SourcesUserConnectionsTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
11437        Err(Error::ResponseError(ResponseContent {
11438            status,
11439            content,
11440            entity,
11441        }))
11442    }
11443}
11444
11445/// User-source connection Viewset
11446pub async fn sources_user_connections_telegram_retrieve(
11447    configuration: &configuration::Configuration,
11448    id: i32,
11449) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramRetrieveError>> {
11450    // add a prefix to parameters to efficiently prevent name collisions
11451    let p_path_id = id;
11452
11453    let uri_str = format!(
11454        "{}/sources/user_connections/telegram/{id}/",
11455        configuration.base_path,
11456        id = p_path_id
11457    );
11458    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11459
11460    if let Some(ref user_agent) = configuration.user_agent {
11461        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11462    }
11463    if let Some(ref token) = configuration.bearer_access_token {
11464        req_builder = req_builder.bearer_auth(token.to_owned());
11465    };
11466
11467    let req = req_builder.build()?;
11468    let resp = configuration.client.execute(req).await?;
11469
11470    let status = resp.status();
11471    let content_type = resp
11472        .headers()
11473        .get("content-type")
11474        .and_then(|v| v.to_str().ok())
11475        .unwrap_or("application/octet-stream");
11476    let content_type = super::ContentType::from(content_type);
11477
11478    if !status.is_client_error() && !status.is_server_error() {
11479        let content = resp.text().await?;
11480        match content_type {
11481            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11482            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11483            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11484        }
11485    } else {
11486        let content = resp.text().await?;
11487        let entity: Option<SourcesUserConnectionsTelegramRetrieveError> = serde_json::from_str(&content).ok();
11488        Err(Error::ResponseError(ResponseContent {
11489            status,
11490            content,
11491            entity,
11492        }))
11493    }
11494}
11495
11496/// User-source connection Viewset
11497pub async fn sources_user_connections_telegram_update(
11498    configuration: &configuration::Configuration,
11499    id: i32,
11500    user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest,
11501) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramUpdateError>> {
11502    // add a prefix to parameters to efficiently prevent name collisions
11503    let p_path_id = id;
11504    let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request;
11505
11506    let uri_str = format!(
11507        "{}/sources/user_connections/telegram/{id}/",
11508        configuration.base_path,
11509        id = p_path_id
11510    );
11511    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
11512
11513    if let Some(ref user_agent) = configuration.user_agent {
11514        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11515    }
11516    if let Some(ref token) = configuration.bearer_access_token {
11517        req_builder = req_builder.bearer_auth(token.to_owned());
11518    };
11519    req_builder = req_builder.json(&p_body_user_telegram_source_connection_request);
11520
11521    let req = req_builder.build()?;
11522    let resp = configuration.client.execute(req).await?;
11523
11524    let status = resp.status();
11525    let content_type = resp
11526        .headers()
11527        .get("content-type")
11528        .and_then(|v| v.to_str().ok())
11529        .unwrap_or("application/octet-stream");
11530    let content_type = super::ContentType::from(content_type);
11531
11532    if !status.is_client_error() && !status.is_server_error() {
11533        let content = resp.text().await?;
11534        match content_type {
11535            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11536            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11537            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11538        }
11539    } else {
11540        let content = resp.text().await?;
11541        let entity: Option<SourcesUserConnectionsTelegramUpdateError> = serde_json::from_str(&content).ok();
11542        Err(Error::ResponseError(ResponseContent {
11543            status,
11544            content,
11545            entity,
11546        }))
11547    }
11548}
11549
11550/// Get a list of all objects that use this object
11551pub async fn sources_user_connections_telegram_used_by_list(
11552    configuration: &configuration::Configuration,
11553    id: i32,
11554) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsTelegramUsedByListError>> {
11555    // add a prefix to parameters to efficiently prevent name collisions
11556    let p_path_id = id;
11557
11558    let uri_str = format!(
11559        "{}/sources/user_connections/telegram/{id}/used_by/",
11560        configuration.base_path,
11561        id = p_path_id
11562    );
11563    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11564
11565    if let Some(ref user_agent) = configuration.user_agent {
11566        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11567    }
11568    if let Some(ref token) = configuration.bearer_access_token {
11569        req_builder = req_builder.bearer_auth(token.to_owned());
11570    };
11571
11572    let req = req_builder.build()?;
11573    let resp = configuration.client.execute(req).await?;
11574
11575    let status = resp.status();
11576    let content_type = resp
11577        .headers()
11578        .get("content-type")
11579        .and_then(|v| v.to_str().ok())
11580        .unwrap_or("application/octet-stream");
11581    let content_type = super::ContentType::from(content_type);
11582
11583    if !status.is_client_error() && !status.is_server_error() {
11584        let content = resp.text().await?;
11585        match content_type {
11586            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11587            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;`"))),
11588            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;`")))),
11589        }
11590    } else {
11591        let content = resp.text().await?;
11592        let entity: Option<SourcesUserConnectionsTelegramUsedByListError> = serde_json::from_str(&content).ok();
11593        Err(Error::ResponseError(ResponseContent {
11594            status,
11595            content,
11596            entity,
11597        }))
11598    }
11599}