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