1use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, 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 SourcesAllTypesListError {
47 Status400(models::ValidationError),
48 Status403(models::GenericError),
49 UnknownValue(serde_json::Value),
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum SourcesAllUsedByListError {
56 Status400(models::ValidationError),
57 Status403(models::GenericError),
58 UnknownValue(serde_json::Value),
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum SourcesAllUserSettingsListError {
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 SourcesGroupConnectionsAllDestroyError {
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 SourcesGroupConnectionsAllListError {
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 SourcesGroupConnectionsAllPartialUpdateError {
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 SourcesGroupConnectionsAllRetrieveError {
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 SourcesGroupConnectionsAllUpdateError {
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 SourcesGroupConnectionsAllUsedByListError {
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 SourcesGroupConnectionsKerberosCreateError {
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 SourcesGroupConnectionsKerberosDestroyError {
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 SourcesGroupConnectionsKerberosListError {
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 SourcesGroupConnectionsKerberosPartialUpdateError {
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 SourcesGroupConnectionsKerberosRetrieveError {
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 SourcesGroupConnectionsKerberosUpdateError {
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 SourcesGroupConnectionsKerberosUsedByListError {
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 SourcesGroupConnectionsLdapCreateError {
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 SourcesGroupConnectionsLdapDestroyError {
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 SourcesGroupConnectionsLdapListError {
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 SourcesGroupConnectionsLdapPartialUpdateError {
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 SourcesGroupConnectionsLdapRetrieveError {
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 SourcesGroupConnectionsLdapUpdateError {
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 SourcesGroupConnectionsLdapUsedByListError {
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 SourcesGroupConnectionsOauthCreateError {
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 SourcesGroupConnectionsOauthDestroyError {
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 SourcesGroupConnectionsOauthListError {
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 SourcesGroupConnectionsOauthPartialUpdateError {
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 SourcesGroupConnectionsOauthRetrieveError {
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 SourcesGroupConnectionsOauthUpdateError {
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 SourcesGroupConnectionsOauthUsedByListError {
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 SourcesGroupConnectionsPlexCreateError {
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 SourcesGroupConnectionsPlexDestroyError {
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 SourcesGroupConnectionsPlexListError {
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 SourcesGroupConnectionsPlexPartialUpdateError {
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 SourcesGroupConnectionsPlexRetrieveError {
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 SourcesGroupConnectionsPlexUpdateError {
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 SourcesGroupConnectionsPlexUsedByListError {
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 SourcesGroupConnectionsSamlCreateError {
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 SourcesGroupConnectionsSamlDestroyError {
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 SourcesGroupConnectionsSamlListError {
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 SourcesGroupConnectionsSamlPartialUpdateError {
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 SourcesGroupConnectionsSamlRetrieveError {
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 SourcesGroupConnectionsSamlUpdateError {
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 SourcesGroupConnectionsSamlUsedByListError {
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 SourcesGroupConnectionsTelegramCreateError {
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 SourcesGroupConnectionsTelegramDestroyError {
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 SourcesGroupConnectionsTelegramListError {
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 SourcesGroupConnectionsTelegramPartialUpdateError {
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 SourcesGroupConnectionsTelegramRetrieveError {
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 SourcesGroupConnectionsTelegramUpdateError {
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 SourcesGroupConnectionsTelegramUsedByListError {
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 SourcesKerberosCreateError {
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 SourcesKerberosDestroyError {
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 SourcesKerberosListError {
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 SourcesKerberosPartialUpdateError {
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 SourcesKerberosRetrieveError {
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 SourcesKerberosSyncStatusRetrieveError {
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 SourcesKerberosUpdateError {
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 SourcesKerberosUsedByListError {
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 SourcesLdapCreateError {
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 SourcesLdapDebugRetrieveError {
587 Status400(models::ValidationError),
588 Status403(models::GenericError),
589 UnknownValue(serde_json::Value),
590}
591
592#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum SourcesLdapDestroyError {
596 Status400(models::ValidationError),
597 Status403(models::GenericError),
598 UnknownValue(serde_json::Value),
599}
600
601#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum SourcesLdapListError {
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 SourcesLdapPartialUpdateError {
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 SourcesLdapRetrieveError {
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 SourcesLdapSyncStatusRetrieveError {
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 SourcesLdapUpdateError {
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 SourcesLdapUsedByListError {
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 SourcesOauthCreateError {
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 SourcesOauthDestroyError {
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 SourcesOauthListError {
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 SourcesOauthPartialUpdateError {
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 SourcesOauthRetrieveError {
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 SourcesOauthSourceTypesListError {
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 SourcesOauthUpdateError {
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 SourcesOauthUsedByListError {
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 SourcesPlexCreateError {
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 SourcesPlexDestroyError {
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 SourcesPlexListError {
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 SourcesPlexPartialUpdateError {
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 SourcesPlexRedeemTokenAuthenticatedCreateError {
767 Status400(),
768 Status403(),
769 UnknownValue(serde_json::Value),
770}
771
772#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum SourcesPlexRedeemTokenCreateError {
776 Status400(),
777 Status403(),
778 UnknownValue(serde_json::Value),
779}
780
781#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum SourcesPlexRetrieveError {
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 SourcesPlexUpdateError {
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 SourcesPlexUsedByListError {
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 SourcesSamlCreateError {
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 SourcesSamlDestroyError {
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 SourcesSamlListError {
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 SourcesSamlMetadataRetrieveError {
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 SourcesSamlPartialUpdateError {
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 SourcesSamlRetrieveError {
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 SourcesSamlUpdateError {
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 SourcesSamlUsedByListError {
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 SourcesScimCreateError {
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 SourcesScimDestroyError {
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 SourcesScimGroupsCreateError {
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 SourcesScimGroupsDestroyError {
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 SourcesScimGroupsListError {
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 SourcesScimGroupsPartialUpdateError {
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 SourcesScimGroupsRetrieveError {
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 SourcesScimGroupsUpdateError {
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 SourcesScimGroupsUsedByListError {
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 SourcesScimListError {
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 SourcesScimPartialUpdateError {
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 SourcesScimRetrieveError {
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 SourcesScimUpdateError {
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 SourcesScimUsedByListError {
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 SourcesScimUsersCreateError {
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 SourcesScimUsersDestroyError {
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 SourcesScimUsersListError {
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 SourcesScimUsersPartialUpdateError {
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 SourcesScimUsersRetrieveError {
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 SourcesScimUsersUpdateError {
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 SourcesScimUsersUsedByListError {
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 SourcesTelegramConnectUserCreateError {
1073 Status403(),
1074 Status400(models::ValidationError),
1075 UnknownValue(serde_json::Value),
1076}
1077
1078#[derive(Debug, Clone, Serialize, Deserialize)]
1080#[serde(untagged)]
1081pub enum SourcesTelegramCreateError {
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 SourcesTelegramDestroyError {
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 SourcesTelegramListError {
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 SourcesTelegramPartialUpdateError {
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 SourcesTelegramRetrieveError {
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 SourcesTelegramUpdateError {
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 SourcesTelegramUsedByListError {
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 SourcesUserConnectionsAllDestroyError {
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 SourcesUserConnectionsAllListError {
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 SourcesUserConnectionsAllPartialUpdateError {
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 SourcesUserConnectionsAllRetrieveError {
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 SourcesUserConnectionsAllUpdateError {
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 SourcesUserConnectionsAllUsedByListError {
1190 Status400(models::ValidationError),
1191 Status403(models::GenericError),
1192 UnknownValue(serde_json::Value),
1193}
1194
1195#[derive(Debug, Clone, Serialize, Deserialize)]
1197#[serde(untagged)]
1198pub enum SourcesUserConnectionsKerberosCreateError {
1199 Status400(models::ValidationError),
1200 Status403(models::GenericError),
1201 UnknownValue(serde_json::Value),
1202}
1203
1204#[derive(Debug, Clone, Serialize, Deserialize)]
1206#[serde(untagged)]
1207pub enum SourcesUserConnectionsKerberosDestroyError {
1208 Status400(models::ValidationError),
1209 Status403(models::GenericError),
1210 UnknownValue(serde_json::Value),
1211}
1212
1213#[derive(Debug, Clone, Serialize, Deserialize)]
1215#[serde(untagged)]
1216pub enum SourcesUserConnectionsKerberosListError {
1217 Status400(models::ValidationError),
1218 Status403(models::GenericError),
1219 UnknownValue(serde_json::Value),
1220}
1221
1222#[derive(Debug, Clone, Serialize, Deserialize)]
1224#[serde(untagged)]
1225pub enum SourcesUserConnectionsKerberosPartialUpdateError {
1226 Status400(models::ValidationError),
1227 Status403(models::GenericError),
1228 UnknownValue(serde_json::Value),
1229}
1230
1231#[derive(Debug, Clone, Serialize, Deserialize)]
1233#[serde(untagged)]
1234pub enum SourcesUserConnectionsKerberosRetrieveError {
1235 Status400(models::ValidationError),
1236 Status403(models::GenericError),
1237 UnknownValue(serde_json::Value),
1238}
1239
1240#[derive(Debug, Clone, Serialize, Deserialize)]
1242#[serde(untagged)]
1243pub enum SourcesUserConnectionsKerberosUpdateError {
1244 Status400(models::ValidationError),
1245 Status403(models::GenericError),
1246 UnknownValue(serde_json::Value),
1247}
1248
1249#[derive(Debug, Clone, Serialize, Deserialize)]
1251#[serde(untagged)]
1252pub enum SourcesUserConnectionsKerberosUsedByListError {
1253 Status400(models::ValidationError),
1254 Status403(models::GenericError),
1255 UnknownValue(serde_json::Value),
1256}
1257
1258#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum SourcesUserConnectionsLdapCreateError {
1262 Status400(models::ValidationError),
1263 Status403(models::GenericError),
1264 UnknownValue(serde_json::Value),
1265}
1266
1267#[derive(Debug, Clone, Serialize, Deserialize)]
1269#[serde(untagged)]
1270pub enum SourcesUserConnectionsLdapDestroyError {
1271 Status400(models::ValidationError),
1272 Status403(models::GenericError),
1273 UnknownValue(serde_json::Value),
1274}
1275
1276#[derive(Debug, Clone, Serialize, Deserialize)]
1278#[serde(untagged)]
1279pub enum SourcesUserConnectionsLdapListError {
1280 Status400(models::ValidationError),
1281 Status403(models::GenericError),
1282 UnknownValue(serde_json::Value),
1283}
1284
1285#[derive(Debug, Clone, Serialize, Deserialize)]
1287#[serde(untagged)]
1288pub enum SourcesUserConnectionsLdapPartialUpdateError {
1289 Status400(models::ValidationError),
1290 Status403(models::GenericError),
1291 UnknownValue(serde_json::Value),
1292}
1293
1294#[derive(Debug, Clone, Serialize, Deserialize)]
1296#[serde(untagged)]
1297pub enum SourcesUserConnectionsLdapRetrieveError {
1298 Status400(models::ValidationError),
1299 Status403(models::GenericError),
1300 UnknownValue(serde_json::Value),
1301}
1302
1303#[derive(Debug, Clone, Serialize, Deserialize)]
1305#[serde(untagged)]
1306pub enum SourcesUserConnectionsLdapUpdateError {
1307 Status400(models::ValidationError),
1308 Status403(models::GenericError),
1309 UnknownValue(serde_json::Value),
1310}
1311
1312#[derive(Debug, Clone, Serialize, Deserialize)]
1314#[serde(untagged)]
1315pub enum SourcesUserConnectionsLdapUsedByListError {
1316 Status400(models::ValidationError),
1317 Status403(models::GenericError),
1318 UnknownValue(serde_json::Value),
1319}
1320
1321#[derive(Debug, Clone, Serialize, Deserialize)]
1323#[serde(untagged)]
1324pub enum SourcesUserConnectionsOauthCreateError {
1325 Status400(models::ValidationError),
1326 Status403(models::GenericError),
1327 UnknownValue(serde_json::Value),
1328}
1329
1330#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum SourcesUserConnectionsOauthDestroyError {
1334 Status400(models::ValidationError),
1335 Status403(models::GenericError),
1336 UnknownValue(serde_json::Value),
1337}
1338
1339#[derive(Debug, Clone, Serialize, Deserialize)]
1341#[serde(untagged)]
1342pub enum SourcesUserConnectionsOauthListError {
1343 Status400(models::ValidationError),
1344 Status403(models::GenericError),
1345 UnknownValue(serde_json::Value),
1346}
1347
1348#[derive(Debug, Clone, Serialize, Deserialize)]
1350#[serde(untagged)]
1351pub enum SourcesUserConnectionsOauthPartialUpdateError {
1352 Status400(models::ValidationError),
1353 Status403(models::GenericError),
1354 UnknownValue(serde_json::Value),
1355}
1356
1357#[derive(Debug, Clone, Serialize, Deserialize)]
1359#[serde(untagged)]
1360pub enum SourcesUserConnectionsOauthRetrieveError {
1361 Status400(models::ValidationError),
1362 Status403(models::GenericError),
1363 UnknownValue(serde_json::Value),
1364}
1365
1366#[derive(Debug, Clone, Serialize, Deserialize)]
1368#[serde(untagged)]
1369pub enum SourcesUserConnectionsOauthUpdateError {
1370 Status400(models::ValidationError),
1371 Status403(models::GenericError),
1372 UnknownValue(serde_json::Value),
1373}
1374
1375#[derive(Debug, Clone, Serialize, Deserialize)]
1377#[serde(untagged)]
1378pub enum SourcesUserConnectionsOauthUsedByListError {
1379 Status400(models::ValidationError),
1380 Status403(models::GenericError),
1381 UnknownValue(serde_json::Value),
1382}
1383
1384#[derive(Debug, Clone, Serialize, Deserialize)]
1386#[serde(untagged)]
1387pub enum SourcesUserConnectionsPlexCreateError {
1388 Status400(models::ValidationError),
1389 Status403(models::GenericError),
1390 UnknownValue(serde_json::Value),
1391}
1392
1393#[derive(Debug, Clone, Serialize, Deserialize)]
1395#[serde(untagged)]
1396pub enum SourcesUserConnectionsPlexDestroyError {
1397 Status400(models::ValidationError),
1398 Status403(models::GenericError),
1399 UnknownValue(serde_json::Value),
1400}
1401
1402#[derive(Debug, Clone, Serialize, Deserialize)]
1404#[serde(untagged)]
1405pub enum SourcesUserConnectionsPlexListError {
1406 Status400(models::ValidationError),
1407 Status403(models::GenericError),
1408 UnknownValue(serde_json::Value),
1409}
1410
1411#[derive(Debug, Clone, Serialize, Deserialize)]
1413#[serde(untagged)]
1414pub enum SourcesUserConnectionsPlexPartialUpdateError {
1415 Status400(models::ValidationError),
1416 Status403(models::GenericError),
1417 UnknownValue(serde_json::Value),
1418}
1419
1420#[derive(Debug, Clone, Serialize, Deserialize)]
1422#[serde(untagged)]
1423pub enum SourcesUserConnectionsPlexRetrieveError {
1424 Status400(models::ValidationError),
1425 Status403(models::GenericError),
1426 UnknownValue(serde_json::Value),
1427}
1428
1429#[derive(Debug, Clone, Serialize, Deserialize)]
1431#[serde(untagged)]
1432pub enum SourcesUserConnectionsPlexUpdateError {
1433 Status400(models::ValidationError),
1434 Status403(models::GenericError),
1435 UnknownValue(serde_json::Value),
1436}
1437
1438#[derive(Debug, Clone, Serialize, Deserialize)]
1440#[serde(untagged)]
1441pub enum SourcesUserConnectionsPlexUsedByListError {
1442 Status400(models::ValidationError),
1443 Status403(models::GenericError),
1444 UnknownValue(serde_json::Value),
1445}
1446
1447#[derive(Debug, Clone, Serialize, Deserialize)]
1449#[serde(untagged)]
1450pub enum SourcesUserConnectionsSamlCreateError {
1451 Status400(models::ValidationError),
1452 Status403(models::GenericError),
1453 UnknownValue(serde_json::Value),
1454}
1455
1456#[derive(Debug, Clone, Serialize, Deserialize)]
1458#[serde(untagged)]
1459pub enum SourcesUserConnectionsSamlDestroyError {
1460 Status400(models::ValidationError),
1461 Status403(models::GenericError),
1462 UnknownValue(serde_json::Value),
1463}
1464
1465#[derive(Debug, Clone, Serialize, Deserialize)]
1467#[serde(untagged)]
1468pub enum SourcesUserConnectionsSamlListError {
1469 Status400(models::ValidationError),
1470 Status403(models::GenericError),
1471 UnknownValue(serde_json::Value),
1472}
1473
1474#[derive(Debug, Clone, Serialize, Deserialize)]
1476#[serde(untagged)]
1477pub enum SourcesUserConnectionsSamlPartialUpdateError {
1478 Status400(models::ValidationError),
1479 Status403(models::GenericError),
1480 UnknownValue(serde_json::Value),
1481}
1482
1483#[derive(Debug, Clone, Serialize, Deserialize)]
1485#[serde(untagged)]
1486pub enum SourcesUserConnectionsSamlRetrieveError {
1487 Status400(models::ValidationError),
1488 Status403(models::GenericError),
1489 UnknownValue(serde_json::Value),
1490}
1491
1492#[derive(Debug, Clone, Serialize, Deserialize)]
1494#[serde(untagged)]
1495pub enum SourcesUserConnectionsSamlUpdateError {
1496 Status400(models::ValidationError),
1497 Status403(models::GenericError),
1498 UnknownValue(serde_json::Value),
1499}
1500
1501#[derive(Debug, Clone, Serialize, Deserialize)]
1503#[serde(untagged)]
1504pub enum SourcesUserConnectionsSamlUsedByListError {
1505 Status400(models::ValidationError),
1506 Status403(models::GenericError),
1507 UnknownValue(serde_json::Value),
1508}
1509
1510#[derive(Debug, Clone, Serialize, Deserialize)]
1512#[serde(untagged)]
1513pub enum SourcesUserConnectionsTelegramCreateError {
1514 Status400(models::ValidationError),
1515 Status403(models::GenericError),
1516 UnknownValue(serde_json::Value),
1517}
1518
1519#[derive(Debug, Clone, Serialize, Deserialize)]
1521#[serde(untagged)]
1522pub enum SourcesUserConnectionsTelegramDestroyError {
1523 Status400(models::ValidationError),
1524 Status403(models::GenericError),
1525 UnknownValue(serde_json::Value),
1526}
1527
1528#[derive(Debug, Clone, Serialize, Deserialize)]
1530#[serde(untagged)]
1531pub enum SourcesUserConnectionsTelegramListError {
1532 Status400(models::ValidationError),
1533 Status403(models::GenericError),
1534 UnknownValue(serde_json::Value),
1535}
1536
1537#[derive(Debug, Clone, Serialize, Deserialize)]
1539#[serde(untagged)]
1540pub enum SourcesUserConnectionsTelegramPartialUpdateError {
1541 Status400(models::ValidationError),
1542 Status403(models::GenericError),
1543 UnknownValue(serde_json::Value),
1544}
1545
1546#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(untagged)]
1549pub enum SourcesUserConnectionsTelegramRetrieveError {
1550 Status400(models::ValidationError),
1551 Status403(models::GenericError),
1552 UnknownValue(serde_json::Value),
1553}
1554
1555#[derive(Debug, Clone, Serialize, Deserialize)]
1557#[serde(untagged)]
1558pub enum SourcesUserConnectionsTelegramUpdateError {
1559 Status400(models::ValidationError),
1560 Status403(models::GenericError),
1561 UnknownValue(serde_json::Value),
1562}
1563
1564#[derive(Debug, Clone, Serialize, Deserialize)]
1566#[serde(untagged)]
1567pub enum SourcesUserConnectionsTelegramUsedByListError {
1568 Status400(models::ValidationError),
1569 Status403(models::GenericError),
1570 UnknownValue(serde_json::Value),
1571}
1572
1573pub async fn sources_all_destroy(
1575 configuration: &configuration::Configuration,
1576 slug: &str,
1577) -> Result<(), Error<SourcesAllDestroyError>> {
1578 let p_path_slug = slug;
1580
1581 let uri_str = format!(
1582 "{}/sources/all/{slug}/",
1583 configuration.base_path,
1584 slug = crate::apis::urlencode(p_path_slug)
1585 );
1586 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1587
1588 if let Some(ref user_agent) = configuration.user_agent {
1589 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1590 }
1591 if let Some(ref token) = configuration.bearer_access_token {
1592 req_builder = req_builder.bearer_auth(token.to_owned());
1593 };
1594
1595 let req = req_builder.build()?;
1596 let resp = configuration.client.execute(req).await?;
1597
1598 let status = resp.status();
1599
1600 if !status.is_client_error() && !status.is_server_error() {
1601 Ok(())
1602 } else {
1603 let content = resp.text().await?;
1604 let entity: Option<SourcesAllDestroyError> = serde_json::from_str(&content).ok();
1605 Err(Error::ResponseError(ResponseContent {
1606 status,
1607 content,
1608 entity,
1609 }))
1610 }
1611}
1612
1613pub async fn sources_all_list(
1615 configuration: &configuration::Configuration,
1616 managed: Option<&str>,
1617 name: Option<&str>,
1618 ordering: Option<&str>,
1619 page: Option<i32>,
1620 page_size: Option<i32>,
1621 pbm_uuid: Option<&str>,
1622 search: Option<&str>,
1623 slug: Option<&str>,
1624) -> Result<models::PaginatedSourceList, Error<SourcesAllListError>> {
1625 let p_query_managed = managed;
1627 let p_query_name = name;
1628 let p_query_ordering = ordering;
1629 let p_query_page = page;
1630 let p_query_page_size = page_size;
1631 let p_query_pbm_uuid = pbm_uuid;
1632 let p_query_search = search;
1633 let p_query_slug = slug;
1634
1635 let uri_str = format!("{}/sources/all/", configuration.base_path);
1636 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1637
1638 if let Some(ref param_value) = p_query_managed {
1639 req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]);
1640 }
1641 if let Some(ref param_value) = p_query_name {
1642 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1643 }
1644 if let Some(ref param_value) = p_query_ordering {
1645 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1646 }
1647 if let Some(ref param_value) = p_query_page {
1648 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1649 }
1650 if let Some(ref param_value) = p_query_page_size {
1651 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1652 }
1653 if let Some(ref param_value) = p_query_pbm_uuid {
1654 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
1655 }
1656 if let Some(ref param_value) = p_query_search {
1657 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1658 }
1659 if let Some(ref param_value) = p_query_slug {
1660 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
1661 }
1662 if let Some(ref user_agent) = configuration.user_agent {
1663 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1664 }
1665 if let Some(ref token) = configuration.bearer_access_token {
1666 req_builder = req_builder.bearer_auth(token.to_owned());
1667 };
1668
1669 let req = req_builder.build()?;
1670 let resp = configuration.client.execute(req).await?;
1671
1672 let status = resp.status();
1673 let content_type = resp
1674 .headers()
1675 .get("content-type")
1676 .and_then(|v| v.to_str().ok())
1677 .unwrap_or("application/octet-stream");
1678 let content_type = super::ContentType::from(content_type);
1679
1680 if !status.is_client_error() && !status.is_server_error() {
1681 let content = resp.text().await?;
1682 match content_type {
1683 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1684 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSourceList`"))),
1685 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSourceList`")))),
1686 }
1687 } else {
1688 let content = resp.text().await?;
1689 let entity: Option<SourcesAllListError> = serde_json::from_str(&content).ok();
1690 Err(Error::ResponseError(ResponseContent {
1691 status,
1692 content,
1693 entity,
1694 }))
1695 }
1696}
1697
1698pub async fn sources_all_retrieve(
1700 configuration: &configuration::Configuration,
1701 slug: &str,
1702) -> Result<models::Source, Error<SourcesAllRetrieveError>> {
1703 let p_path_slug = slug;
1705
1706 let uri_str = format!(
1707 "{}/sources/all/{slug}/",
1708 configuration.base_path,
1709 slug = crate::apis::urlencode(p_path_slug)
1710 );
1711 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1712
1713 if let Some(ref user_agent) = configuration.user_agent {
1714 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1715 }
1716 if let Some(ref token) = configuration.bearer_access_token {
1717 req_builder = req_builder.bearer_auth(token.to_owned());
1718 };
1719
1720 let req = req_builder.build()?;
1721 let resp = configuration.client.execute(req).await?;
1722
1723 let status = resp.status();
1724 let content_type = resp
1725 .headers()
1726 .get("content-type")
1727 .and_then(|v| v.to_str().ok())
1728 .unwrap_or("application/octet-stream");
1729 let content_type = super::ContentType::from(content_type);
1730
1731 if !status.is_client_error() && !status.is_server_error() {
1732 let content = resp.text().await?;
1733 match content_type {
1734 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1735 ContentType::Text => {
1736 return Err(Error::from(serde_json::Error::custom(
1737 "Received `text/plain` content type response that cannot be converted to `models::Source`",
1738 )))
1739 }
1740 ContentType::Unsupported(unknown_type) => {
1741 return Err(Error::from(serde_json::Error::custom(format!(
1742 "Received `{unknown_type}` content type response that cannot be converted to `models::Source`"
1743 ))))
1744 }
1745 }
1746 } else {
1747 let content = resp.text().await?;
1748 let entity: Option<SourcesAllRetrieveError> = serde_json::from_str(&content).ok();
1749 Err(Error::ResponseError(ResponseContent {
1750 status,
1751 content,
1752 entity,
1753 }))
1754 }
1755}
1756
1757pub async fn sources_all_types_list(
1759 configuration: &configuration::Configuration,
1760) -> Result<Vec<models::TypeCreate>, Error<SourcesAllTypesListError>> {
1761 let uri_str = format!("{}/sources/all/types/", configuration.base_path);
1762 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1763
1764 if let Some(ref user_agent) = configuration.user_agent {
1765 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1766 }
1767 if let Some(ref token) = configuration.bearer_access_token {
1768 req_builder = req_builder.bearer_auth(token.to_owned());
1769 };
1770
1771 let req = req_builder.build()?;
1772 let resp = configuration.client.execute(req).await?;
1773
1774 let status = resp.status();
1775 let content_type = resp
1776 .headers()
1777 .get("content-type")
1778 .and_then(|v| v.to_str().ok())
1779 .unwrap_or("application/octet-stream");
1780 let content_type = super::ContentType::from(content_type);
1781
1782 if !status.is_client_error() && !status.is_server_error() {
1783 let content = resp.text().await?;
1784 match content_type {
1785 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1786 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TypeCreate>`"))),
1787 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TypeCreate>`")))),
1788 }
1789 } else {
1790 let content = resp.text().await?;
1791 let entity: Option<SourcesAllTypesListError> = serde_json::from_str(&content).ok();
1792 Err(Error::ResponseError(ResponseContent {
1793 status,
1794 content,
1795 entity,
1796 }))
1797 }
1798}
1799
1800pub async fn sources_all_used_by_list(
1802 configuration: &configuration::Configuration,
1803 slug: &str,
1804) -> Result<Vec<models::UsedBy>, Error<SourcesAllUsedByListError>> {
1805 let p_path_slug = slug;
1807
1808 let uri_str = format!(
1809 "{}/sources/all/{slug}/used_by/",
1810 configuration.base_path,
1811 slug = crate::apis::urlencode(p_path_slug)
1812 );
1813 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1814
1815 if let Some(ref user_agent) = configuration.user_agent {
1816 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1817 }
1818 if let Some(ref token) = configuration.bearer_access_token {
1819 req_builder = req_builder.bearer_auth(token.to_owned());
1820 };
1821
1822 let req = req_builder.build()?;
1823 let resp = configuration.client.execute(req).await?;
1824
1825 let status = resp.status();
1826 let content_type = resp
1827 .headers()
1828 .get("content-type")
1829 .and_then(|v| v.to_str().ok())
1830 .unwrap_or("application/octet-stream");
1831 let content_type = super::ContentType::from(content_type);
1832
1833 if !status.is_client_error() && !status.is_server_error() {
1834 let content = resp.text().await?;
1835 match content_type {
1836 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1837 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
1838 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
1839 }
1840 } else {
1841 let content = resp.text().await?;
1842 let entity: Option<SourcesAllUsedByListError> = serde_json::from_str(&content).ok();
1843 Err(Error::ResponseError(ResponseContent {
1844 status,
1845 content,
1846 entity,
1847 }))
1848 }
1849}
1850
1851pub async fn sources_all_user_settings_list(
1853 configuration: &configuration::Configuration,
1854) -> Result<Vec<models::UserSetting>, Error<SourcesAllUserSettingsListError>> {
1855 let uri_str = format!("{}/sources/all/user_settings/", configuration.base_path);
1856 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1857
1858 if let Some(ref user_agent) = configuration.user_agent {
1859 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1860 }
1861 if let Some(ref token) = configuration.bearer_access_token {
1862 req_builder = req_builder.bearer_auth(token.to_owned());
1863 };
1864
1865 let req = req_builder.build()?;
1866 let resp = configuration.client.execute(req).await?;
1867
1868 let status = resp.status();
1869 let content_type = resp
1870 .headers()
1871 .get("content-type")
1872 .and_then(|v| v.to_str().ok())
1873 .unwrap_or("application/octet-stream");
1874 let content_type = super::ContentType::from(content_type);
1875
1876 if !status.is_client_error() && !status.is_server_error() {
1877 let content = resp.text().await?;
1878 match content_type {
1879 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1880 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserSetting>`"))),
1881 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UserSetting>`")))),
1882 }
1883 } else {
1884 let content = resp.text().await?;
1885 let entity: Option<SourcesAllUserSettingsListError> = serde_json::from_str(&content).ok();
1886 Err(Error::ResponseError(ResponseContent {
1887 status,
1888 content,
1889 entity,
1890 }))
1891 }
1892}
1893
1894pub async fn sources_group_connections_all_destroy(
1896 configuration: &configuration::Configuration,
1897 id: i32,
1898) -> Result<(), Error<SourcesGroupConnectionsAllDestroyError>> {
1899 let p_path_id = id;
1901
1902 let uri_str = format!(
1903 "{}/sources/group_connections/all/{id}/",
1904 configuration.base_path,
1905 id = p_path_id
1906 );
1907 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1908
1909 if let Some(ref user_agent) = configuration.user_agent {
1910 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1911 }
1912 if let Some(ref token) = configuration.bearer_access_token {
1913 req_builder = req_builder.bearer_auth(token.to_owned());
1914 };
1915
1916 let req = req_builder.build()?;
1917 let resp = configuration.client.execute(req).await?;
1918
1919 let status = resp.status();
1920
1921 if !status.is_client_error() && !status.is_server_error() {
1922 Ok(())
1923 } else {
1924 let content = resp.text().await?;
1925 let entity: Option<SourcesGroupConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
1926 Err(Error::ResponseError(ResponseContent {
1927 status,
1928 content,
1929 entity,
1930 }))
1931 }
1932}
1933
1934pub async fn sources_group_connections_all_list(
1936 configuration: &configuration::Configuration,
1937 group: Option<&str>,
1938 ordering: Option<&str>,
1939 page: Option<i32>,
1940 page_size: Option<i32>,
1941 search: Option<&str>,
1942 source__slug: Option<&str>,
1943) -> Result<models::PaginatedGroupSourceConnectionList, Error<SourcesGroupConnectionsAllListError>> {
1944 let p_query_group = group;
1946 let p_query_ordering = ordering;
1947 let p_query_page = page;
1948 let p_query_page_size = page_size;
1949 let p_query_search = search;
1950 let p_query_source__slug = source__slug;
1951
1952 let uri_str = format!("{}/sources/group_connections/all/", configuration.base_path);
1953 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1954
1955 if let Some(ref param_value) = p_query_group {
1956 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
1957 }
1958 if let Some(ref param_value) = p_query_ordering {
1959 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1960 }
1961 if let Some(ref param_value) = p_query_page {
1962 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1963 }
1964 if let Some(ref param_value) = p_query_page_size {
1965 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1966 }
1967 if let Some(ref param_value) = p_query_search {
1968 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1969 }
1970 if let Some(ref param_value) = p_query_source__slug {
1971 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
1972 }
1973 if let Some(ref user_agent) = configuration.user_agent {
1974 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1975 }
1976 if let Some(ref token) = configuration.bearer_access_token {
1977 req_builder = req_builder.bearer_auth(token.to_owned());
1978 };
1979
1980 let req = req_builder.build()?;
1981 let resp = configuration.client.execute(req).await?;
1982
1983 let status = resp.status();
1984 let content_type = resp
1985 .headers()
1986 .get("content-type")
1987 .and_then(|v| v.to_str().ok())
1988 .unwrap_or("application/octet-stream");
1989 let content_type = super::ContentType::from(content_type);
1990
1991 if !status.is_client_error() && !status.is_server_error() {
1992 let content = resp.text().await?;
1993 match content_type {
1994 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1995 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupSourceConnectionList`"))),
1996 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupSourceConnectionList`")))),
1997 }
1998 } else {
1999 let content = resp.text().await?;
2000 let entity: Option<SourcesGroupConnectionsAllListError> = serde_json::from_str(&content).ok();
2001 Err(Error::ResponseError(ResponseContent {
2002 status,
2003 content,
2004 entity,
2005 }))
2006 }
2007}
2008
2009pub async fn sources_group_connections_all_partial_update(
2011 configuration: &configuration::Configuration,
2012 id: i32,
2013 patched_group_source_connection_request: Option<models::PatchedGroupSourceConnectionRequest>,
2014) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllPartialUpdateError>> {
2015 let p_path_id = id;
2017 let p_body_patched_group_source_connection_request = patched_group_source_connection_request;
2018
2019 let uri_str = format!(
2020 "{}/sources/group_connections/all/{id}/",
2021 configuration.base_path,
2022 id = p_path_id
2023 );
2024 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2025
2026 if let Some(ref user_agent) = configuration.user_agent {
2027 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2028 }
2029 if let Some(ref token) = configuration.bearer_access_token {
2030 req_builder = req_builder.bearer_auth(token.to_owned());
2031 };
2032 req_builder = req_builder.json(&p_body_patched_group_source_connection_request);
2033
2034 let req = req_builder.build()?;
2035 let resp = configuration.client.execute(req).await?;
2036
2037 let status = resp.status();
2038 let content_type = resp
2039 .headers()
2040 .get("content-type")
2041 .and_then(|v| v.to_str().ok())
2042 .unwrap_or("application/octet-stream");
2043 let content_type = super::ContentType::from(content_type);
2044
2045 if !status.is_client_error() && !status.is_server_error() {
2046 let content = resp.text().await?;
2047 match content_type {
2048 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2049 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2050 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSourceConnection`")))),
2051 }
2052 } else {
2053 let content = resp.text().await?;
2054 let entity: Option<SourcesGroupConnectionsAllPartialUpdateError> = serde_json::from_str(&content).ok();
2055 Err(Error::ResponseError(ResponseContent {
2056 status,
2057 content,
2058 entity,
2059 }))
2060 }
2061}
2062
2063pub async fn sources_group_connections_all_retrieve(
2065 configuration: &configuration::Configuration,
2066 id: i32,
2067) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllRetrieveError>> {
2068 let p_path_id = id;
2070
2071 let uri_str = format!(
2072 "{}/sources/group_connections/all/{id}/",
2073 configuration.base_path,
2074 id = p_path_id
2075 );
2076 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2077
2078 if let Some(ref user_agent) = configuration.user_agent {
2079 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2080 }
2081 if let Some(ref token) = configuration.bearer_access_token {
2082 req_builder = req_builder.bearer_auth(token.to_owned());
2083 };
2084
2085 let req = req_builder.build()?;
2086 let resp = configuration.client.execute(req).await?;
2087
2088 let status = resp.status();
2089 let content_type = resp
2090 .headers()
2091 .get("content-type")
2092 .and_then(|v| v.to_str().ok())
2093 .unwrap_or("application/octet-stream");
2094 let content_type = super::ContentType::from(content_type);
2095
2096 if !status.is_client_error() && !status.is_server_error() {
2097 let content = resp.text().await?;
2098 match content_type {
2099 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2100 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2101 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSourceConnection`")))),
2102 }
2103 } else {
2104 let content = resp.text().await?;
2105 let entity: Option<SourcesGroupConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
2106 Err(Error::ResponseError(ResponseContent {
2107 status,
2108 content,
2109 entity,
2110 }))
2111 }
2112}
2113
2114pub async fn sources_group_connections_all_update(
2116 configuration: &configuration::Configuration,
2117 id: i32,
2118 group_source_connection_request: models::GroupSourceConnectionRequest,
2119) -> Result<models::GroupSourceConnection, Error<SourcesGroupConnectionsAllUpdateError>> {
2120 let p_path_id = id;
2122 let p_body_group_source_connection_request = group_source_connection_request;
2123
2124 let uri_str = format!(
2125 "{}/sources/group_connections/all/{id}/",
2126 configuration.base_path,
2127 id = p_path_id
2128 );
2129 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2130
2131 if let Some(ref user_agent) = configuration.user_agent {
2132 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2133 }
2134 if let Some(ref token) = configuration.bearer_access_token {
2135 req_builder = req_builder.bearer_auth(token.to_owned());
2136 };
2137 req_builder = req_builder.json(&p_body_group_source_connection_request);
2138
2139 let req = req_builder.build()?;
2140 let resp = configuration.client.execute(req).await?;
2141
2142 let status = resp.status();
2143 let content_type = resp
2144 .headers()
2145 .get("content-type")
2146 .and_then(|v| v.to_str().ok())
2147 .unwrap_or("application/octet-stream");
2148 let content_type = super::ContentType::from(content_type);
2149
2150 if !status.is_client_error() && !status.is_server_error() {
2151 let content = resp.text().await?;
2152 match content_type {
2153 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2154 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSourceConnection`"))),
2155 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSourceConnection`")))),
2156 }
2157 } else {
2158 let content = resp.text().await?;
2159 let entity: Option<SourcesGroupConnectionsAllUpdateError> = serde_json::from_str(&content).ok();
2160 Err(Error::ResponseError(ResponseContent {
2161 status,
2162 content,
2163 entity,
2164 }))
2165 }
2166}
2167
2168pub async fn sources_group_connections_all_used_by_list(
2170 configuration: &configuration::Configuration,
2171 id: i32,
2172) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsAllUsedByListError>> {
2173 let p_path_id = id;
2175
2176 let uri_str = format!(
2177 "{}/sources/group_connections/all/{id}/used_by/",
2178 configuration.base_path,
2179 id = p_path_id
2180 );
2181 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2182
2183 if let Some(ref user_agent) = configuration.user_agent {
2184 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2185 }
2186 if let Some(ref token) = configuration.bearer_access_token {
2187 req_builder = req_builder.bearer_auth(token.to_owned());
2188 };
2189
2190 let req = req_builder.build()?;
2191 let resp = configuration.client.execute(req).await?;
2192
2193 let status = resp.status();
2194 let content_type = resp
2195 .headers()
2196 .get("content-type")
2197 .and_then(|v| v.to_str().ok())
2198 .unwrap_or("application/octet-stream");
2199 let content_type = super::ContentType::from(content_type);
2200
2201 if !status.is_client_error() && !status.is_server_error() {
2202 let content = resp.text().await?;
2203 match content_type {
2204 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2205 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
2206 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
2207 }
2208 } else {
2209 let content = resp.text().await?;
2210 let entity: Option<SourcesGroupConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
2211 Err(Error::ResponseError(ResponseContent {
2212 status,
2213 content,
2214 entity,
2215 }))
2216 }
2217}
2218
2219pub async fn sources_group_connections_kerberos_create(
2221 configuration: &configuration::Configuration,
2222 group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest,
2223) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosCreateError>> {
2224 let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request;
2226
2227 let uri_str = format!("{}/sources/group_connections/kerberos/", configuration.base_path);
2228 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2229
2230 if let Some(ref user_agent) = configuration.user_agent {
2231 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2232 }
2233 if let Some(ref token) = configuration.bearer_access_token {
2234 req_builder = req_builder.bearer_auth(token.to_owned());
2235 };
2236 req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request);
2237
2238 let req = req_builder.build()?;
2239 let resp = configuration.client.execute(req).await?;
2240
2241 let status = resp.status();
2242 let content_type = resp
2243 .headers()
2244 .get("content-type")
2245 .and_then(|v| v.to_str().ok())
2246 .unwrap_or("application/octet-stream");
2247 let content_type = super::ContentType::from(content_type);
2248
2249 if !status.is_client_error() && !status.is_server_error() {
2250 let content = resp.text().await?;
2251 match content_type {
2252 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2253 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2254 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2255 }
2256 } else {
2257 let content = resp.text().await?;
2258 let entity: Option<SourcesGroupConnectionsKerberosCreateError> = serde_json::from_str(&content).ok();
2259 Err(Error::ResponseError(ResponseContent {
2260 status,
2261 content,
2262 entity,
2263 }))
2264 }
2265}
2266
2267pub async fn sources_group_connections_kerberos_destroy(
2269 configuration: &configuration::Configuration,
2270 id: i32,
2271) -> Result<(), Error<SourcesGroupConnectionsKerberosDestroyError>> {
2272 let p_path_id = id;
2274
2275 let uri_str = format!(
2276 "{}/sources/group_connections/kerberos/{id}/",
2277 configuration.base_path,
2278 id = p_path_id
2279 );
2280 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2281
2282 if let Some(ref user_agent) = configuration.user_agent {
2283 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2284 }
2285 if let Some(ref token) = configuration.bearer_access_token {
2286 req_builder = req_builder.bearer_auth(token.to_owned());
2287 };
2288
2289 let req = req_builder.build()?;
2290 let resp = configuration.client.execute(req).await?;
2291
2292 let status = resp.status();
2293
2294 if !status.is_client_error() && !status.is_server_error() {
2295 Ok(())
2296 } else {
2297 let content = resp.text().await?;
2298 let entity: Option<SourcesGroupConnectionsKerberosDestroyError> = serde_json::from_str(&content).ok();
2299 Err(Error::ResponseError(ResponseContent {
2300 status,
2301 content,
2302 entity,
2303 }))
2304 }
2305}
2306
2307pub async fn sources_group_connections_kerberos_list(
2309 configuration: &configuration::Configuration,
2310 group: Option<&str>,
2311 ordering: Option<&str>,
2312 page: Option<i32>,
2313 page_size: Option<i32>,
2314 search: Option<&str>,
2315 source__slug: Option<&str>,
2316) -> Result<models::PaginatedGroupKerberosSourceConnectionList, Error<SourcesGroupConnectionsKerberosListError>> {
2317 let p_query_group = group;
2319 let p_query_ordering = ordering;
2320 let p_query_page = page;
2321 let p_query_page_size = page_size;
2322 let p_query_search = search;
2323 let p_query_source__slug = source__slug;
2324
2325 let uri_str = format!("{}/sources/group_connections/kerberos/", configuration.base_path);
2326 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2327
2328 if let Some(ref param_value) = p_query_group {
2329 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
2330 }
2331 if let Some(ref param_value) = p_query_ordering {
2332 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
2333 }
2334 if let Some(ref param_value) = p_query_page {
2335 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2336 }
2337 if let Some(ref param_value) = p_query_page_size {
2338 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
2339 }
2340 if let Some(ref param_value) = p_query_search {
2341 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
2342 }
2343 if let Some(ref param_value) = p_query_source__slug {
2344 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
2345 }
2346 if let Some(ref user_agent) = configuration.user_agent {
2347 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2348 }
2349 if let Some(ref token) = configuration.bearer_access_token {
2350 req_builder = req_builder.bearer_auth(token.to_owned());
2351 };
2352
2353 let req = req_builder.build()?;
2354 let resp = configuration.client.execute(req).await?;
2355
2356 let status = resp.status();
2357 let content_type = resp
2358 .headers()
2359 .get("content-type")
2360 .and_then(|v| v.to_str().ok())
2361 .unwrap_or("application/octet-stream");
2362 let content_type = super::ContentType::from(content_type);
2363
2364 if !status.is_client_error() && !status.is_server_error() {
2365 let content = resp.text().await?;
2366 match content_type {
2367 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2368 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupKerberosSourceConnectionList`"))),
2369 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupKerberosSourceConnectionList`")))),
2370 }
2371 } else {
2372 let content = resp.text().await?;
2373 let entity: Option<SourcesGroupConnectionsKerberosListError> = serde_json::from_str(&content).ok();
2374 Err(Error::ResponseError(ResponseContent {
2375 status,
2376 content,
2377 entity,
2378 }))
2379 }
2380}
2381
2382pub async fn sources_group_connections_kerberos_partial_update(
2384 configuration: &configuration::Configuration,
2385 id: i32,
2386 patched_group_kerberos_source_connection_request: Option<models::PatchedGroupKerberosSourceConnectionRequest>,
2387) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosPartialUpdateError>> {
2388 let p_path_id = id;
2390 let p_body_patched_group_kerberos_source_connection_request = patched_group_kerberos_source_connection_request;
2391
2392 let uri_str = format!(
2393 "{}/sources/group_connections/kerberos/{id}/",
2394 configuration.base_path,
2395 id = p_path_id
2396 );
2397 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2398
2399 if let Some(ref user_agent) = configuration.user_agent {
2400 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2401 }
2402 if let Some(ref token) = configuration.bearer_access_token {
2403 req_builder = req_builder.bearer_auth(token.to_owned());
2404 };
2405 req_builder = req_builder.json(&p_body_patched_group_kerberos_source_connection_request);
2406
2407 let req = req_builder.build()?;
2408 let resp = configuration.client.execute(req).await?;
2409
2410 let status = resp.status();
2411 let content_type = resp
2412 .headers()
2413 .get("content-type")
2414 .and_then(|v| v.to_str().ok())
2415 .unwrap_or("application/octet-stream");
2416 let content_type = super::ContentType::from(content_type);
2417
2418 if !status.is_client_error() && !status.is_server_error() {
2419 let content = resp.text().await?;
2420 match content_type {
2421 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2422 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2423 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2424 }
2425 } else {
2426 let content = resp.text().await?;
2427 let entity: Option<SourcesGroupConnectionsKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
2428 Err(Error::ResponseError(ResponseContent {
2429 status,
2430 content,
2431 entity,
2432 }))
2433 }
2434}
2435
2436pub async fn sources_group_connections_kerberos_retrieve(
2438 configuration: &configuration::Configuration,
2439 id: i32,
2440) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosRetrieveError>> {
2441 let p_path_id = id;
2443
2444 let uri_str = format!(
2445 "{}/sources/group_connections/kerberos/{id}/",
2446 configuration.base_path,
2447 id = p_path_id
2448 );
2449 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2450
2451 if let Some(ref user_agent) = configuration.user_agent {
2452 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2453 }
2454 if let Some(ref token) = configuration.bearer_access_token {
2455 req_builder = req_builder.bearer_auth(token.to_owned());
2456 };
2457
2458 let req = req_builder.build()?;
2459 let resp = configuration.client.execute(req).await?;
2460
2461 let status = resp.status();
2462 let content_type = resp
2463 .headers()
2464 .get("content-type")
2465 .and_then(|v| v.to_str().ok())
2466 .unwrap_or("application/octet-stream");
2467 let content_type = super::ContentType::from(content_type);
2468
2469 if !status.is_client_error() && !status.is_server_error() {
2470 let content = resp.text().await?;
2471 match content_type {
2472 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2473 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2474 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2475 }
2476 } else {
2477 let content = resp.text().await?;
2478 let entity: Option<SourcesGroupConnectionsKerberosRetrieveError> = serde_json::from_str(&content).ok();
2479 Err(Error::ResponseError(ResponseContent {
2480 status,
2481 content,
2482 entity,
2483 }))
2484 }
2485}
2486
2487pub async fn sources_group_connections_kerberos_update(
2489 configuration: &configuration::Configuration,
2490 id: i32,
2491 group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest,
2492) -> Result<models::GroupKerberosSourceConnection, Error<SourcesGroupConnectionsKerberosUpdateError>> {
2493 let p_path_id = id;
2495 let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request;
2496
2497 let uri_str = format!(
2498 "{}/sources/group_connections/kerberos/{id}/",
2499 configuration.base_path,
2500 id = p_path_id
2501 );
2502 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2503
2504 if let Some(ref user_agent) = configuration.user_agent {
2505 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2506 }
2507 if let Some(ref token) = configuration.bearer_access_token {
2508 req_builder = req_builder.bearer_auth(token.to_owned());
2509 };
2510 req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request);
2511
2512 let req = req_builder.build()?;
2513 let resp = configuration.client.execute(req).await?;
2514
2515 let status = resp.status();
2516 let content_type = resp
2517 .headers()
2518 .get("content-type")
2519 .and_then(|v| v.to_str().ok())
2520 .unwrap_or("application/octet-stream");
2521 let content_type = super::ContentType::from(content_type);
2522
2523 if !status.is_client_error() && !status.is_server_error() {
2524 let content = resp.text().await?;
2525 match content_type {
2526 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2527 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupKerberosSourceConnection`"))),
2528 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupKerberosSourceConnection`")))),
2529 }
2530 } else {
2531 let content = resp.text().await?;
2532 let entity: Option<SourcesGroupConnectionsKerberosUpdateError> = serde_json::from_str(&content).ok();
2533 Err(Error::ResponseError(ResponseContent {
2534 status,
2535 content,
2536 entity,
2537 }))
2538 }
2539}
2540
2541pub async fn sources_group_connections_kerberos_used_by_list(
2543 configuration: &configuration::Configuration,
2544 id: i32,
2545) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsKerberosUsedByListError>> {
2546 let p_path_id = id;
2548
2549 let uri_str = format!(
2550 "{}/sources/group_connections/kerberos/{id}/used_by/",
2551 configuration.base_path,
2552 id = p_path_id
2553 );
2554 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2555
2556 if let Some(ref user_agent) = configuration.user_agent {
2557 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2558 }
2559 if let Some(ref token) = configuration.bearer_access_token {
2560 req_builder = req_builder.bearer_auth(token.to_owned());
2561 };
2562
2563 let req = req_builder.build()?;
2564 let resp = configuration.client.execute(req).await?;
2565
2566 let status = resp.status();
2567 let content_type = resp
2568 .headers()
2569 .get("content-type")
2570 .and_then(|v| v.to_str().ok())
2571 .unwrap_or("application/octet-stream");
2572 let content_type = super::ContentType::from(content_type);
2573
2574 if !status.is_client_error() && !status.is_server_error() {
2575 let content = resp.text().await?;
2576 match content_type {
2577 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2578 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
2579 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
2580 }
2581 } else {
2582 let content = resp.text().await?;
2583 let entity: Option<SourcesGroupConnectionsKerberosUsedByListError> = serde_json::from_str(&content).ok();
2584 Err(Error::ResponseError(ResponseContent {
2585 status,
2586 content,
2587 entity,
2588 }))
2589 }
2590}
2591
2592pub async fn sources_group_connections_ldap_create(
2594 configuration: &configuration::Configuration,
2595 group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest,
2596) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapCreateError>> {
2597 let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request;
2599
2600 let uri_str = format!("{}/sources/group_connections/ldap/", configuration.base_path);
2601 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2602
2603 if let Some(ref user_agent) = configuration.user_agent {
2604 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2605 }
2606 if let Some(ref token) = configuration.bearer_access_token {
2607 req_builder = req_builder.bearer_auth(token.to_owned());
2608 };
2609 req_builder = req_builder.json(&p_body_group_ldap_source_connection_request);
2610
2611 let req = req_builder.build()?;
2612 let resp = configuration.client.execute(req).await?;
2613
2614 let status = resp.status();
2615 let content_type = resp
2616 .headers()
2617 .get("content-type")
2618 .and_then(|v| v.to_str().ok())
2619 .unwrap_or("application/octet-stream");
2620 let content_type = super::ContentType::from(content_type);
2621
2622 if !status.is_client_error() && !status.is_server_error() {
2623 let content = resp.text().await?;
2624 match content_type {
2625 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2626 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2627 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2628 }
2629 } else {
2630 let content = resp.text().await?;
2631 let entity: Option<SourcesGroupConnectionsLdapCreateError> = serde_json::from_str(&content).ok();
2632 Err(Error::ResponseError(ResponseContent {
2633 status,
2634 content,
2635 entity,
2636 }))
2637 }
2638}
2639
2640pub async fn sources_group_connections_ldap_destroy(
2642 configuration: &configuration::Configuration,
2643 id: i32,
2644) -> Result<(), Error<SourcesGroupConnectionsLdapDestroyError>> {
2645 let p_path_id = id;
2647
2648 let uri_str = format!(
2649 "{}/sources/group_connections/ldap/{id}/",
2650 configuration.base_path,
2651 id = p_path_id
2652 );
2653 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2654
2655 if let Some(ref user_agent) = configuration.user_agent {
2656 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2657 }
2658 if let Some(ref token) = configuration.bearer_access_token {
2659 req_builder = req_builder.bearer_auth(token.to_owned());
2660 };
2661
2662 let req = req_builder.build()?;
2663 let resp = configuration.client.execute(req).await?;
2664
2665 let status = resp.status();
2666
2667 if !status.is_client_error() && !status.is_server_error() {
2668 Ok(())
2669 } else {
2670 let content = resp.text().await?;
2671 let entity: Option<SourcesGroupConnectionsLdapDestroyError> = serde_json::from_str(&content).ok();
2672 Err(Error::ResponseError(ResponseContent {
2673 status,
2674 content,
2675 entity,
2676 }))
2677 }
2678}
2679
2680pub async fn sources_group_connections_ldap_list(
2682 configuration: &configuration::Configuration,
2683 group: Option<&str>,
2684 ordering: Option<&str>,
2685 page: Option<i32>,
2686 page_size: Option<i32>,
2687 search: Option<&str>,
2688 source__slug: Option<&str>,
2689) -> Result<models::PaginatedGroupLdapSourceConnectionList, Error<SourcesGroupConnectionsLdapListError>> {
2690 let p_query_group = group;
2692 let p_query_ordering = ordering;
2693 let p_query_page = page;
2694 let p_query_page_size = page_size;
2695 let p_query_search = search;
2696 let p_query_source__slug = source__slug;
2697
2698 let uri_str = format!("{}/sources/group_connections/ldap/", configuration.base_path);
2699 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2700
2701 if let Some(ref param_value) = p_query_group {
2702 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
2703 }
2704 if let Some(ref param_value) = p_query_ordering {
2705 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
2706 }
2707 if let Some(ref param_value) = p_query_page {
2708 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2709 }
2710 if let Some(ref param_value) = p_query_page_size {
2711 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
2712 }
2713 if let Some(ref param_value) = p_query_search {
2714 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
2715 }
2716 if let Some(ref param_value) = p_query_source__slug {
2717 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
2718 }
2719 if let Some(ref user_agent) = configuration.user_agent {
2720 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2721 }
2722 if let Some(ref token) = configuration.bearer_access_token {
2723 req_builder = req_builder.bearer_auth(token.to_owned());
2724 };
2725
2726 let req = req_builder.build()?;
2727 let resp = configuration.client.execute(req).await?;
2728
2729 let status = resp.status();
2730 let content_type = resp
2731 .headers()
2732 .get("content-type")
2733 .and_then(|v| v.to_str().ok())
2734 .unwrap_or("application/octet-stream");
2735 let content_type = super::ContentType::from(content_type);
2736
2737 if !status.is_client_error() && !status.is_server_error() {
2738 let content = resp.text().await?;
2739 match content_type {
2740 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2741 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupLdapSourceConnectionList`"))),
2742 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupLdapSourceConnectionList`")))),
2743 }
2744 } else {
2745 let content = resp.text().await?;
2746 let entity: Option<SourcesGroupConnectionsLdapListError> = serde_json::from_str(&content).ok();
2747 Err(Error::ResponseError(ResponseContent {
2748 status,
2749 content,
2750 entity,
2751 }))
2752 }
2753}
2754
2755pub async fn sources_group_connections_ldap_partial_update(
2757 configuration: &configuration::Configuration,
2758 id: i32,
2759 patched_group_ldap_source_connection_request: Option<models::PatchedGroupLdapSourceConnectionRequest>,
2760) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapPartialUpdateError>> {
2761 let p_path_id = id;
2763 let p_body_patched_group_ldap_source_connection_request = patched_group_ldap_source_connection_request;
2764
2765 let uri_str = format!(
2766 "{}/sources/group_connections/ldap/{id}/",
2767 configuration.base_path,
2768 id = p_path_id
2769 );
2770 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2771
2772 if let Some(ref user_agent) = configuration.user_agent {
2773 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2774 }
2775 if let Some(ref token) = configuration.bearer_access_token {
2776 req_builder = req_builder.bearer_auth(token.to_owned());
2777 };
2778 req_builder = req_builder.json(&p_body_patched_group_ldap_source_connection_request);
2779
2780 let req = req_builder.build()?;
2781 let resp = configuration.client.execute(req).await?;
2782
2783 let status = resp.status();
2784 let content_type = resp
2785 .headers()
2786 .get("content-type")
2787 .and_then(|v| v.to_str().ok())
2788 .unwrap_or("application/octet-stream");
2789 let content_type = super::ContentType::from(content_type);
2790
2791 if !status.is_client_error() && !status.is_server_error() {
2792 let content = resp.text().await?;
2793 match content_type {
2794 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2795 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2796 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2797 }
2798 } else {
2799 let content = resp.text().await?;
2800 let entity: Option<SourcesGroupConnectionsLdapPartialUpdateError> = serde_json::from_str(&content).ok();
2801 Err(Error::ResponseError(ResponseContent {
2802 status,
2803 content,
2804 entity,
2805 }))
2806 }
2807}
2808
2809pub async fn sources_group_connections_ldap_retrieve(
2811 configuration: &configuration::Configuration,
2812 id: i32,
2813) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapRetrieveError>> {
2814 let p_path_id = id;
2816
2817 let uri_str = format!(
2818 "{}/sources/group_connections/ldap/{id}/",
2819 configuration.base_path,
2820 id = p_path_id
2821 );
2822 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2823
2824 if let Some(ref user_agent) = configuration.user_agent {
2825 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2826 }
2827 if let Some(ref token) = configuration.bearer_access_token {
2828 req_builder = req_builder.bearer_auth(token.to_owned());
2829 };
2830
2831 let req = req_builder.build()?;
2832 let resp = configuration.client.execute(req).await?;
2833
2834 let status = resp.status();
2835 let content_type = resp
2836 .headers()
2837 .get("content-type")
2838 .and_then(|v| v.to_str().ok())
2839 .unwrap_or("application/octet-stream");
2840 let content_type = super::ContentType::from(content_type);
2841
2842 if !status.is_client_error() && !status.is_server_error() {
2843 let content = resp.text().await?;
2844 match content_type {
2845 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2846 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2847 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2848 }
2849 } else {
2850 let content = resp.text().await?;
2851 let entity: Option<SourcesGroupConnectionsLdapRetrieveError> = serde_json::from_str(&content).ok();
2852 Err(Error::ResponseError(ResponseContent {
2853 status,
2854 content,
2855 entity,
2856 }))
2857 }
2858}
2859
2860pub async fn sources_group_connections_ldap_update(
2862 configuration: &configuration::Configuration,
2863 id: i32,
2864 group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest,
2865) -> Result<models::GroupLdapSourceConnection, Error<SourcesGroupConnectionsLdapUpdateError>> {
2866 let p_path_id = id;
2868 let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request;
2869
2870 let uri_str = format!(
2871 "{}/sources/group_connections/ldap/{id}/",
2872 configuration.base_path,
2873 id = p_path_id
2874 );
2875 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2876
2877 if let Some(ref user_agent) = configuration.user_agent {
2878 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2879 }
2880 if let Some(ref token) = configuration.bearer_access_token {
2881 req_builder = req_builder.bearer_auth(token.to_owned());
2882 };
2883 req_builder = req_builder.json(&p_body_group_ldap_source_connection_request);
2884
2885 let req = req_builder.build()?;
2886 let resp = configuration.client.execute(req).await?;
2887
2888 let status = resp.status();
2889 let content_type = resp
2890 .headers()
2891 .get("content-type")
2892 .and_then(|v| v.to_str().ok())
2893 .unwrap_or("application/octet-stream");
2894 let content_type = super::ContentType::from(content_type);
2895
2896 if !status.is_client_error() && !status.is_server_error() {
2897 let content = resp.text().await?;
2898 match content_type {
2899 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2900 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupLdapSourceConnection`"))),
2901 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupLdapSourceConnection`")))),
2902 }
2903 } else {
2904 let content = resp.text().await?;
2905 let entity: Option<SourcesGroupConnectionsLdapUpdateError> = serde_json::from_str(&content).ok();
2906 Err(Error::ResponseError(ResponseContent {
2907 status,
2908 content,
2909 entity,
2910 }))
2911 }
2912}
2913
2914pub async fn sources_group_connections_ldap_used_by_list(
2916 configuration: &configuration::Configuration,
2917 id: i32,
2918) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsLdapUsedByListError>> {
2919 let p_path_id = id;
2921
2922 let uri_str = format!(
2923 "{}/sources/group_connections/ldap/{id}/used_by/",
2924 configuration.base_path,
2925 id = p_path_id
2926 );
2927 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2928
2929 if let Some(ref user_agent) = configuration.user_agent {
2930 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2931 }
2932 if let Some(ref token) = configuration.bearer_access_token {
2933 req_builder = req_builder.bearer_auth(token.to_owned());
2934 };
2935
2936 let req = req_builder.build()?;
2937 let resp = configuration.client.execute(req).await?;
2938
2939 let status = resp.status();
2940 let content_type = resp
2941 .headers()
2942 .get("content-type")
2943 .and_then(|v| v.to_str().ok())
2944 .unwrap_or("application/octet-stream");
2945 let content_type = super::ContentType::from(content_type);
2946
2947 if !status.is_client_error() && !status.is_server_error() {
2948 let content = resp.text().await?;
2949 match content_type {
2950 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2951 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
2952 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
2953 }
2954 } else {
2955 let content = resp.text().await?;
2956 let entity: Option<SourcesGroupConnectionsLdapUsedByListError> = serde_json::from_str(&content).ok();
2957 Err(Error::ResponseError(ResponseContent {
2958 status,
2959 content,
2960 entity,
2961 }))
2962 }
2963}
2964
2965pub async fn sources_group_connections_oauth_create(
2967 configuration: &configuration::Configuration,
2968 group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest,
2969) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthCreateError>> {
2970 let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request;
2972
2973 let uri_str = format!("{}/sources/group_connections/oauth/", configuration.base_path);
2974 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2975
2976 if let Some(ref user_agent) = configuration.user_agent {
2977 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2978 }
2979 if let Some(ref token) = configuration.bearer_access_token {
2980 req_builder = req_builder.bearer_auth(token.to_owned());
2981 };
2982 req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request);
2983
2984 let req = req_builder.build()?;
2985 let resp = configuration.client.execute(req).await?;
2986
2987 let status = resp.status();
2988 let content_type = resp
2989 .headers()
2990 .get("content-type")
2991 .and_then(|v| v.to_str().ok())
2992 .unwrap_or("application/octet-stream");
2993 let content_type = super::ContentType::from(content_type);
2994
2995 if !status.is_client_error() && !status.is_server_error() {
2996 let content = resp.text().await?;
2997 match content_type {
2998 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2999 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3000 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3001 }
3002 } else {
3003 let content = resp.text().await?;
3004 let entity: Option<SourcesGroupConnectionsOauthCreateError> = serde_json::from_str(&content).ok();
3005 Err(Error::ResponseError(ResponseContent {
3006 status,
3007 content,
3008 entity,
3009 }))
3010 }
3011}
3012
3013pub async fn sources_group_connections_oauth_destroy(
3015 configuration: &configuration::Configuration,
3016 id: i32,
3017) -> Result<(), Error<SourcesGroupConnectionsOauthDestroyError>> {
3018 let p_path_id = id;
3020
3021 let uri_str = format!(
3022 "{}/sources/group_connections/oauth/{id}/",
3023 configuration.base_path,
3024 id = p_path_id
3025 );
3026 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3027
3028 if let Some(ref user_agent) = configuration.user_agent {
3029 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3030 }
3031 if let Some(ref token) = configuration.bearer_access_token {
3032 req_builder = req_builder.bearer_auth(token.to_owned());
3033 };
3034
3035 let req = req_builder.build()?;
3036 let resp = configuration.client.execute(req).await?;
3037
3038 let status = resp.status();
3039
3040 if !status.is_client_error() && !status.is_server_error() {
3041 Ok(())
3042 } else {
3043 let content = resp.text().await?;
3044 let entity: Option<SourcesGroupConnectionsOauthDestroyError> = serde_json::from_str(&content).ok();
3045 Err(Error::ResponseError(ResponseContent {
3046 status,
3047 content,
3048 entity,
3049 }))
3050 }
3051}
3052
3053pub async fn sources_group_connections_oauth_list(
3055 configuration: &configuration::Configuration,
3056 group: Option<&str>,
3057 ordering: Option<&str>,
3058 page: Option<i32>,
3059 page_size: Option<i32>,
3060 search: Option<&str>,
3061 source__slug: Option<&str>,
3062) -> Result<models::PaginatedGroupOAuthSourceConnectionList, Error<SourcesGroupConnectionsOauthListError>> {
3063 let p_query_group = group;
3065 let p_query_ordering = ordering;
3066 let p_query_page = page;
3067 let p_query_page_size = page_size;
3068 let p_query_search = search;
3069 let p_query_source__slug = source__slug;
3070
3071 let uri_str = format!("{}/sources/group_connections/oauth/", configuration.base_path);
3072 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3073
3074 if let Some(ref param_value) = p_query_group {
3075 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
3076 }
3077 if let Some(ref param_value) = p_query_ordering {
3078 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
3079 }
3080 if let Some(ref param_value) = p_query_page {
3081 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3082 }
3083 if let Some(ref param_value) = p_query_page_size {
3084 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
3085 }
3086 if let Some(ref param_value) = p_query_search {
3087 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
3088 }
3089 if let Some(ref param_value) = p_query_source__slug {
3090 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
3091 }
3092 if let Some(ref user_agent) = configuration.user_agent {
3093 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3094 }
3095 if let Some(ref token) = configuration.bearer_access_token {
3096 req_builder = req_builder.bearer_auth(token.to_owned());
3097 };
3098
3099 let req = req_builder.build()?;
3100 let resp = configuration.client.execute(req).await?;
3101
3102 let status = resp.status();
3103 let content_type = resp
3104 .headers()
3105 .get("content-type")
3106 .and_then(|v| v.to_str().ok())
3107 .unwrap_or("application/octet-stream");
3108 let content_type = super::ContentType::from(content_type);
3109
3110 if !status.is_client_error() && !status.is_server_error() {
3111 let content = resp.text().await?;
3112 match content_type {
3113 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3114 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupOAuthSourceConnectionList`"))),
3115 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupOAuthSourceConnectionList`")))),
3116 }
3117 } else {
3118 let content = resp.text().await?;
3119 let entity: Option<SourcesGroupConnectionsOauthListError> = serde_json::from_str(&content).ok();
3120 Err(Error::ResponseError(ResponseContent {
3121 status,
3122 content,
3123 entity,
3124 }))
3125 }
3126}
3127
3128pub async fn sources_group_connections_oauth_partial_update(
3130 configuration: &configuration::Configuration,
3131 id: i32,
3132 patched_group_o_auth_source_connection_request: Option<models::PatchedGroupOAuthSourceConnectionRequest>,
3133) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthPartialUpdateError>> {
3134 let p_path_id = id;
3136 let p_body_patched_group_o_auth_source_connection_request = patched_group_o_auth_source_connection_request;
3137
3138 let uri_str = format!(
3139 "{}/sources/group_connections/oauth/{id}/",
3140 configuration.base_path,
3141 id = p_path_id
3142 );
3143 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3144
3145 if let Some(ref user_agent) = configuration.user_agent {
3146 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3147 }
3148 if let Some(ref token) = configuration.bearer_access_token {
3149 req_builder = req_builder.bearer_auth(token.to_owned());
3150 };
3151 req_builder = req_builder.json(&p_body_patched_group_o_auth_source_connection_request);
3152
3153 let req = req_builder.build()?;
3154 let resp = configuration.client.execute(req).await?;
3155
3156 let status = resp.status();
3157 let content_type = resp
3158 .headers()
3159 .get("content-type")
3160 .and_then(|v| v.to_str().ok())
3161 .unwrap_or("application/octet-stream");
3162 let content_type = super::ContentType::from(content_type);
3163
3164 if !status.is_client_error() && !status.is_server_error() {
3165 let content = resp.text().await?;
3166 match content_type {
3167 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3168 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3169 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3170 }
3171 } else {
3172 let content = resp.text().await?;
3173 let entity: Option<SourcesGroupConnectionsOauthPartialUpdateError> = serde_json::from_str(&content).ok();
3174 Err(Error::ResponseError(ResponseContent {
3175 status,
3176 content,
3177 entity,
3178 }))
3179 }
3180}
3181
3182pub async fn sources_group_connections_oauth_retrieve(
3184 configuration: &configuration::Configuration,
3185 id: i32,
3186) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthRetrieveError>> {
3187 let p_path_id = id;
3189
3190 let uri_str = format!(
3191 "{}/sources/group_connections/oauth/{id}/",
3192 configuration.base_path,
3193 id = p_path_id
3194 );
3195 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3196
3197 if let Some(ref user_agent) = configuration.user_agent {
3198 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3199 }
3200 if let Some(ref token) = configuration.bearer_access_token {
3201 req_builder = req_builder.bearer_auth(token.to_owned());
3202 };
3203
3204 let req = req_builder.build()?;
3205 let resp = configuration.client.execute(req).await?;
3206
3207 let status = resp.status();
3208 let content_type = resp
3209 .headers()
3210 .get("content-type")
3211 .and_then(|v| v.to_str().ok())
3212 .unwrap_or("application/octet-stream");
3213 let content_type = super::ContentType::from(content_type);
3214
3215 if !status.is_client_error() && !status.is_server_error() {
3216 let content = resp.text().await?;
3217 match content_type {
3218 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3219 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3220 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3221 }
3222 } else {
3223 let content = resp.text().await?;
3224 let entity: Option<SourcesGroupConnectionsOauthRetrieveError> = serde_json::from_str(&content).ok();
3225 Err(Error::ResponseError(ResponseContent {
3226 status,
3227 content,
3228 entity,
3229 }))
3230 }
3231}
3232
3233pub async fn sources_group_connections_oauth_update(
3235 configuration: &configuration::Configuration,
3236 id: i32,
3237 group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest,
3238) -> Result<models::GroupOAuthSourceConnection, Error<SourcesGroupConnectionsOauthUpdateError>> {
3239 let p_path_id = id;
3241 let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request;
3242
3243 let uri_str = format!(
3244 "{}/sources/group_connections/oauth/{id}/",
3245 configuration.base_path,
3246 id = p_path_id
3247 );
3248 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3249
3250 if let Some(ref user_agent) = configuration.user_agent {
3251 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3252 }
3253 if let Some(ref token) = configuration.bearer_access_token {
3254 req_builder = req_builder.bearer_auth(token.to_owned());
3255 };
3256 req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request);
3257
3258 let req = req_builder.build()?;
3259 let resp = configuration.client.execute(req).await?;
3260
3261 let status = resp.status();
3262 let content_type = resp
3263 .headers()
3264 .get("content-type")
3265 .and_then(|v| v.to_str().ok())
3266 .unwrap_or("application/octet-stream");
3267 let content_type = super::ContentType::from(content_type);
3268
3269 if !status.is_client_error() && !status.is_server_error() {
3270 let content = resp.text().await?;
3271 match content_type {
3272 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3273 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupOAuthSourceConnection`"))),
3274 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupOAuthSourceConnection`")))),
3275 }
3276 } else {
3277 let content = resp.text().await?;
3278 let entity: Option<SourcesGroupConnectionsOauthUpdateError> = serde_json::from_str(&content).ok();
3279 Err(Error::ResponseError(ResponseContent {
3280 status,
3281 content,
3282 entity,
3283 }))
3284 }
3285}
3286
3287pub async fn sources_group_connections_oauth_used_by_list(
3289 configuration: &configuration::Configuration,
3290 id: i32,
3291) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsOauthUsedByListError>> {
3292 let p_path_id = id;
3294
3295 let uri_str = format!(
3296 "{}/sources/group_connections/oauth/{id}/used_by/",
3297 configuration.base_path,
3298 id = p_path_id
3299 );
3300 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3301
3302 if let Some(ref user_agent) = configuration.user_agent {
3303 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3304 }
3305 if let Some(ref token) = configuration.bearer_access_token {
3306 req_builder = req_builder.bearer_auth(token.to_owned());
3307 };
3308
3309 let req = req_builder.build()?;
3310 let resp = configuration.client.execute(req).await?;
3311
3312 let status = resp.status();
3313 let content_type = resp
3314 .headers()
3315 .get("content-type")
3316 .and_then(|v| v.to_str().ok())
3317 .unwrap_or("application/octet-stream");
3318 let content_type = super::ContentType::from(content_type);
3319
3320 if !status.is_client_error() && !status.is_server_error() {
3321 let content = resp.text().await?;
3322 match content_type {
3323 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3324 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
3325 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
3326 }
3327 } else {
3328 let content = resp.text().await?;
3329 let entity: Option<SourcesGroupConnectionsOauthUsedByListError> = serde_json::from_str(&content).ok();
3330 Err(Error::ResponseError(ResponseContent {
3331 status,
3332 content,
3333 entity,
3334 }))
3335 }
3336}
3337
3338pub async fn sources_group_connections_plex_create(
3340 configuration: &configuration::Configuration,
3341 group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest,
3342) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexCreateError>> {
3343 let p_body_group_plex_source_connection_request = group_plex_source_connection_request;
3345
3346 let uri_str = format!("{}/sources/group_connections/plex/", configuration.base_path);
3347 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3348
3349 if let Some(ref user_agent) = configuration.user_agent {
3350 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3351 }
3352 if let Some(ref token) = configuration.bearer_access_token {
3353 req_builder = req_builder.bearer_auth(token.to_owned());
3354 };
3355 req_builder = req_builder.json(&p_body_group_plex_source_connection_request);
3356
3357 let req = req_builder.build()?;
3358 let resp = configuration.client.execute(req).await?;
3359
3360 let status = resp.status();
3361 let content_type = resp
3362 .headers()
3363 .get("content-type")
3364 .and_then(|v| v.to_str().ok())
3365 .unwrap_or("application/octet-stream");
3366 let content_type = super::ContentType::from(content_type);
3367
3368 if !status.is_client_error() && !status.is_server_error() {
3369 let content = resp.text().await?;
3370 match content_type {
3371 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3372 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3373 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3374 }
3375 } else {
3376 let content = resp.text().await?;
3377 let entity: Option<SourcesGroupConnectionsPlexCreateError> = serde_json::from_str(&content).ok();
3378 Err(Error::ResponseError(ResponseContent {
3379 status,
3380 content,
3381 entity,
3382 }))
3383 }
3384}
3385
3386pub async fn sources_group_connections_plex_destroy(
3388 configuration: &configuration::Configuration,
3389 id: i32,
3390) -> Result<(), Error<SourcesGroupConnectionsPlexDestroyError>> {
3391 let p_path_id = id;
3393
3394 let uri_str = format!(
3395 "{}/sources/group_connections/plex/{id}/",
3396 configuration.base_path,
3397 id = p_path_id
3398 );
3399 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3400
3401 if let Some(ref user_agent) = configuration.user_agent {
3402 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3403 }
3404 if let Some(ref token) = configuration.bearer_access_token {
3405 req_builder = req_builder.bearer_auth(token.to_owned());
3406 };
3407
3408 let req = req_builder.build()?;
3409 let resp = configuration.client.execute(req).await?;
3410
3411 let status = resp.status();
3412
3413 if !status.is_client_error() && !status.is_server_error() {
3414 Ok(())
3415 } else {
3416 let content = resp.text().await?;
3417 let entity: Option<SourcesGroupConnectionsPlexDestroyError> = serde_json::from_str(&content).ok();
3418 Err(Error::ResponseError(ResponseContent {
3419 status,
3420 content,
3421 entity,
3422 }))
3423 }
3424}
3425
3426pub async fn sources_group_connections_plex_list(
3428 configuration: &configuration::Configuration,
3429 group: Option<&str>,
3430 ordering: Option<&str>,
3431 page: Option<i32>,
3432 page_size: Option<i32>,
3433 search: Option<&str>,
3434 source__slug: Option<&str>,
3435) -> Result<models::PaginatedGroupPlexSourceConnectionList, Error<SourcesGroupConnectionsPlexListError>> {
3436 let p_query_group = group;
3438 let p_query_ordering = ordering;
3439 let p_query_page = page;
3440 let p_query_page_size = page_size;
3441 let p_query_search = search;
3442 let p_query_source__slug = source__slug;
3443
3444 let uri_str = format!("{}/sources/group_connections/plex/", configuration.base_path);
3445 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3446
3447 if let Some(ref param_value) = p_query_group {
3448 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
3449 }
3450 if let Some(ref param_value) = p_query_ordering {
3451 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
3452 }
3453 if let Some(ref param_value) = p_query_page {
3454 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3455 }
3456 if let Some(ref param_value) = p_query_page_size {
3457 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
3458 }
3459 if let Some(ref param_value) = p_query_search {
3460 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
3461 }
3462 if let Some(ref param_value) = p_query_source__slug {
3463 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
3464 }
3465 if let Some(ref user_agent) = configuration.user_agent {
3466 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3467 }
3468 if let Some(ref token) = configuration.bearer_access_token {
3469 req_builder = req_builder.bearer_auth(token.to_owned());
3470 };
3471
3472 let req = req_builder.build()?;
3473 let resp = configuration.client.execute(req).await?;
3474
3475 let status = resp.status();
3476 let content_type = resp
3477 .headers()
3478 .get("content-type")
3479 .and_then(|v| v.to_str().ok())
3480 .unwrap_or("application/octet-stream");
3481 let content_type = super::ContentType::from(content_type);
3482
3483 if !status.is_client_error() && !status.is_server_error() {
3484 let content = resp.text().await?;
3485 match content_type {
3486 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3487 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupPlexSourceConnectionList`"))),
3488 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupPlexSourceConnectionList`")))),
3489 }
3490 } else {
3491 let content = resp.text().await?;
3492 let entity: Option<SourcesGroupConnectionsPlexListError> = serde_json::from_str(&content).ok();
3493 Err(Error::ResponseError(ResponseContent {
3494 status,
3495 content,
3496 entity,
3497 }))
3498 }
3499}
3500
3501pub async fn sources_group_connections_plex_partial_update(
3503 configuration: &configuration::Configuration,
3504 id: i32,
3505 patched_group_plex_source_connection_request: Option<models::PatchedGroupPlexSourceConnectionRequest>,
3506) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexPartialUpdateError>> {
3507 let p_path_id = id;
3509 let p_body_patched_group_plex_source_connection_request = patched_group_plex_source_connection_request;
3510
3511 let uri_str = format!(
3512 "{}/sources/group_connections/plex/{id}/",
3513 configuration.base_path,
3514 id = p_path_id
3515 );
3516 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3517
3518 if let Some(ref user_agent) = configuration.user_agent {
3519 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3520 }
3521 if let Some(ref token) = configuration.bearer_access_token {
3522 req_builder = req_builder.bearer_auth(token.to_owned());
3523 };
3524 req_builder = req_builder.json(&p_body_patched_group_plex_source_connection_request);
3525
3526 let req = req_builder.build()?;
3527 let resp = configuration.client.execute(req).await?;
3528
3529 let status = resp.status();
3530 let content_type = resp
3531 .headers()
3532 .get("content-type")
3533 .and_then(|v| v.to_str().ok())
3534 .unwrap_or("application/octet-stream");
3535 let content_type = super::ContentType::from(content_type);
3536
3537 if !status.is_client_error() && !status.is_server_error() {
3538 let content = resp.text().await?;
3539 match content_type {
3540 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3541 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3542 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3543 }
3544 } else {
3545 let content = resp.text().await?;
3546 let entity: Option<SourcesGroupConnectionsPlexPartialUpdateError> = serde_json::from_str(&content).ok();
3547 Err(Error::ResponseError(ResponseContent {
3548 status,
3549 content,
3550 entity,
3551 }))
3552 }
3553}
3554
3555pub async fn sources_group_connections_plex_retrieve(
3557 configuration: &configuration::Configuration,
3558 id: i32,
3559) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexRetrieveError>> {
3560 let p_path_id = id;
3562
3563 let uri_str = format!(
3564 "{}/sources/group_connections/plex/{id}/",
3565 configuration.base_path,
3566 id = p_path_id
3567 );
3568 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3569
3570 if let Some(ref user_agent) = configuration.user_agent {
3571 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3572 }
3573 if let Some(ref token) = configuration.bearer_access_token {
3574 req_builder = req_builder.bearer_auth(token.to_owned());
3575 };
3576
3577 let req = req_builder.build()?;
3578 let resp = configuration.client.execute(req).await?;
3579
3580 let status = resp.status();
3581 let content_type = resp
3582 .headers()
3583 .get("content-type")
3584 .and_then(|v| v.to_str().ok())
3585 .unwrap_or("application/octet-stream");
3586 let content_type = super::ContentType::from(content_type);
3587
3588 if !status.is_client_error() && !status.is_server_error() {
3589 let content = resp.text().await?;
3590 match content_type {
3591 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3592 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3593 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3594 }
3595 } else {
3596 let content = resp.text().await?;
3597 let entity: Option<SourcesGroupConnectionsPlexRetrieveError> = serde_json::from_str(&content).ok();
3598 Err(Error::ResponseError(ResponseContent {
3599 status,
3600 content,
3601 entity,
3602 }))
3603 }
3604}
3605
3606pub async fn sources_group_connections_plex_update(
3608 configuration: &configuration::Configuration,
3609 id: i32,
3610 group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest,
3611) -> Result<models::GroupPlexSourceConnection, Error<SourcesGroupConnectionsPlexUpdateError>> {
3612 let p_path_id = id;
3614 let p_body_group_plex_source_connection_request = group_plex_source_connection_request;
3615
3616 let uri_str = format!(
3617 "{}/sources/group_connections/plex/{id}/",
3618 configuration.base_path,
3619 id = p_path_id
3620 );
3621 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3622
3623 if let Some(ref user_agent) = configuration.user_agent {
3624 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3625 }
3626 if let Some(ref token) = configuration.bearer_access_token {
3627 req_builder = req_builder.bearer_auth(token.to_owned());
3628 };
3629 req_builder = req_builder.json(&p_body_group_plex_source_connection_request);
3630
3631 let req = req_builder.build()?;
3632 let resp = configuration.client.execute(req).await?;
3633
3634 let status = resp.status();
3635 let content_type = resp
3636 .headers()
3637 .get("content-type")
3638 .and_then(|v| v.to_str().ok())
3639 .unwrap_or("application/octet-stream");
3640 let content_type = super::ContentType::from(content_type);
3641
3642 if !status.is_client_error() && !status.is_server_error() {
3643 let content = resp.text().await?;
3644 match content_type {
3645 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3646 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupPlexSourceConnection`"))),
3647 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupPlexSourceConnection`")))),
3648 }
3649 } else {
3650 let content = resp.text().await?;
3651 let entity: Option<SourcesGroupConnectionsPlexUpdateError> = serde_json::from_str(&content).ok();
3652 Err(Error::ResponseError(ResponseContent {
3653 status,
3654 content,
3655 entity,
3656 }))
3657 }
3658}
3659
3660pub async fn sources_group_connections_plex_used_by_list(
3662 configuration: &configuration::Configuration,
3663 id: i32,
3664) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsPlexUsedByListError>> {
3665 let p_path_id = id;
3667
3668 let uri_str = format!(
3669 "{}/sources/group_connections/plex/{id}/used_by/",
3670 configuration.base_path,
3671 id = p_path_id
3672 );
3673 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3674
3675 if let Some(ref user_agent) = configuration.user_agent {
3676 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3677 }
3678 if let Some(ref token) = configuration.bearer_access_token {
3679 req_builder = req_builder.bearer_auth(token.to_owned());
3680 };
3681
3682 let req = req_builder.build()?;
3683 let resp = configuration.client.execute(req).await?;
3684
3685 let status = resp.status();
3686 let content_type = resp
3687 .headers()
3688 .get("content-type")
3689 .and_then(|v| v.to_str().ok())
3690 .unwrap_or("application/octet-stream");
3691 let content_type = super::ContentType::from(content_type);
3692
3693 if !status.is_client_error() && !status.is_server_error() {
3694 let content = resp.text().await?;
3695 match content_type {
3696 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3697 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
3698 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
3699 }
3700 } else {
3701 let content = resp.text().await?;
3702 let entity: Option<SourcesGroupConnectionsPlexUsedByListError> = serde_json::from_str(&content).ok();
3703 Err(Error::ResponseError(ResponseContent {
3704 status,
3705 content,
3706 entity,
3707 }))
3708 }
3709}
3710
3711pub async fn sources_group_connections_saml_create(
3713 configuration: &configuration::Configuration,
3714 group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest,
3715) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlCreateError>> {
3716 let p_body_group_saml_source_connection_request = group_saml_source_connection_request;
3718
3719 let uri_str = format!("{}/sources/group_connections/saml/", configuration.base_path);
3720 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3721
3722 if let Some(ref user_agent) = configuration.user_agent {
3723 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3724 }
3725 if let Some(ref token) = configuration.bearer_access_token {
3726 req_builder = req_builder.bearer_auth(token.to_owned());
3727 };
3728 req_builder = req_builder.json(&p_body_group_saml_source_connection_request);
3729
3730 let req = req_builder.build()?;
3731 let resp = configuration.client.execute(req).await?;
3732
3733 let status = resp.status();
3734 let content_type = resp
3735 .headers()
3736 .get("content-type")
3737 .and_then(|v| v.to_str().ok())
3738 .unwrap_or("application/octet-stream");
3739 let content_type = super::ContentType::from(content_type);
3740
3741 if !status.is_client_error() && !status.is_server_error() {
3742 let content = resp.text().await?;
3743 match content_type {
3744 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3745 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3746 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3747 }
3748 } else {
3749 let content = resp.text().await?;
3750 let entity: Option<SourcesGroupConnectionsSamlCreateError> = serde_json::from_str(&content).ok();
3751 Err(Error::ResponseError(ResponseContent {
3752 status,
3753 content,
3754 entity,
3755 }))
3756 }
3757}
3758
3759pub async fn sources_group_connections_saml_destroy(
3761 configuration: &configuration::Configuration,
3762 id: i32,
3763) -> Result<(), Error<SourcesGroupConnectionsSamlDestroyError>> {
3764 let p_path_id = id;
3766
3767 let uri_str = format!(
3768 "{}/sources/group_connections/saml/{id}/",
3769 configuration.base_path,
3770 id = p_path_id
3771 );
3772 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3773
3774 if let Some(ref user_agent) = configuration.user_agent {
3775 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3776 }
3777 if let Some(ref token) = configuration.bearer_access_token {
3778 req_builder = req_builder.bearer_auth(token.to_owned());
3779 };
3780
3781 let req = req_builder.build()?;
3782 let resp = configuration.client.execute(req).await?;
3783
3784 let status = resp.status();
3785
3786 if !status.is_client_error() && !status.is_server_error() {
3787 Ok(())
3788 } else {
3789 let content = resp.text().await?;
3790 let entity: Option<SourcesGroupConnectionsSamlDestroyError> = serde_json::from_str(&content).ok();
3791 Err(Error::ResponseError(ResponseContent {
3792 status,
3793 content,
3794 entity,
3795 }))
3796 }
3797}
3798
3799pub async fn sources_group_connections_saml_list(
3801 configuration: &configuration::Configuration,
3802 group: Option<&str>,
3803 ordering: Option<&str>,
3804 page: Option<i32>,
3805 page_size: Option<i32>,
3806 search: Option<&str>,
3807 source__slug: Option<&str>,
3808) -> Result<models::PaginatedGroupSamlSourceConnectionList, Error<SourcesGroupConnectionsSamlListError>> {
3809 let p_query_group = group;
3811 let p_query_ordering = ordering;
3812 let p_query_page = page;
3813 let p_query_page_size = page_size;
3814 let p_query_search = search;
3815 let p_query_source__slug = source__slug;
3816
3817 let uri_str = format!("{}/sources/group_connections/saml/", configuration.base_path);
3818 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3819
3820 if let Some(ref param_value) = p_query_group {
3821 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
3822 }
3823 if let Some(ref param_value) = p_query_ordering {
3824 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
3825 }
3826 if let Some(ref param_value) = p_query_page {
3827 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3828 }
3829 if let Some(ref param_value) = p_query_page_size {
3830 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
3831 }
3832 if let Some(ref param_value) = p_query_search {
3833 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
3834 }
3835 if let Some(ref param_value) = p_query_source__slug {
3836 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
3837 }
3838 if let Some(ref user_agent) = configuration.user_agent {
3839 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3840 }
3841 if let Some(ref token) = configuration.bearer_access_token {
3842 req_builder = req_builder.bearer_auth(token.to_owned());
3843 };
3844
3845 let req = req_builder.build()?;
3846 let resp = configuration.client.execute(req).await?;
3847
3848 let status = resp.status();
3849 let content_type = resp
3850 .headers()
3851 .get("content-type")
3852 .and_then(|v| v.to_str().ok())
3853 .unwrap_or("application/octet-stream");
3854 let content_type = super::ContentType::from(content_type);
3855
3856 if !status.is_client_error() && !status.is_server_error() {
3857 let content = resp.text().await?;
3858 match content_type {
3859 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3860 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupSamlSourceConnectionList`"))),
3861 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupSamlSourceConnectionList`")))),
3862 }
3863 } else {
3864 let content = resp.text().await?;
3865 let entity: Option<SourcesGroupConnectionsSamlListError> = serde_json::from_str(&content).ok();
3866 Err(Error::ResponseError(ResponseContent {
3867 status,
3868 content,
3869 entity,
3870 }))
3871 }
3872}
3873
3874pub async fn sources_group_connections_saml_partial_update(
3876 configuration: &configuration::Configuration,
3877 id: i32,
3878 patched_group_saml_source_connection_request: Option<models::PatchedGroupSamlSourceConnectionRequest>,
3879) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlPartialUpdateError>> {
3880 let p_path_id = id;
3882 let p_body_patched_group_saml_source_connection_request = patched_group_saml_source_connection_request;
3883
3884 let uri_str = format!(
3885 "{}/sources/group_connections/saml/{id}/",
3886 configuration.base_path,
3887 id = p_path_id
3888 );
3889 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3890
3891 if let Some(ref user_agent) = configuration.user_agent {
3892 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3893 }
3894 if let Some(ref token) = configuration.bearer_access_token {
3895 req_builder = req_builder.bearer_auth(token.to_owned());
3896 };
3897 req_builder = req_builder.json(&p_body_patched_group_saml_source_connection_request);
3898
3899 let req = req_builder.build()?;
3900 let resp = configuration.client.execute(req).await?;
3901
3902 let status = resp.status();
3903 let content_type = resp
3904 .headers()
3905 .get("content-type")
3906 .and_then(|v| v.to_str().ok())
3907 .unwrap_or("application/octet-stream");
3908 let content_type = super::ContentType::from(content_type);
3909
3910 if !status.is_client_error() && !status.is_server_error() {
3911 let content = resp.text().await?;
3912 match content_type {
3913 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3914 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3915 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3916 }
3917 } else {
3918 let content = resp.text().await?;
3919 let entity: Option<SourcesGroupConnectionsSamlPartialUpdateError> = serde_json::from_str(&content).ok();
3920 Err(Error::ResponseError(ResponseContent {
3921 status,
3922 content,
3923 entity,
3924 }))
3925 }
3926}
3927
3928pub async fn sources_group_connections_saml_retrieve(
3930 configuration: &configuration::Configuration,
3931 id: i32,
3932) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlRetrieveError>> {
3933 let p_path_id = id;
3935
3936 let uri_str = format!(
3937 "{}/sources/group_connections/saml/{id}/",
3938 configuration.base_path,
3939 id = p_path_id
3940 );
3941 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3942
3943 if let Some(ref user_agent) = configuration.user_agent {
3944 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3945 }
3946 if let Some(ref token) = configuration.bearer_access_token {
3947 req_builder = req_builder.bearer_auth(token.to_owned());
3948 };
3949
3950 let req = req_builder.build()?;
3951 let resp = configuration.client.execute(req).await?;
3952
3953 let status = resp.status();
3954 let content_type = resp
3955 .headers()
3956 .get("content-type")
3957 .and_then(|v| v.to_str().ok())
3958 .unwrap_or("application/octet-stream");
3959 let content_type = super::ContentType::from(content_type);
3960
3961 if !status.is_client_error() && !status.is_server_error() {
3962 let content = resp.text().await?;
3963 match content_type {
3964 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3965 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
3966 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
3967 }
3968 } else {
3969 let content = resp.text().await?;
3970 let entity: Option<SourcesGroupConnectionsSamlRetrieveError> = serde_json::from_str(&content).ok();
3971 Err(Error::ResponseError(ResponseContent {
3972 status,
3973 content,
3974 entity,
3975 }))
3976 }
3977}
3978
3979pub async fn sources_group_connections_saml_update(
3981 configuration: &configuration::Configuration,
3982 id: i32,
3983 group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest,
3984) -> Result<models::GroupSamlSourceConnection, Error<SourcesGroupConnectionsSamlUpdateError>> {
3985 let p_path_id = id;
3987 let p_body_group_saml_source_connection_request = group_saml_source_connection_request;
3988
3989 let uri_str = format!(
3990 "{}/sources/group_connections/saml/{id}/",
3991 configuration.base_path,
3992 id = p_path_id
3993 );
3994 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3995
3996 if let Some(ref user_agent) = configuration.user_agent {
3997 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3998 }
3999 if let Some(ref token) = configuration.bearer_access_token {
4000 req_builder = req_builder.bearer_auth(token.to_owned());
4001 };
4002 req_builder = req_builder.json(&p_body_group_saml_source_connection_request);
4003
4004 let req = req_builder.build()?;
4005 let resp = configuration.client.execute(req).await?;
4006
4007 let status = resp.status();
4008 let content_type = resp
4009 .headers()
4010 .get("content-type")
4011 .and_then(|v| v.to_str().ok())
4012 .unwrap_or("application/octet-stream");
4013 let content_type = super::ContentType::from(content_type);
4014
4015 if !status.is_client_error() && !status.is_server_error() {
4016 let content = resp.text().await?;
4017 match content_type {
4018 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4019 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupSamlSourceConnection`"))),
4020 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupSamlSourceConnection`")))),
4021 }
4022 } else {
4023 let content = resp.text().await?;
4024 let entity: Option<SourcesGroupConnectionsSamlUpdateError> = serde_json::from_str(&content).ok();
4025 Err(Error::ResponseError(ResponseContent {
4026 status,
4027 content,
4028 entity,
4029 }))
4030 }
4031}
4032
4033pub async fn sources_group_connections_saml_used_by_list(
4035 configuration: &configuration::Configuration,
4036 id: i32,
4037) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsSamlUsedByListError>> {
4038 let p_path_id = id;
4040
4041 let uri_str = format!(
4042 "{}/sources/group_connections/saml/{id}/used_by/",
4043 configuration.base_path,
4044 id = p_path_id
4045 );
4046 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4047
4048 if let Some(ref user_agent) = configuration.user_agent {
4049 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4050 }
4051 if let Some(ref token) = configuration.bearer_access_token {
4052 req_builder = req_builder.bearer_auth(token.to_owned());
4053 };
4054
4055 let req = req_builder.build()?;
4056 let resp = configuration.client.execute(req).await?;
4057
4058 let status = resp.status();
4059 let content_type = resp
4060 .headers()
4061 .get("content-type")
4062 .and_then(|v| v.to_str().ok())
4063 .unwrap_or("application/octet-stream");
4064 let content_type = super::ContentType::from(content_type);
4065
4066 if !status.is_client_error() && !status.is_server_error() {
4067 let content = resp.text().await?;
4068 match content_type {
4069 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4070 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
4071 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
4072 }
4073 } else {
4074 let content = resp.text().await?;
4075 let entity: Option<SourcesGroupConnectionsSamlUsedByListError> = serde_json::from_str(&content).ok();
4076 Err(Error::ResponseError(ResponseContent {
4077 status,
4078 content,
4079 entity,
4080 }))
4081 }
4082}
4083
4084pub async fn sources_group_connections_telegram_create(
4086 configuration: &configuration::Configuration,
4087 group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest,
4088) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramCreateError>> {
4089 let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request;
4091
4092 let uri_str = format!("{}/sources/group_connections/telegram/", configuration.base_path);
4093 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4094
4095 if let Some(ref user_agent) = configuration.user_agent {
4096 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4097 }
4098 if let Some(ref token) = configuration.bearer_access_token {
4099 req_builder = req_builder.bearer_auth(token.to_owned());
4100 };
4101 req_builder = req_builder.json(&p_body_group_telegram_source_connection_request);
4102
4103 let req = req_builder.build()?;
4104 let resp = configuration.client.execute(req).await?;
4105
4106 let status = resp.status();
4107 let content_type = resp
4108 .headers()
4109 .get("content-type")
4110 .and_then(|v| v.to_str().ok())
4111 .unwrap_or("application/octet-stream");
4112 let content_type = super::ContentType::from(content_type);
4113
4114 if !status.is_client_error() && !status.is_server_error() {
4115 let content = resp.text().await?;
4116 match content_type {
4117 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4118 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4119 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4120 }
4121 } else {
4122 let content = resp.text().await?;
4123 let entity: Option<SourcesGroupConnectionsTelegramCreateError> = serde_json::from_str(&content).ok();
4124 Err(Error::ResponseError(ResponseContent {
4125 status,
4126 content,
4127 entity,
4128 }))
4129 }
4130}
4131
4132pub async fn sources_group_connections_telegram_destroy(
4134 configuration: &configuration::Configuration,
4135 id: i32,
4136) -> Result<(), Error<SourcesGroupConnectionsTelegramDestroyError>> {
4137 let p_path_id = id;
4139
4140 let uri_str = format!(
4141 "{}/sources/group_connections/telegram/{id}/",
4142 configuration.base_path,
4143 id = p_path_id
4144 );
4145 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4146
4147 if let Some(ref user_agent) = configuration.user_agent {
4148 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4149 }
4150 if let Some(ref token) = configuration.bearer_access_token {
4151 req_builder = req_builder.bearer_auth(token.to_owned());
4152 };
4153
4154 let req = req_builder.build()?;
4155 let resp = configuration.client.execute(req).await?;
4156
4157 let status = resp.status();
4158
4159 if !status.is_client_error() && !status.is_server_error() {
4160 Ok(())
4161 } else {
4162 let content = resp.text().await?;
4163 let entity: Option<SourcesGroupConnectionsTelegramDestroyError> = serde_json::from_str(&content).ok();
4164 Err(Error::ResponseError(ResponseContent {
4165 status,
4166 content,
4167 entity,
4168 }))
4169 }
4170}
4171
4172pub async fn sources_group_connections_telegram_list(
4174 configuration: &configuration::Configuration,
4175 group: Option<&str>,
4176 ordering: Option<&str>,
4177 page: Option<i32>,
4178 page_size: Option<i32>,
4179 search: Option<&str>,
4180 source__slug: Option<&str>,
4181) -> Result<models::PaginatedGroupTelegramSourceConnectionList, Error<SourcesGroupConnectionsTelegramListError>> {
4182 let p_query_group = group;
4184 let p_query_ordering = ordering;
4185 let p_query_page = page;
4186 let p_query_page_size = page_size;
4187 let p_query_search = search;
4188 let p_query_source__slug = source__slug;
4189
4190 let uri_str = format!("{}/sources/group_connections/telegram/", configuration.base_path);
4191 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4192
4193 if let Some(ref param_value) = p_query_group {
4194 req_builder = req_builder.query(&[("group", ¶m_value.to_string())]);
4195 }
4196 if let Some(ref param_value) = p_query_ordering {
4197 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
4198 }
4199 if let Some(ref param_value) = p_query_page {
4200 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
4201 }
4202 if let Some(ref param_value) = p_query_page_size {
4203 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
4204 }
4205 if let Some(ref param_value) = p_query_search {
4206 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
4207 }
4208 if let Some(ref param_value) = p_query_source__slug {
4209 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
4210 }
4211 if let Some(ref user_agent) = configuration.user_agent {
4212 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4213 }
4214 if let Some(ref token) = configuration.bearer_access_token {
4215 req_builder = req_builder.bearer_auth(token.to_owned());
4216 };
4217
4218 let req = req_builder.build()?;
4219 let resp = configuration.client.execute(req).await?;
4220
4221 let status = resp.status();
4222 let content_type = resp
4223 .headers()
4224 .get("content-type")
4225 .and_then(|v| v.to_str().ok())
4226 .unwrap_or("application/octet-stream");
4227 let content_type = super::ContentType::from(content_type);
4228
4229 if !status.is_client_error() && !status.is_server_error() {
4230 let content = resp.text().await?;
4231 match content_type {
4232 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4233 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGroupTelegramSourceConnectionList`"))),
4234 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGroupTelegramSourceConnectionList`")))),
4235 }
4236 } else {
4237 let content = resp.text().await?;
4238 let entity: Option<SourcesGroupConnectionsTelegramListError> = serde_json::from_str(&content).ok();
4239 Err(Error::ResponseError(ResponseContent {
4240 status,
4241 content,
4242 entity,
4243 }))
4244 }
4245}
4246
4247pub async fn sources_group_connections_telegram_partial_update(
4249 configuration: &configuration::Configuration,
4250 id: i32,
4251 patched_group_telegram_source_connection_request: Option<models::PatchedGroupTelegramSourceConnectionRequest>,
4252) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramPartialUpdateError>> {
4253 let p_path_id = id;
4255 let p_body_patched_group_telegram_source_connection_request = patched_group_telegram_source_connection_request;
4256
4257 let uri_str = format!(
4258 "{}/sources/group_connections/telegram/{id}/",
4259 configuration.base_path,
4260 id = p_path_id
4261 );
4262 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4263
4264 if let Some(ref user_agent) = configuration.user_agent {
4265 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4266 }
4267 if let Some(ref token) = configuration.bearer_access_token {
4268 req_builder = req_builder.bearer_auth(token.to_owned());
4269 };
4270 req_builder = req_builder.json(&p_body_patched_group_telegram_source_connection_request);
4271
4272 let req = req_builder.build()?;
4273 let resp = configuration.client.execute(req).await?;
4274
4275 let status = resp.status();
4276 let content_type = resp
4277 .headers()
4278 .get("content-type")
4279 .and_then(|v| v.to_str().ok())
4280 .unwrap_or("application/octet-stream");
4281 let content_type = super::ContentType::from(content_type);
4282
4283 if !status.is_client_error() && !status.is_server_error() {
4284 let content = resp.text().await?;
4285 match content_type {
4286 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4287 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4288 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4289 }
4290 } else {
4291 let content = resp.text().await?;
4292 let entity: Option<SourcesGroupConnectionsTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
4293 Err(Error::ResponseError(ResponseContent {
4294 status,
4295 content,
4296 entity,
4297 }))
4298 }
4299}
4300
4301pub async fn sources_group_connections_telegram_retrieve(
4303 configuration: &configuration::Configuration,
4304 id: i32,
4305) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramRetrieveError>> {
4306 let p_path_id = id;
4308
4309 let uri_str = format!(
4310 "{}/sources/group_connections/telegram/{id}/",
4311 configuration.base_path,
4312 id = p_path_id
4313 );
4314 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4315
4316 if let Some(ref user_agent) = configuration.user_agent {
4317 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4318 }
4319 if let Some(ref token) = configuration.bearer_access_token {
4320 req_builder = req_builder.bearer_auth(token.to_owned());
4321 };
4322
4323 let req = req_builder.build()?;
4324 let resp = configuration.client.execute(req).await?;
4325
4326 let status = resp.status();
4327 let content_type = resp
4328 .headers()
4329 .get("content-type")
4330 .and_then(|v| v.to_str().ok())
4331 .unwrap_or("application/octet-stream");
4332 let content_type = super::ContentType::from(content_type);
4333
4334 if !status.is_client_error() && !status.is_server_error() {
4335 let content = resp.text().await?;
4336 match content_type {
4337 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4338 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4339 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4340 }
4341 } else {
4342 let content = resp.text().await?;
4343 let entity: Option<SourcesGroupConnectionsTelegramRetrieveError> = serde_json::from_str(&content).ok();
4344 Err(Error::ResponseError(ResponseContent {
4345 status,
4346 content,
4347 entity,
4348 }))
4349 }
4350}
4351
4352pub async fn sources_group_connections_telegram_update(
4354 configuration: &configuration::Configuration,
4355 id: i32,
4356 group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest,
4357) -> Result<models::GroupTelegramSourceConnection, Error<SourcesGroupConnectionsTelegramUpdateError>> {
4358 let p_path_id = id;
4360 let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request;
4361
4362 let uri_str = format!(
4363 "{}/sources/group_connections/telegram/{id}/",
4364 configuration.base_path,
4365 id = p_path_id
4366 );
4367 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4368
4369 if let Some(ref user_agent) = configuration.user_agent {
4370 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4371 }
4372 if let Some(ref token) = configuration.bearer_access_token {
4373 req_builder = req_builder.bearer_auth(token.to_owned());
4374 };
4375 req_builder = req_builder.json(&p_body_group_telegram_source_connection_request);
4376
4377 let req = req_builder.build()?;
4378 let resp = configuration.client.execute(req).await?;
4379
4380 let status = resp.status();
4381 let content_type = resp
4382 .headers()
4383 .get("content-type")
4384 .and_then(|v| v.to_str().ok())
4385 .unwrap_or("application/octet-stream");
4386 let content_type = super::ContentType::from(content_type);
4387
4388 if !status.is_client_error() && !status.is_server_error() {
4389 let content = resp.text().await?;
4390 match content_type {
4391 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4392 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupTelegramSourceConnection`"))),
4393 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupTelegramSourceConnection`")))),
4394 }
4395 } else {
4396 let content = resp.text().await?;
4397 let entity: Option<SourcesGroupConnectionsTelegramUpdateError> = serde_json::from_str(&content).ok();
4398 Err(Error::ResponseError(ResponseContent {
4399 status,
4400 content,
4401 entity,
4402 }))
4403 }
4404}
4405
4406pub async fn sources_group_connections_telegram_used_by_list(
4408 configuration: &configuration::Configuration,
4409 id: i32,
4410) -> Result<Vec<models::UsedBy>, Error<SourcesGroupConnectionsTelegramUsedByListError>> {
4411 let p_path_id = id;
4413
4414 let uri_str = format!(
4415 "{}/sources/group_connections/telegram/{id}/used_by/",
4416 configuration.base_path,
4417 id = p_path_id
4418 );
4419 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4420
4421 if let Some(ref user_agent) = configuration.user_agent {
4422 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4423 }
4424 if let Some(ref token) = configuration.bearer_access_token {
4425 req_builder = req_builder.bearer_auth(token.to_owned());
4426 };
4427
4428 let req = req_builder.build()?;
4429 let resp = configuration.client.execute(req).await?;
4430
4431 let status = resp.status();
4432 let content_type = resp
4433 .headers()
4434 .get("content-type")
4435 .and_then(|v| v.to_str().ok())
4436 .unwrap_or("application/octet-stream");
4437 let content_type = super::ContentType::from(content_type);
4438
4439 if !status.is_client_error() && !status.is_server_error() {
4440 let content = resp.text().await?;
4441 match content_type {
4442 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4443 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
4444 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
4445 }
4446 } else {
4447 let content = resp.text().await?;
4448 let entity: Option<SourcesGroupConnectionsTelegramUsedByListError> = serde_json::from_str(&content).ok();
4449 Err(Error::ResponseError(ResponseContent {
4450 status,
4451 content,
4452 entity,
4453 }))
4454 }
4455}
4456
4457pub async fn sources_kerberos_create(
4459 configuration: &configuration::Configuration,
4460 kerberos_source_request: models::KerberosSourceRequest,
4461) -> Result<models::KerberosSource, Error<SourcesKerberosCreateError>> {
4462 let p_body_kerberos_source_request = kerberos_source_request;
4464
4465 let uri_str = format!("{}/sources/kerberos/", configuration.base_path);
4466 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4467
4468 if let Some(ref user_agent) = configuration.user_agent {
4469 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4470 }
4471 if let Some(ref token) = configuration.bearer_access_token {
4472 req_builder = req_builder.bearer_auth(token.to_owned());
4473 };
4474 req_builder = req_builder.json(&p_body_kerberos_source_request);
4475
4476 let req = req_builder.build()?;
4477 let resp = configuration.client.execute(req).await?;
4478
4479 let status = resp.status();
4480 let content_type = resp
4481 .headers()
4482 .get("content-type")
4483 .and_then(|v| v.to_str().ok())
4484 .unwrap_or("application/octet-stream");
4485 let content_type = super::ContentType::from(content_type);
4486
4487 if !status.is_client_error() && !status.is_server_error() {
4488 let content = resp.text().await?;
4489 match content_type {
4490 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4491 ContentType::Text => {
4492 return Err(Error::from(serde_json::Error::custom(
4493 "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4494 )))
4495 }
4496 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4497 "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4498 )))),
4499 }
4500 } else {
4501 let content = resp.text().await?;
4502 let entity: Option<SourcesKerberosCreateError> = serde_json::from_str(&content).ok();
4503 Err(Error::ResponseError(ResponseContent {
4504 status,
4505 content,
4506 entity,
4507 }))
4508 }
4509}
4510
4511pub async fn sources_kerberos_destroy(
4513 configuration: &configuration::Configuration,
4514 slug: &str,
4515) -> Result<(), Error<SourcesKerberosDestroyError>> {
4516 let p_path_slug = slug;
4518
4519 let uri_str = format!(
4520 "{}/sources/kerberos/{slug}/",
4521 configuration.base_path,
4522 slug = crate::apis::urlencode(p_path_slug)
4523 );
4524 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4525
4526 if let Some(ref user_agent) = configuration.user_agent {
4527 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4528 }
4529 if let Some(ref token) = configuration.bearer_access_token {
4530 req_builder = req_builder.bearer_auth(token.to_owned());
4531 };
4532
4533 let req = req_builder.build()?;
4534 let resp = configuration.client.execute(req).await?;
4535
4536 let status = resp.status();
4537
4538 if !status.is_client_error() && !status.is_server_error() {
4539 Ok(())
4540 } else {
4541 let content = resp.text().await?;
4542 let entity: Option<SourcesKerberosDestroyError> = serde_json::from_str(&content).ok();
4543 Err(Error::ResponseError(ResponseContent {
4544 status,
4545 content,
4546 entity,
4547 }))
4548 }
4549}
4550
4551pub async fn sources_kerberos_list(
4553 configuration: &configuration::Configuration,
4554 enabled: Option<bool>,
4555 kadmin_type: Option<&str>,
4556 name: Option<&str>,
4557 ordering: Option<&str>,
4558 page: Option<i32>,
4559 page_size: Option<i32>,
4560 password_login_update_internal_password: Option<bool>,
4561 pbm_uuid: Option<&str>,
4562 realm: Option<&str>,
4563 search: Option<&str>,
4564 slug: Option<&str>,
4565 spnego_server_name: Option<&str>,
4566 sync_principal: Option<&str>,
4567 sync_users: Option<bool>,
4568 sync_users_password: Option<bool>,
4569) -> Result<models::PaginatedKerberosSourceList, Error<SourcesKerberosListError>> {
4570 let p_query_enabled = enabled;
4572 let p_query_kadmin_type = kadmin_type;
4573 let p_query_name = name;
4574 let p_query_ordering = ordering;
4575 let p_query_page = page;
4576 let p_query_page_size = page_size;
4577 let p_query_password_login_update_internal_password = password_login_update_internal_password;
4578 let p_query_pbm_uuid = pbm_uuid;
4579 let p_query_realm = realm;
4580 let p_query_search = search;
4581 let p_query_slug = slug;
4582 let p_query_spnego_server_name = spnego_server_name;
4583 let p_query_sync_principal = sync_principal;
4584 let p_query_sync_users = sync_users;
4585 let p_query_sync_users_password = sync_users_password;
4586
4587 let uri_str = format!("{}/sources/kerberos/", configuration.base_path);
4588 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4589
4590 if let Some(ref param_value) = p_query_enabled {
4591 req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]);
4592 }
4593 if let Some(ref param_value) = p_query_kadmin_type {
4594 req_builder = req_builder.query(&[("kadmin_type", ¶m_value.to_string())]);
4595 }
4596 if let Some(ref param_value) = p_query_name {
4597 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
4598 }
4599 if let Some(ref param_value) = p_query_ordering {
4600 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
4601 }
4602 if let Some(ref param_value) = p_query_page {
4603 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
4604 }
4605 if let Some(ref param_value) = p_query_page_size {
4606 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
4607 }
4608 if let Some(ref param_value) = p_query_password_login_update_internal_password {
4609 req_builder = req_builder.query(&[("password_login_update_internal_password", ¶m_value.to_string())]);
4610 }
4611 if let Some(ref param_value) = p_query_pbm_uuid {
4612 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
4613 }
4614 if let Some(ref param_value) = p_query_realm {
4615 req_builder = req_builder.query(&[("realm", ¶m_value.to_string())]);
4616 }
4617 if let Some(ref param_value) = p_query_search {
4618 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
4619 }
4620 if let Some(ref param_value) = p_query_slug {
4621 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
4622 }
4623 if let Some(ref param_value) = p_query_spnego_server_name {
4624 req_builder = req_builder.query(&[("spnego_server_name", ¶m_value.to_string())]);
4625 }
4626 if let Some(ref param_value) = p_query_sync_principal {
4627 req_builder = req_builder.query(&[("sync_principal", ¶m_value.to_string())]);
4628 }
4629 if let Some(ref param_value) = p_query_sync_users {
4630 req_builder = req_builder.query(&[("sync_users", ¶m_value.to_string())]);
4631 }
4632 if let Some(ref param_value) = p_query_sync_users_password {
4633 req_builder = req_builder.query(&[("sync_users_password", ¶m_value.to_string())]);
4634 }
4635 if let Some(ref user_agent) = configuration.user_agent {
4636 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4637 }
4638 if let Some(ref token) = configuration.bearer_access_token {
4639 req_builder = req_builder.bearer_auth(token.to_owned());
4640 };
4641
4642 let req = req_builder.build()?;
4643 let resp = configuration.client.execute(req).await?;
4644
4645 let status = resp.status();
4646 let content_type = resp
4647 .headers()
4648 .get("content-type")
4649 .and_then(|v| v.to_str().ok())
4650 .unwrap_or("application/octet-stream");
4651 let content_type = super::ContentType::from(content_type);
4652
4653 if !status.is_client_error() && !status.is_server_error() {
4654 let content = resp.text().await?;
4655 match content_type {
4656 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4657 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedKerberosSourceList`"))),
4658 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedKerberosSourceList`")))),
4659 }
4660 } else {
4661 let content = resp.text().await?;
4662 let entity: Option<SourcesKerberosListError> = serde_json::from_str(&content).ok();
4663 Err(Error::ResponseError(ResponseContent {
4664 status,
4665 content,
4666 entity,
4667 }))
4668 }
4669}
4670
4671pub async fn sources_kerberos_partial_update(
4673 configuration: &configuration::Configuration,
4674 slug: &str,
4675 patched_kerberos_source_request: Option<models::PatchedKerberosSourceRequest>,
4676) -> Result<models::KerberosSource, Error<SourcesKerberosPartialUpdateError>> {
4677 let p_path_slug = slug;
4679 let p_body_patched_kerberos_source_request = patched_kerberos_source_request;
4680
4681 let uri_str = format!(
4682 "{}/sources/kerberos/{slug}/",
4683 configuration.base_path,
4684 slug = crate::apis::urlencode(p_path_slug)
4685 );
4686 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4687
4688 if let Some(ref user_agent) = configuration.user_agent {
4689 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4690 }
4691 if let Some(ref token) = configuration.bearer_access_token {
4692 req_builder = req_builder.bearer_auth(token.to_owned());
4693 };
4694 req_builder = req_builder.json(&p_body_patched_kerberos_source_request);
4695
4696 let req = req_builder.build()?;
4697 let resp = configuration.client.execute(req).await?;
4698
4699 let status = resp.status();
4700 let content_type = resp
4701 .headers()
4702 .get("content-type")
4703 .and_then(|v| v.to_str().ok())
4704 .unwrap_or("application/octet-stream");
4705 let content_type = super::ContentType::from(content_type);
4706
4707 if !status.is_client_error() && !status.is_server_error() {
4708 let content = resp.text().await?;
4709 match content_type {
4710 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4711 ContentType::Text => {
4712 return Err(Error::from(serde_json::Error::custom(
4713 "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4714 )))
4715 }
4716 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4717 "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4718 )))),
4719 }
4720 } else {
4721 let content = resp.text().await?;
4722 let entity: Option<SourcesKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
4723 Err(Error::ResponseError(ResponseContent {
4724 status,
4725 content,
4726 entity,
4727 }))
4728 }
4729}
4730
4731pub async fn sources_kerberos_retrieve(
4733 configuration: &configuration::Configuration,
4734 slug: &str,
4735) -> Result<models::KerberosSource, Error<SourcesKerberosRetrieveError>> {
4736 let p_path_slug = slug;
4738
4739 let uri_str = format!(
4740 "{}/sources/kerberos/{slug}/",
4741 configuration.base_path,
4742 slug = crate::apis::urlencode(p_path_slug)
4743 );
4744 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4745
4746 if let Some(ref user_agent) = configuration.user_agent {
4747 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4748 }
4749 if let Some(ref token) = configuration.bearer_access_token {
4750 req_builder = req_builder.bearer_auth(token.to_owned());
4751 };
4752
4753 let req = req_builder.build()?;
4754 let resp = configuration.client.execute(req).await?;
4755
4756 let status = resp.status();
4757 let content_type = resp
4758 .headers()
4759 .get("content-type")
4760 .and_then(|v| v.to_str().ok())
4761 .unwrap_or("application/octet-stream");
4762 let content_type = super::ContentType::from(content_type);
4763
4764 if !status.is_client_error() && !status.is_server_error() {
4765 let content = resp.text().await?;
4766 match content_type {
4767 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4768 ContentType::Text => {
4769 return Err(Error::from(serde_json::Error::custom(
4770 "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4771 )))
4772 }
4773 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4774 "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4775 )))),
4776 }
4777 } else {
4778 let content = resp.text().await?;
4779 let entity: Option<SourcesKerberosRetrieveError> = serde_json::from_str(&content).ok();
4780 Err(Error::ResponseError(ResponseContent {
4781 status,
4782 content,
4783 entity,
4784 }))
4785 }
4786}
4787
4788pub async fn sources_kerberos_sync_status_retrieve(
4790 configuration: &configuration::Configuration,
4791 slug: &str,
4792) -> Result<models::SyncStatus, Error<SourcesKerberosSyncStatusRetrieveError>> {
4793 let p_path_slug = slug;
4795
4796 let uri_str = format!(
4797 "{}/sources/kerberos/{slug}/sync/status/",
4798 configuration.base_path,
4799 slug = crate::apis::urlencode(p_path_slug)
4800 );
4801 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4802
4803 if let Some(ref user_agent) = configuration.user_agent {
4804 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4805 }
4806 if let Some(ref token) = configuration.bearer_access_token {
4807 req_builder = req_builder.bearer_auth(token.to_owned());
4808 };
4809
4810 let req = req_builder.build()?;
4811 let resp = configuration.client.execute(req).await?;
4812
4813 let status = resp.status();
4814 let content_type = resp
4815 .headers()
4816 .get("content-type")
4817 .and_then(|v| v.to_str().ok())
4818 .unwrap_or("application/octet-stream");
4819 let content_type = super::ContentType::from(content_type);
4820
4821 if !status.is_client_error() && !status.is_server_error() {
4822 let content = resp.text().await?;
4823 match content_type {
4824 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4825 ContentType::Text => {
4826 return Err(Error::from(serde_json::Error::custom(
4827 "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
4828 )))
4829 }
4830 ContentType::Unsupported(unknown_type) => {
4831 return Err(Error::from(serde_json::Error::custom(format!(
4832 "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
4833 ))))
4834 }
4835 }
4836 } else {
4837 let content = resp.text().await?;
4838 let entity: Option<SourcesKerberosSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
4839 Err(Error::ResponseError(ResponseContent {
4840 status,
4841 content,
4842 entity,
4843 }))
4844 }
4845}
4846
4847pub async fn sources_kerberos_update(
4849 configuration: &configuration::Configuration,
4850 slug: &str,
4851 kerberos_source_request: models::KerberosSourceRequest,
4852) -> Result<models::KerberosSource, Error<SourcesKerberosUpdateError>> {
4853 let p_path_slug = slug;
4855 let p_body_kerberos_source_request = kerberos_source_request;
4856
4857 let uri_str = format!(
4858 "{}/sources/kerberos/{slug}/",
4859 configuration.base_path,
4860 slug = crate::apis::urlencode(p_path_slug)
4861 );
4862 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4863
4864 if let Some(ref user_agent) = configuration.user_agent {
4865 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4866 }
4867 if let Some(ref token) = configuration.bearer_access_token {
4868 req_builder = req_builder.bearer_auth(token.to_owned());
4869 };
4870 req_builder = req_builder.json(&p_body_kerberos_source_request);
4871
4872 let req = req_builder.build()?;
4873 let resp = configuration.client.execute(req).await?;
4874
4875 let status = resp.status();
4876 let content_type = resp
4877 .headers()
4878 .get("content-type")
4879 .and_then(|v| v.to_str().ok())
4880 .unwrap_or("application/octet-stream");
4881 let content_type = super::ContentType::from(content_type);
4882
4883 if !status.is_client_error() && !status.is_server_error() {
4884 let content = resp.text().await?;
4885 match content_type {
4886 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4887 ContentType::Text => {
4888 return Err(Error::from(serde_json::Error::custom(
4889 "Received `text/plain` content type response that cannot be converted to `models::KerberosSource`",
4890 )))
4891 }
4892 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4893 "Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSource`"
4894 )))),
4895 }
4896 } else {
4897 let content = resp.text().await?;
4898 let entity: Option<SourcesKerberosUpdateError> = serde_json::from_str(&content).ok();
4899 Err(Error::ResponseError(ResponseContent {
4900 status,
4901 content,
4902 entity,
4903 }))
4904 }
4905}
4906
4907pub async fn sources_kerberos_used_by_list(
4909 configuration: &configuration::Configuration,
4910 slug: &str,
4911) -> Result<Vec<models::UsedBy>, Error<SourcesKerberosUsedByListError>> {
4912 let p_path_slug = slug;
4914
4915 let uri_str = format!(
4916 "{}/sources/kerberos/{slug}/used_by/",
4917 configuration.base_path,
4918 slug = crate::apis::urlencode(p_path_slug)
4919 );
4920 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4921
4922 if let Some(ref user_agent) = configuration.user_agent {
4923 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4924 }
4925 if let Some(ref token) = configuration.bearer_access_token {
4926 req_builder = req_builder.bearer_auth(token.to_owned());
4927 };
4928
4929 let req = req_builder.build()?;
4930 let resp = configuration.client.execute(req).await?;
4931
4932 let status = resp.status();
4933 let content_type = resp
4934 .headers()
4935 .get("content-type")
4936 .and_then(|v| v.to_str().ok())
4937 .unwrap_or("application/octet-stream");
4938 let content_type = super::ContentType::from(content_type);
4939
4940 if !status.is_client_error() && !status.is_server_error() {
4941 let content = resp.text().await?;
4942 match content_type {
4943 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4944 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
4945 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
4946 }
4947 } else {
4948 let content = resp.text().await?;
4949 let entity: Option<SourcesKerberosUsedByListError> = serde_json::from_str(&content).ok();
4950 Err(Error::ResponseError(ResponseContent {
4951 status,
4952 content,
4953 entity,
4954 }))
4955 }
4956}
4957
4958pub async fn sources_ldap_create(
4960 configuration: &configuration::Configuration,
4961 ldap_source_request: models::LdapSourceRequest,
4962) -> Result<models::LdapSource, Error<SourcesLdapCreateError>> {
4963 let p_body_ldap_source_request = ldap_source_request;
4965
4966 let uri_str = format!("{}/sources/ldap/", configuration.base_path);
4967 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4968
4969 if let Some(ref user_agent) = configuration.user_agent {
4970 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4971 }
4972 if let Some(ref token) = configuration.bearer_access_token {
4973 req_builder = req_builder.bearer_auth(token.to_owned());
4974 };
4975 req_builder = req_builder.json(&p_body_ldap_source_request);
4976
4977 let req = req_builder.build()?;
4978 let resp = configuration.client.execute(req).await?;
4979
4980 let status = resp.status();
4981 let content_type = resp
4982 .headers()
4983 .get("content-type")
4984 .and_then(|v| v.to_str().ok())
4985 .unwrap_or("application/octet-stream");
4986 let content_type = super::ContentType::from(content_type);
4987
4988 if !status.is_client_error() && !status.is_server_error() {
4989 let content = resp.text().await?;
4990 match content_type {
4991 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4992 ContentType::Text => {
4993 return Err(Error::from(serde_json::Error::custom(
4994 "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
4995 )))
4996 }
4997 ContentType::Unsupported(unknown_type) => {
4998 return Err(Error::from(serde_json::Error::custom(format!(
4999 "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5000 ))))
5001 }
5002 }
5003 } else {
5004 let content = resp.text().await?;
5005 let entity: Option<SourcesLdapCreateError> = serde_json::from_str(&content).ok();
5006 Err(Error::ResponseError(ResponseContent {
5007 status,
5008 content,
5009 entity,
5010 }))
5011 }
5012}
5013
5014pub async fn sources_ldap_debug_retrieve(
5016 configuration: &configuration::Configuration,
5017 slug: &str,
5018) -> Result<models::LdapDebug, Error<SourcesLdapDebugRetrieveError>> {
5019 let p_path_slug = slug;
5021
5022 let uri_str = format!(
5023 "{}/sources/ldap/{slug}/debug/",
5024 configuration.base_path,
5025 slug = crate::apis::urlencode(p_path_slug)
5026 );
5027 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5028
5029 if let Some(ref user_agent) = configuration.user_agent {
5030 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5031 }
5032 if let Some(ref token) = configuration.bearer_access_token {
5033 req_builder = req_builder.bearer_auth(token.to_owned());
5034 };
5035
5036 let req = req_builder.build()?;
5037 let resp = configuration.client.execute(req).await?;
5038
5039 let status = resp.status();
5040 let content_type = resp
5041 .headers()
5042 .get("content-type")
5043 .and_then(|v| v.to_str().ok())
5044 .unwrap_or("application/octet-stream");
5045 let content_type = super::ContentType::from(content_type);
5046
5047 if !status.is_client_error() && !status.is_server_error() {
5048 let content = resp.text().await?;
5049 match content_type {
5050 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5051 ContentType::Text => {
5052 return Err(Error::from(serde_json::Error::custom(
5053 "Received `text/plain` content type response that cannot be converted to `models::LdapDebug`",
5054 )))
5055 }
5056 ContentType::Unsupported(unknown_type) => {
5057 return Err(Error::from(serde_json::Error::custom(format!(
5058 "Received `{unknown_type}` content type response that cannot be converted to `models::LdapDebug`"
5059 ))))
5060 }
5061 }
5062 } else {
5063 let content = resp.text().await?;
5064 let entity: Option<SourcesLdapDebugRetrieveError> = serde_json::from_str(&content).ok();
5065 Err(Error::ResponseError(ResponseContent {
5066 status,
5067 content,
5068 entity,
5069 }))
5070 }
5071}
5072
5073pub async fn sources_ldap_destroy(
5075 configuration: &configuration::Configuration,
5076 slug: &str,
5077) -> Result<(), Error<SourcesLdapDestroyError>> {
5078 let p_path_slug = slug;
5080
5081 let uri_str = format!(
5082 "{}/sources/ldap/{slug}/",
5083 configuration.base_path,
5084 slug = crate::apis::urlencode(p_path_slug)
5085 );
5086 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5087
5088 if let Some(ref user_agent) = configuration.user_agent {
5089 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5090 }
5091 if let Some(ref token) = configuration.bearer_access_token {
5092 req_builder = req_builder.bearer_auth(token.to_owned());
5093 };
5094
5095 let req = req_builder.build()?;
5096 let resp = configuration.client.execute(req).await?;
5097
5098 let status = resp.status();
5099
5100 if !status.is_client_error() && !status.is_server_error() {
5101 Ok(())
5102 } else {
5103 let content = resp.text().await?;
5104 let entity: Option<SourcesLdapDestroyError> = serde_json::from_str(&content).ok();
5105 Err(Error::ResponseError(ResponseContent {
5106 status,
5107 content,
5108 entity,
5109 }))
5110 }
5111}
5112
5113pub async fn sources_ldap_list(
5115 configuration: &configuration::Configuration,
5116 additional_group_dn: Option<&str>,
5117 additional_user_dn: Option<&str>,
5118 base_dn: Option<&str>,
5119 bind_cn: Option<&str>,
5120 client_certificate: Option<&str>,
5121 delete_not_found_objects: Option<bool>,
5122 enabled: Option<bool>,
5123 group_membership_field: Option<&str>,
5124 group_object_filter: Option<&str>,
5125 group_property_mappings: Option<Vec<uuid::Uuid>>,
5126 lookup_groups_from_user: Option<bool>,
5127 name: Option<&str>,
5128 object_uniqueness_field: Option<&str>,
5129 ordering: Option<&str>,
5130 page: Option<i32>,
5131 page_size: Option<i32>,
5132 password_login_update_internal_password: Option<bool>,
5133 pbm_uuid: Option<&str>,
5134 peer_certificate: Option<&str>,
5135 search: Option<&str>,
5136 server_uri: Option<&str>,
5137 slug: Option<&str>,
5138 sni: Option<bool>,
5139 start_tls: Option<bool>,
5140 sync_groups: Option<bool>,
5141 sync_parent_group: Option<&str>,
5142 sync_users: Option<bool>,
5143 sync_users_password: Option<bool>,
5144 user_membership_attribute: Option<&str>,
5145 user_object_filter: Option<&str>,
5146 user_property_mappings: Option<Vec<uuid::Uuid>>,
5147) -> Result<models::PaginatedLdapSourceList, Error<SourcesLdapListError>> {
5148 let p_query_additional_group_dn = additional_group_dn;
5150 let p_query_additional_user_dn = additional_user_dn;
5151 let p_query_base_dn = base_dn;
5152 let p_query_bind_cn = bind_cn;
5153 let p_query_client_certificate = client_certificate;
5154 let p_query_delete_not_found_objects = delete_not_found_objects;
5155 let p_query_enabled = enabled;
5156 let p_query_group_membership_field = group_membership_field;
5157 let p_query_group_object_filter = group_object_filter;
5158 let p_query_group_property_mappings = group_property_mappings;
5159 let p_query_lookup_groups_from_user = lookup_groups_from_user;
5160 let p_query_name = name;
5161 let p_query_object_uniqueness_field = object_uniqueness_field;
5162 let p_query_ordering = ordering;
5163 let p_query_page = page;
5164 let p_query_page_size = page_size;
5165 let p_query_password_login_update_internal_password = password_login_update_internal_password;
5166 let p_query_pbm_uuid = pbm_uuid;
5167 let p_query_peer_certificate = peer_certificate;
5168 let p_query_search = search;
5169 let p_query_server_uri = server_uri;
5170 let p_query_slug = slug;
5171 let p_query_sni = sni;
5172 let p_query_start_tls = start_tls;
5173 let p_query_sync_groups = sync_groups;
5174 let p_query_sync_parent_group = sync_parent_group;
5175 let p_query_sync_users = sync_users;
5176 let p_query_sync_users_password = sync_users_password;
5177 let p_query_user_membership_attribute = user_membership_attribute;
5178 let p_query_user_object_filter = user_object_filter;
5179 let p_query_user_property_mappings = user_property_mappings;
5180
5181 let uri_str = format!("{}/sources/ldap/", configuration.base_path);
5182 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5183
5184 if let Some(ref param_value) = p_query_additional_group_dn {
5185 req_builder = req_builder.query(&[("additional_group_dn", ¶m_value.to_string())]);
5186 }
5187 if let Some(ref param_value) = p_query_additional_user_dn {
5188 req_builder = req_builder.query(&[("additional_user_dn", ¶m_value.to_string())]);
5189 }
5190 if let Some(ref param_value) = p_query_base_dn {
5191 req_builder = req_builder.query(&[("base_dn", ¶m_value.to_string())]);
5192 }
5193 if let Some(ref param_value) = p_query_bind_cn {
5194 req_builder = req_builder.query(&[("bind_cn", ¶m_value.to_string())]);
5195 }
5196 if let Some(ref param_value) = p_query_client_certificate {
5197 req_builder = req_builder.query(&[("client_certificate", ¶m_value.to_string())]);
5198 }
5199 if let Some(ref param_value) = p_query_delete_not_found_objects {
5200 req_builder = req_builder.query(&[("delete_not_found_objects", ¶m_value.to_string())]);
5201 }
5202 if let Some(ref param_value) = p_query_enabled {
5203 req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]);
5204 }
5205 if let Some(ref param_value) = p_query_group_membership_field {
5206 req_builder = req_builder.query(&[("group_membership_field", ¶m_value.to_string())]);
5207 }
5208 if let Some(ref param_value) = p_query_group_object_filter {
5209 req_builder = req_builder.query(&[("group_object_filter", ¶m_value.to_string())]);
5210 }
5211 if let Some(ref param_value) = p_query_group_property_mappings {
5212 req_builder = match "multi" {
5213 "multi" => req_builder.query(
5214 ¶m_value
5215 .into_iter()
5216 .map(|p| ("group_property_mappings".to_owned(), p.to_string()))
5217 .collect::<Vec<(std::string::String, std::string::String)>>(),
5218 ),
5219 _ => req_builder.query(&[(
5220 "group_property_mappings",
5221 ¶m_value
5222 .into_iter()
5223 .map(|p| p.to_string())
5224 .collect::<Vec<String>>()
5225 .join(",")
5226 .to_string(),
5227 )]),
5228 };
5229 }
5230 if let Some(ref param_value) = p_query_lookup_groups_from_user {
5231 req_builder = req_builder.query(&[("lookup_groups_from_user", ¶m_value.to_string())]);
5232 }
5233 if let Some(ref param_value) = p_query_name {
5234 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
5235 }
5236 if let Some(ref param_value) = p_query_object_uniqueness_field {
5237 req_builder = req_builder.query(&[("object_uniqueness_field", ¶m_value.to_string())]);
5238 }
5239 if let Some(ref param_value) = p_query_ordering {
5240 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
5241 }
5242 if let Some(ref param_value) = p_query_page {
5243 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
5244 }
5245 if let Some(ref param_value) = p_query_page_size {
5246 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
5247 }
5248 if let Some(ref param_value) = p_query_password_login_update_internal_password {
5249 req_builder = req_builder.query(&[("password_login_update_internal_password", ¶m_value.to_string())]);
5250 }
5251 if let Some(ref param_value) = p_query_pbm_uuid {
5252 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
5253 }
5254 if let Some(ref param_value) = p_query_peer_certificate {
5255 req_builder = req_builder.query(&[("peer_certificate", ¶m_value.to_string())]);
5256 }
5257 if let Some(ref param_value) = p_query_search {
5258 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
5259 }
5260 if let Some(ref param_value) = p_query_server_uri {
5261 req_builder = req_builder.query(&[("server_uri", ¶m_value.to_string())]);
5262 }
5263 if let Some(ref param_value) = p_query_slug {
5264 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
5265 }
5266 if let Some(ref param_value) = p_query_sni {
5267 req_builder = req_builder.query(&[("sni", ¶m_value.to_string())]);
5268 }
5269 if let Some(ref param_value) = p_query_start_tls {
5270 req_builder = req_builder.query(&[("start_tls", ¶m_value.to_string())]);
5271 }
5272 if let Some(ref param_value) = p_query_sync_groups {
5273 req_builder = req_builder.query(&[("sync_groups", ¶m_value.to_string())]);
5274 }
5275 if let Some(ref param_value) = p_query_sync_parent_group {
5276 req_builder = req_builder.query(&[("sync_parent_group", ¶m_value.to_string())]);
5277 }
5278 if let Some(ref param_value) = p_query_sync_users {
5279 req_builder = req_builder.query(&[("sync_users", ¶m_value.to_string())]);
5280 }
5281 if let Some(ref param_value) = p_query_sync_users_password {
5282 req_builder = req_builder.query(&[("sync_users_password", ¶m_value.to_string())]);
5283 }
5284 if let Some(ref param_value) = p_query_user_membership_attribute {
5285 req_builder = req_builder.query(&[("user_membership_attribute", ¶m_value.to_string())]);
5286 }
5287 if let Some(ref param_value) = p_query_user_object_filter {
5288 req_builder = req_builder.query(&[("user_object_filter", ¶m_value.to_string())]);
5289 }
5290 if let Some(ref param_value) = p_query_user_property_mappings {
5291 req_builder = match "multi" {
5292 "multi" => req_builder.query(
5293 ¶m_value
5294 .into_iter()
5295 .map(|p| ("user_property_mappings".to_owned(), p.to_string()))
5296 .collect::<Vec<(std::string::String, std::string::String)>>(),
5297 ),
5298 _ => req_builder.query(&[(
5299 "user_property_mappings",
5300 ¶m_value
5301 .into_iter()
5302 .map(|p| p.to_string())
5303 .collect::<Vec<String>>()
5304 .join(",")
5305 .to_string(),
5306 )]),
5307 };
5308 }
5309 if let Some(ref user_agent) = configuration.user_agent {
5310 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5311 }
5312 if let Some(ref token) = configuration.bearer_access_token {
5313 req_builder = req_builder.bearer_auth(token.to_owned());
5314 };
5315
5316 let req = req_builder.build()?;
5317 let resp = configuration.client.execute(req).await?;
5318
5319 let status = resp.status();
5320 let content_type = resp
5321 .headers()
5322 .get("content-type")
5323 .and_then(|v| v.to_str().ok())
5324 .unwrap_or("application/octet-stream");
5325 let content_type = super::ContentType::from(content_type);
5326
5327 if !status.is_client_error() && !status.is_server_error() {
5328 let content = resp.text().await?;
5329 match content_type {
5330 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5331 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapSourceList`"))),
5332 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedLdapSourceList`")))),
5333 }
5334 } else {
5335 let content = resp.text().await?;
5336 let entity: Option<SourcesLdapListError> = serde_json::from_str(&content).ok();
5337 Err(Error::ResponseError(ResponseContent {
5338 status,
5339 content,
5340 entity,
5341 }))
5342 }
5343}
5344
5345pub async fn sources_ldap_partial_update(
5347 configuration: &configuration::Configuration,
5348 slug: &str,
5349 patched_ldap_source_request: Option<models::PatchedLdapSourceRequest>,
5350) -> Result<models::LdapSource, Error<SourcesLdapPartialUpdateError>> {
5351 let p_path_slug = slug;
5353 let p_body_patched_ldap_source_request = patched_ldap_source_request;
5354
5355 let uri_str = format!(
5356 "{}/sources/ldap/{slug}/",
5357 configuration.base_path,
5358 slug = crate::apis::urlencode(p_path_slug)
5359 );
5360 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5361
5362 if let Some(ref user_agent) = configuration.user_agent {
5363 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5364 }
5365 if let Some(ref token) = configuration.bearer_access_token {
5366 req_builder = req_builder.bearer_auth(token.to_owned());
5367 };
5368 req_builder = req_builder.json(&p_body_patched_ldap_source_request);
5369
5370 let req = req_builder.build()?;
5371 let resp = configuration.client.execute(req).await?;
5372
5373 let status = resp.status();
5374 let content_type = resp
5375 .headers()
5376 .get("content-type")
5377 .and_then(|v| v.to_str().ok())
5378 .unwrap_or("application/octet-stream");
5379 let content_type = super::ContentType::from(content_type);
5380
5381 if !status.is_client_error() && !status.is_server_error() {
5382 let content = resp.text().await?;
5383 match content_type {
5384 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5385 ContentType::Text => {
5386 return Err(Error::from(serde_json::Error::custom(
5387 "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5388 )))
5389 }
5390 ContentType::Unsupported(unknown_type) => {
5391 return Err(Error::from(serde_json::Error::custom(format!(
5392 "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5393 ))))
5394 }
5395 }
5396 } else {
5397 let content = resp.text().await?;
5398 let entity: Option<SourcesLdapPartialUpdateError> = serde_json::from_str(&content).ok();
5399 Err(Error::ResponseError(ResponseContent {
5400 status,
5401 content,
5402 entity,
5403 }))
5404 }
5405}
5406
5407pub async fn sources_ldap_retrieve(
5409 configuration: &configuration::Configuration,
5410 slug: &str,
5411) -> Result<models::LdapSource, Error<SourcesLdapRetrieveError>> {
5412 let p_path_slug = slug;
5414
5415 let uri_str = format!(
5416 "{}/sources/ldap/{slug}/",
5417 configuration.base_path,
5418 slug = crate::apis::urlencode(p_path_slug)
5419 );
5420 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5421
5422 if let Some(ref user_agent) = configuration.user_agent {
5423 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5424 }
5425 if let Some(ref token) = configuration.bearer_access_token {
5426 req_builder = req_builder.bearer_auth(token.to_owned());
5427 };
5428
5429 let req = req_builder.build()?;
5430 let resp = configuration.client.execute(req).await?;
5431
5432 let status = resp.status();
5433 let content_type = resp
5434 .headers()
5435 .get("content-type")
5436 .and_then(|v| v.to_str().ok())
5437 .unwrap_or("application/octet-stream");
5438 let content_type = super::ContentType::from(content_type);
5439
5440 if !status.is_client_error() && !status.is_server_error() {
5441 let content = resp.text().await?;
5442 match content_type {
5443 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5444 ContentType::Text => {
5445 return Err(Error::from(serde_json::Error::custom(
5446 "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5447 )))
5448 }
5449 ContentType::Unsupported(unknown_type) => {
5450 return Err(Error::from(serde_json::Error::custom(format!(
5451 "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5452 ))))
5453 }
5454 }
5455 } else {
5456 let content = resp.text().await?;
5457 let entity: Option<SourcesLdapRetrieveError> = serde_json::from_str(&content).ok();
5458 Err(Error::ResponseError(ResponseContent {
5459 status,
5460 content,
5461 entity,
5462 }))
5463 }
5464}
5465
5466pub async fn sources_ldap_sync_status_retrieve(
5468 configuration: &configuration::Configuration,
5469 slug: &str,
5470) -> Result<models::SyncStatus, Error<SourcesLdapSyncStatusRetrieveError>> {
5471 let p_path_slug = slug;
5473
5474 let uri_str = format!(
5475 "{}/sources/ldap/{slug}/sync/status/",
5476 configuration.base_path,
5477 slug = crate::apis::urlencode(p_path_slug)
5478 );
5479 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5480
5481 if let Some(ref user_agent) = configuration.user_agent {
5482 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5483 }
5484 if let Some(ref token) = configuration.bearer_access_token {
5485 req_builder = req_builder.bearer_auth(token.to_owned());
5486 };
5487
5488 let req = req_builder.build()?;
5489 let resp = configuration.client.execute(req).await?;
5490
5491 let status = resp.status();
5492 let content_type = resp
5493 .headers()
5494 .get("content-type")
5495 .and_then(|v| v.to_str().ok())
5496 .unwrap_or("application/octet-stream");
5497 let content_type = super::ContentType::from(content_type);
5498
5499 if !status.is_client_error() && !status.is_server_error() {
5500 let content = resp.text().await?;
5501 match content_type {
5502 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5503 ContentType::Text => {
5504 return Err(Error::from(serde_json::Error::custom(
5505 "Received `text/plain` content type response that cannot be converted to `models::SyncStatus`",
5506 )))
5507 }
5508 ContentType::Unsupported(unknown_type) => {
5509 return Err(Error::from(serde_json::Error::custom(format!(
5510 "Received `{unknown_type}` content type response that cannot be converted to `models::SyncStatus`"
5511 ))))
5512 }
5513 }
5514 } else {
5515 let content = resp.text().await?;
5516 let entity: Option<SourcesLdapSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
5517 Err(Error::ResponseError(ResponseContent {
5518 status,
5519 content,
5520 entity,
5521 }))
5522 }
5523}
5524
5525pub async fn sources_ldap_update(
5527 configuration: &configuration::Configuration,
5528 slug: &str,
5529 ldap_source_request: models::LdapSourceRequest,
5530) -> Result<models::LdapSource, Error<SourcesLdapUpdateError>> {
5531 let p_path_slug = slug;
5533 let p_body_ldap_source_request = ldap_source_request;
5534
5535 let uri_str = format!(
5536 "{}/sources/ldap/{slug}/",
5537 configuration.base_path,
5538 slug = crate::apis::urlencode(p_path_slug)
5539 );
5540 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5541
5542 if let Some(ref user_agent) = configuration.user_agent {
5543 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5544 }
5545 if let Some(ref token) = configuration.bearer_access_token {
5546 req_builder = req_builder.bearer_auth(token.to_owned());
5547 };
5548 req_builder = req_builder.json(&p_body_ldap_source_request);
5549
5550 let req = req_builder.build()?;
5551 let resp = configuration.client.execute(req).await?;
5552
5553 let status = resp.status();
5554 let content_type = resp
5555 .headers()
5556 .get("content-type")
5557 .and_then(|v| v.to_str().ok())
5558 .unwrap_or("application/octet-stream");
5559 let content_type = super::ContentType::from(content_type);
5560
5561 if !status.is_client_error() && !status.is_server_error() {
5562 let content = resp.text().await?;
5563 match content_type {
5564 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5565 ContentType::Text => {
5566 return Err(Error::from(serde_json::Error::custom(
5567 "Received `text/plain` content type response that cannot be converted to `models::LdapSource`",
5568 )))
5569 }
5570 ContentType::Unsupported(unknown_type) => {
5571 return Err(Error::from(serde_json::Error::custom(format!(
5572 "Received `{unknown_type}` content type response that cannot be converted to `models::LdapSource`"
5573 ))))
5574 }
5575 }
5576 } else {
5577 let content = resp.text().await?;
5578 let entity: Option<SourcesLdapUpdateError> = serde_json::from_str(&content).ok();
5579 Err(Error::ResponseError(ResponseContent {
5580 status,
5581 content,
5582 entity,
5583 }))
5584 }
5585}
5586
5587pub async fn sources_ldap_used_by_list(
5589 configuration: &configuration::Configuration,
5590 slug: &str,
5591) -> Result<Vec<models::UsedBy>, Error<SourcesLdapUsedByListError>> {
5592 let p_path_slug = slug;
5594
5595 let uri_str = format!(
5596 "{}/sources/ldap/{slug}/used_by/",
5597 configuration.base_path,
5598 slug = crate::apis::urlencode(p_path_slug)
5599 );
5600 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5601
5602 if let Some(ref user_agent) = configuration.user_agent {
5603 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5604 }
5605 if let Some(ref token) = configuration.bearer_access_token {
5606 req_builder = req_builder.bearer_auth(token.to_owned());
5607 };
5608
5609 let req = req_builder.build()?;
5610 let resp = configuration.client.execute(req).await?;
5611
5612 let status = resp.status();
5613 let content_type = resp
5614 .headers()
5615 .get("content-type")
5616 .and_then(|v| v.to_str().ok())
5617 .unwrap_or("application/octet-stream");
5618 let content_type = super::ContentType::from(content_type);
5619
5620 if !status.is_client_error() && !status.is_server_error() {
5621 let content = resp.text().await?;
5622 match content_type {
5623 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5624 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
5625 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
5626 }
5627 } else {
5628 let content = resp.text().await?;
5629 let entity: Option<SourcesLdapUsedByListError> = serde_json::from_str(&content).ok();
5630 Err(Error::ResponseError(ResponseContent {
5631 status,
5632 content,
5633 entity,
5634 }))
5635 }
5636}
5637
5638pub async fn sources_oauth_create(
5640 configuration: &configuration::Configuration,
5641 o_auth_source_request: models::OAuthSourceRequest,
5642) -> Result<models::OAuthSource, Error<SourcesOauthCreateError>> {
5643 let p_body_o_auth_source_request = o_auth_source_request;
5645
5646 let uri_str = format!("{}/sources/oauth/", configuration.base_path);
5647 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5648
5649 if let Some(ref user_agent) = configuration.user_agent {
5650 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5651 }
5652 if let Some(ref token) = configuration.bearer_access_token {
5653 req_builder = req_builder.bearer_auth(token.to_owned());
5654 };
5655 req_builder = req_builder.json(&p_body_o_auth_source_request);
5656
5657 let req = req_builder.build()?;
5658 let resp = configuration.client.execute(req).await?;
5659
5660 let status = resp.status();
5661 let content_type = resp
5662 .headers()
5663 .get("content-type")
5664 .and_then(|v| v.to_str().ok())
5665 .unwrap_or("application/octet-stream");
5666 let content_type = super::ContentType::from(content_type);
5667
5668 if !status.is_client_error() && !status.is_server_error() {
5669 let content = resp.text().await?;
5670 match content_type {
5671 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5672 ContentType::Text => {
5673 return Err(Error::from(serde_json::Error::custom(
5674 "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5675 )))
5676 }
5677 ContentType::Unsupported(unknown_type) => {
5678 return Err(Error::from(serde_json::Error::custom(format!(
5679 "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5680 ))))
5681 }
5682 }
5683 } else {
5684 let content = resp.text().await?;
5685 let entity: Option<SourcesOauthCreateError> = serde_json::from_str(&content).ok();
5686 Err(Error::ResponseError(ResponseContent {
5687 status,
5688 content,
5689 entity,
5690 }))
5691 }
5692}
5693
5694pub async fn sources_oauth_destroy(
5696 configuration: &configuration::Configuration,
5697 slug: &str,
5698) -> Result<(), Error<SourcesOauthDestroyError>> {
5699 let p_path_slug = slug;
5701
5702 let uri_str = format!(
5703 "{}/sources/oauth/{slug}/",
5704 configuration.base_path,
5705 slug = crate::apis::urlencode(p_path_slug)
5706 );
5707 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5708
5709 if let Some(ref user_agent) = configuration.user_agent {
5710 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5711 }
5712 if let Some(ref token) = configuration.bearer_access_token {
5713 req_builder = req_builder.bearer_auth(token.to_owned());
5714 };
5715
5716 let req = req_builder.build()?;
5717 let resp = configuration.client.execute(req).await?;
5718
5719 let status = resp.status();
5720
5721 if !status.is_client_error() && !status.is_server_error() {
5722 Ok(())
5723 } else {
5724 let content = resp.text().await?;
5725 let entity: Option<SourcesOauthDestroyError> = serde_json::from_str(&content).ok();
5726 Err(Error::ResponseError(ResponseContent {
5727 status,
5728 content,
5729 entity,
5730 }))
5731 }
5732}
5733
5734pub async fn sources_oauth_list(
5736 configuration: &configuration::Configuration,
5737 access_token_url: Option<&str>,
5738 additional_scopes: Option<&str>,
5739 authentication_flow: Option<&str>,
5740 authorization_url: Option<&str>,
5741 consumer_key: Option<&str>,
5742 enabled: Option<bool>,
5743 enrollment_flow: Option<&str>,
5744 group_matching_mode: Option<&str>,
5745 has_jwks: Option<bool>,
5746 name: Option<&str>,
5747 ordering: Option<&str>,
5748 page: Option<i32>,
5749 page_size: Option<i32>,
5750 pbm_uuid: Option<&str>,
5751 policy_engine_mode: Option<&str>,
5752 profile_url: Option<&str>,
5753 provider_type: Option<&str>,
5754 request_token_url: Option<&str>,
5755 search: Option<&str>,
5756 slug: Option<&str>,
5757 user_matching_mode: Option<&str>,
5758) -> Result<models::PaginatedOAuthSourceList, Error<SourcesOauthListError>> {
5759 let p_query_access_token_url = access_token_url;
5761 let p_query_additional_scopes = additional_scopes;
5762 let p_query_authentication_flow = authentication_flow;
5763 let p_query_authorization_url = authorization_url;
5764 let p_query_consumer_key = consumer_key;
5765 let p_query_enabled = enabled;
5766 let p_query_enrollment_flow = enrollment_flow;
5767 let p_query_group_matching_mode = group_matching_mode;
5768 let p_query_has_jwks = has_jwks;
5769 let p_query_name = name;
5770 let p_query_ordering = ordering;
5771 let p_query_page = page;
5772 let p_query_page_size = page_size;
5773 let p_query_pbm_uuid = pbm_uuid;
5774 let p_query_policy_engine_mode = policy_engine_mode;
5775 let p_query_profile_url = profile_url;
5776 let p_query_provider_type = provider_type;
5777 let p_query_request_token_url = request_token_url;
5778 let p_query_search = search;
5779 let p_query_slug = slug;
5780 let p_query_user_matching_mode = user_matching_mode;
5781
5782 let uri_str = format!("{}/sources/oauth/", configuration.base_path);
5783 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5784
5785 if let Some(ref param_value) = p_query_access_token_url {
5786 req_builder = req_builder.query(&[("access_token_url", ¶m_value.to_string())]);
5787 }
5788 if let Some(ref param_value) = p_query_additional_scopes {
5789 req_builder = req_builder.query(&[("additional_scopes", ¶m_value.to_string())]);
5790 }
5791 if let Some(ref param_value) = p_query_authentication_flow {
5792 req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]);
5793 }
5794 if let Some(ref param_value) = p_query_authorization_url {
5795 req_builder = req_builder.query(&[("authorization_url", ¶m_value.to_string())]);
5796 }
5797 if let Some(ref param_value) = p_query_consumer_key {
5798 req_builder = req_builder.query(&[("consumer_key", ¶m_value.to_string())]);
5799 }
5800 if let Some(ref param_value) = p_query_enabled {
5801 req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]);
5802 }
5803 if let Some(ref param_value) = p_query_enrollment_flow {
5804 req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]);
5805 }
5806 if let Some(ref param_value) = p_query_group_matching_mode {
5807 req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]);
5808 }
5809 if let Some(ref param_value) = p_query_has_jwks {
5810 req_builder = req_builder.query(&[("has_jwks", ¶m_value.to_string())]);
5811 }
5812 if let Some(ref param_value) = p_query_name {
5813 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
5814 }
5815 if let Some(ref param_value) = p_query_ordering {
5816 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
5817 }
5818 if let Some(ref param_value) = p_query_page {
5819 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
5820 }
5821 if let Some(ref param_value) = p_query_page_size {
5822 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
5823 }
5824 if let Some(ref param_value) = p_query_pbm_uuid {
5825 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
5826 }
5827 if let Some(ref param_value) = p_query_policy_engine_mode {
5828 req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]);
5829 }
5830 if let Some(ref param_value) = p_query_profile_url {
5831 req_builder = req_builder.query(&[("profile_url", ¶m_value.to_string())]);
5832 }
5833 if let Some(ref param_value) = p_query_provider_type {
5834 req_builder = req_builder.query(&[("provider_type", ¶m_value.to_string())]);
5835 }
5836 if let Some(ref param_value) = p_query_request_token_url {
5837 req_builder = req_builder.query(&[("request_token_url", ¶m_value.to_string())]);
5838 }
5839 if let Some(ref param_value) = p_query_search {
5840 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
5841 }
5842 if let Some(ref param_value) = p_query_slug {
5843 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
5844 }
5845 if let Some(ref param_value) = p_query_user_matching_mode {
5846 req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]);
5847 }
5848 if let Some(ref user_agent) = configuration.user_agent {
5849 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5850 }
5851 if let Some(ref token) = configuration.bearer_access_token {
5852 req_builder = req_builder.bearer_auth(token.to_owned());
5853 };
5854
5855 let req = req_builder.build()?;
5856 let resp = configuration.client.execute(req).await?;
5857
5858 let status = resp.status();
5859 let content_type = resp
5860 .headers()
5861 .get("content-type")
5862 .and_then(|v| v.to_str().ok())
5863 .unwrap_or("application/octet-stream");
5864 let content_type = super::ContentType::from(content_type);
5865
5866 if !status.is_client_error() && !status.is_server_error() {
5867 let content = resp.text().await?;
5868 match content_type {
5869 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5870 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOAuthSourceList`"))),
5871 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedOAuthSourceList`")))),
5872 }
5873 } else {
5874 let content = resp.text().await?;
5875 let entity: Option<SourcesOauthListError> = serde_json::from_str(&content).ok();
5876 Err(Error::ResponseError(ResponseContent {
5877 status,
5878 content,
5879 entity,
5880 }))
5881 }
5882}
5883
5884pub async fn sources_oauth_partial_update(
5886 configuration: &configuration::Configuration,
5887 slug: &str,
5888 patched_o_auth_source_request: Option<models::PatchedOAuthSourceRequest>,
5889) -> Result<models::OAuthSource, Error<SourcesOauthPartialUpdateError>> {
5890 let p_path_slug = slug;
5892 let p_body_patched_o_auth_source_request = patched_o_auth_source_request;
5893
5894 let uri_str = format!(
5895 "{}/sources/oauth/{slug}/",
5896 configuration.base_path,
5897 slug = crate::apis::urlencode(p_path_slug)
5898 );
5899 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5900
5901 if let Some(ref user_agent) = configuration.user_agent {
5902 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5903 }
5904 if let Some(ref token) = configuration.bearer_access_token {
5905 req_builder = req_builder.bearer_auth(token.to_owned());
5906 };
5907 req_builder = req_builder.json(&p_body_patched_o_auth_source_request);
5908
5909 let req = req_builder.build()?;
5910 let resp = configuration.client.execute(req).await?;
5911
5912 let status = resp.status();
5913 let content_type = resp
5914 .headers()
5915 .get("content-type")
5916 .and_then(|v| v.to_str().ok())
5917 .unwrap_or("application/octet-stream");
5918 let content_type = super::ContentType::from(content_type);
5919
5920 if !status.is_client_error() && !status.is_server_error() {
5921 let content = resp.text().await?;
5922 match content_type {
5923 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5924 ContentType::Text => {
5925 return Err(Error::from(serde_json::Error::custom(
5926 "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5927 )))
5928 }
5929 ContentType::Unsupported(unknown_type) => {
5930 return Err(Error::from(serde_json::Error::custom(format!(
5931 "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5932 ))))
5933 }
5934 }
5935 } else {
5936 let content = resp.text().await?;
5937 let entity: Option<SourcesOauthPartialUpdateError> = serde_json::from_str(&content).ok();
5938 Err(Error::ResponseError(ResponseContent {
5939 status,
5940 content,
5941 entity,
5942 }))
5943 }
5944}
5945
5946pub async fn sources_oauth_retrieve(
5948 configuration: &configuration::Configuration,
5949 slug: &str,
5950) -> Result<models::OAuthSource, Error<SourcesOauthRetrieveError>> {
5951 let p_path_slug = slug;
5953
5954 let uri_str = format!(
5955 "{}/sources/oauth/{slug}/",
5956 configuration.base_path,
5957 slug = crate::apis::urlencode(p_path_slug)
5958 );
5959 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5960
5961 if let Some(ref user_agent) = configuration.user_agent {
5962 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5963 }
5964 if let Some(ref token) = configuration.bearer_access_token {
5965 req_builder = req_builder.bearer_auth(token.to_owned());
5966 };
5967
5968 let req = req_builder.build()?;
5969 let resp = configuration.client.execute(req).await?;
5970
5971 let status = resp.status();
5972 let content_type = resp
5973 .headers()
5974 .get("content-type")
5975 .and_then(|v| v.to_str().ok())
5976 .unwrap_or("application/octet-stream");
5977 let content_type = super::ContentType::from(content_type);
5978
5979 if !status.is_client_error() && !status.is_server_error() {
5980 let content = resp.text().await?;
5981 match content_type {
5982 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5983 ContentType::Text => {
5984 return Err(Error::from(serde_json::Error::custom(
5985 "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
5986 )))
5987 }
5988 ContentType::Unsupported(unknown_type) => {
5989 return Err(Error::from(serde_json::Error::custom(format!(
5990 "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
5991 ))))
5992 }
5993 }
5994 } else {
5995 let content = resp.text().await?;
5996 let entity: Option<SourcesOauthRetrieveError> = serde_json::from_str(&content).ok();
5997 Err(Error::ResponseError(ResponseContent {
5998 status,
5999 content,
6000 entity,
6001 }))
6002 }
6003}
6004
6005pub async fn sources_oauth_source_types_list(
6007 configuration: &configuration::Configuration,
6008 name: Option<&str>,
6009) -> Result<Vec<models::SourceType>, Error<SourcesOauthSourceTypesListError>> {
6010 let p_query_name = name;
6012
6013 let uri_str = format!("{}/sources/oauth/source_types/", configuration.base_path);
6014 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6015
6016 if let Some(ref param_value) = p_query_name {
6017 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
6018 }
6019 if let Some(ref user_agent) = configuration.user_agent {
6020 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6021 }
6022 if let Some(ref token) = configuration.bearer_access_token {
6023 req_builder = req_builder.bearer_auth(token.to_owned());
6024 };
6025
6026 let req = req_builder.build()?;
6027 let resp = configuration.client.execute(req).await?;
6028
6029 let status = resp.status();
6030 let content_type = resp
6031 .headers()
6032 .get("content-type")
6033 .and_then(|v| v.to_str().ok())
6034 .unwrap_or("application/octet-stream");
6035 let content_type = super::ContentType::from(content_type);
6036
6037 if !status.is_client_error() && !status.is_server_error() {
6038 let content = resp.text().await?;
6039 match content_type {
6040 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6041 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::SourceType>`"))),
6042 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::SourceType>`")))),
6043 }
6044 } else {
6045 let content = resp.text().await?;
6046 let entity: Option<SourcesOauthSourceTypesListError> = serde_json::from_str(&content).ok();
6047 Err(Error::ResponseError(ResponseContent {
6048 status,
6049 content,
6050 entity,
6051 }))
6052 }
6053}
6054
6055pub async fn sources_oauth_update(
6057 configuration: &configuration::Configuration,
6058 slug: &str,
6059 o_auth_source_request: models::OAuthSourceRequest,
6060) -> Result<models::OAuthSource, Error<SourcesOauthUpdateError>> {
6061 let p_path_slug = slug;
6063 let p_body_o_auth_source_request = o_auth_source_request;
6064
6065 let uri_str = format!(
6066 "{}/sources/oauth/{slug}/",
6067 configuration.base_path,
6068 slug = crate::apis::urlencode(p_path_slug)
6069 );
6070 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6071
6072 if let Some(ref user_agent) = configuration.user_agent {
6073 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6074 }
6075 if let Some(ref token) = configuration.bearer_access_token {
6076 req_builder = req_builder.bearer_auth(token.to_owned());
6077 };
6078 req_builder = req_builder.json(&p_body_o_auth_source_request);
6079
6080 let req = req_builder.build()?;
6081 let resp = configuration.client.execute(req).await?;
6082
6083 let status = resp.status();
6084 let content_type = resp
6085 .headers()
6086 .get("content-type")
6087 .and_then(|v| v.to_str().ok())
6088 .unwrap_or("application/octet-stream");
6089 let content_type = super::ContentType::from(content_type);
6090
6091 if !status.is_client_error() && !status.is_server_error() {
6092 let content = resp.text().await?;
6093 match content_type {
6094 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6095 ContentType::Text => {
6096 return Err(Error::from(serde_json::Error::custom(
6097 "Received `text/plain` content type response that cannot be converted to `models::OAuthSource`",
6098 )))
6099 }
6100 ContentType::Unsupported(unknown_type) => {
6101 return Err(Error::from(serde_json::Error::custom(format!(
6102 "Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSource`"
6103 ))))
6104 }
6105 }
6106 } else {
6107 let content = resp.text().await?;
6108 let entity: Option<SourcesOauthUpdateError> = serde_json::from_str(&content).ok();
6109 Err(Error::ResponseError(ResponseContent {
6110 status,
6111 content,
6112 entity,
6113 }))
6114 }
6115}
6116
6117pub async fn sources_oauth_used_by_list(
6119 configuration: &configuration::Configuration,
6120 slug: &str,
6121) -> Result<Vec<models::UsedBy>, Error<SourcesOauthUsedByListError>> {
6122 let p_path_slug = slug;
6124
6125 let uri_str = format!(
6126 "{}/sources/oauth/{slug}/used_by/",
6127 configuration.base_path,
6128 slug = crate::apis::urlencode(p_path_slug)
6129 );
6130 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6131
6132 if let Some(ref user_agent) = configuration.user_agent {
6133 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6134 }
6135 if let Some(ref token) = configuration.bearer_access_token {
6136 req_builder = req_builder.bearer_auth(token.to_owned());
6137 };
6138
6139 let req = req_builder.build()?;
6140 let resp = configuration.client.execute(req).await?;
6141
6142 let status = resp.status();
6143 let content_type = resp
6144 .headers()
6145 .get("content-type")
6146 .and_then(|v| v.to_str().ok())
6147 .unwrap_or("application/octet-stream");
6148 let content_type = super::ContentType::from(content_type);
6149
6150 if !status.is_client_error() && !status.is_server_error() {
6151 let content = resp.text().await?;
6152 match content_type {
6153 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6154 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
6155 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
6156 }
6157 } else {
6158 let content = resp.text().await?;
6159 let entity: Option<SourcesOauthUsedByListError> = serde_json::from_str(&content).ok();
6160 Err(Error::ResponseError(ResponseContent {
6161 status,
6162 content,
6163 entity,
6164 }))
6165 }
6166}
6167
6168pub async fn sources_plex_create(
6170 configuration: &configuration::Configuration,
6171 plex_source_request: models::PlexSourceRequest,
6172) -> Result<models::PlexSource, Error<SourcesPlexCreateError>> {
6173 let p_body_plex_source_request = plex_source_request;
6175
6176 let uri_str = format!("{}/sources/plex/", configuration.base_path);
6177 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6178
6179 if let Some(ref user_agent) = configuration.user_agent {
6180 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6181 }
6182 if let Some(ref token) = configuration.bearer_access_token {
6183 req_builder = req_builder.bearer_auth(token.to_owned());
6184 };
6185 req_builder = req_builder.json(&p_body_plex_source_request);
6186
6187 let req = req_builder.build()?;
6188 let resp = configuration.client.execute(req).await?;
6189
6190 let status = resp.status();
6191 let content_type = resp
6192 .headers()
6193 .get("content-type")
6194 .and_then(|v| v.to_str().ok())
6195 .unwrap_or("application/octet-stream");
6196 let content_type = super::ContentType::from(content_type);
6197
6198 if !status.is_client_error() && !status.is_server_error() {
6199 let content = resp.text().await?;
6200 match content_type {
6201 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6202 ContentType::Text => {
6203 return Err(Error::from(serde_json::Error::custom(
6204 "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6205 )))
6206 }
6207 ContentType::Unsupported(unknown_type) => {
6208 return Err(Error::from(serde_json::Error::custom(format!(
6209 "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6210 ))))
6211 }
6212 }
6213 } else {
6214 let content = resp.text().await?;
6215 let entity: Option<SourcesPlexCreateError> = serde_json::from_str(&content).ok();
6216 Err(Error::ResponseError(ResponseContent {
6217 status,
6218 content,
6219 entity,
6220 }))
6221 }
6222}
6223
6224pub async fn sources_plex_destroy(
6226 configuration: &configuration::Configuration,
6227 slug: &str,
6228) -> Result<(), Error<SourcesPlexDestroyError>> {
6229 let p_path_slug = slug;
6231
6232 let uri_str = format!(
6233 "{}/sources/plex/{slug}/",
6234 configuration.base_path,
6235 slug = crate::apis::urlencode(p_path_slug)
6236 );
6237 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6238
6239 if let Some(ref user_agent) = configuration.user_agent {
6240 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6241 }
6242 if let Some(ref token) = configuration.bearer_access_token {
6243 req_builder = req_builder.bearer_auth(token.to_owned());
6244 };
6245
6246 let req = req_builder.build()?;
6247 let resp = configuration.client.execute(req).await?;
6248
6249 let status = resp.status();
6250
6251 if !status.is_client_error() && !status.is_server_error() {
6252 Ok(())
6253 } else {
6254 let content = resp.text().await?;
6255 let entity: Option<SourcesPlexDestroyError> = serde_json::from_str(&content).ok();
6256 Err(Error::ResponseError(ResponseContent {
6257 status,
6258 content,
6259 entity,
6260 }))
6261 }
6262}
6263
6264pub async fn sources_plex_list(
6266 configuration: &configuration::Configuration,
6267 allow_friends: Option<bool>,
6268 authentication_flow: Option<&str>,
6269 client_id: Option<&str>,
6270 enabled: Option<bool>,
6271 enrollment_flow: Option<&str>,
6272 group_matching_mode: Option<&str>,
6273 name: Option<&str>,
6274 ordering: Option<&str>,
6275 page: Option<i32>,
6276 page_size: Option<i32>,
6277 pbm_uuid: Option<&str>,
6278 policy_engine_mode: Option<&str>,
6279 search: Option<&str>,
6280 slug: Option<&str>,
6281 user_matching_mode: Option<&str>,
6282) -> Result<models::PaginatedPlexSourceList, Error<SourcesPlexListError>> {
6283 let p_query_allow_friends = allow_friends;
6285 let p_query_authentication_flow = authentication_flow;
6286 let p_query_client_id = client_id;
6287 let p_query_enabled = enabled;
6288 let p_query_enrollment_flow = enrollment_flow;
6289 let p_query_group_matching_mode = group_matching_mode;
6290 let p_query_name = name;
6291 let p_query_ordering = ordering;
6292 let p_query_page = page;
6293 let p_query_page_size = page_size;
6294 let p_query_pbm_uuid = pbm_uuid;
6295 let p_query_policy_engine_mode = policy_engine_mode;
6296 let p_query_search = search;
6297 let p_query_slug = slug;
6298 let p_query_user_matching_mode = user_matching_mode;
6299
6300 let uri_str = format!("{}/sources/plex/", configuration.base_path);
6301 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6302
6303 if let Some(ref param_value) = p_query_allow_friends {
6304 req_builder = req_builder.query(&[("allow_friends", ¶m_value.to_string())]);
6305 }
6306 if let Some(ref param_value) = p_query_authentication_flow {
6307 req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]);
6308 }
6309 if let Some(ref param_value) = p_query_client_id {
6310 req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]);
6311 }
6312 if let Some(ref param_value) = p_query_enabled {
6313 req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]);
6314 }
6315 if let Some(ref param_value) = p_query_enrollment_flow {
6316 req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]);
6317 }
6318 if let Some(ref param_value) = p_query_group_matching_mode {
6319 req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]);
6320 }
6321 if let Some(ref param_value) = p_query_name {
6322 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
6323 }
6324 if let Some(ref param_value) = p_query_ordering {
6325 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
6326 }
6327 if let Some(ref param_value) = p_query_page {
6328 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
6329 }
6330 if let Some(ref param_value) = p_query_page_size {
6331 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
6332 }
6333 if let Some(ref param_value) = p_query_pbm_uuid {
6334 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
6335 }
6336 if let Some(ref param_value) = p_query_policy_engine_mode {
6337 req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]);
6338 }
6339 if let Some(ref param_value) = p_query_search {
6340 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
6341 }
6342 if let Some(ref param_value) = p_query_slug {
6343 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
6344 }
6345 if let Some(ref param_value) = p_query_user_matching_mode {
6346 req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]);
6347 }
6348 if let Some(ref user_agent) = configuration.user_agent {
6349 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6350 }
6351 if let Some(ref token) = configuration.bearer_access_token {
6352 req_builder = req_builder.bearer_auth(token.to_owned());
6353 };
6354
6355 let req = req_builder.build()?;
6356 let resp = configuration.client.execute(req).await?;
6357
6358 let status = resp.status();
6359 let content_type = resp
6360 .headers()
6361 .get("content-type")
6362 .and_then(|v| v.to_str().ok())
6363 .unwrap_or("application/octet-stream");
6364 let content_type = super::ContentType::from(content_type);
6365
6366 if !status.is_client_error() && !status.is_server_error() {
6367 let content = resp.text().await?;
6368 match content_type {
6369 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6370 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPlexSourceList`"))),
6371 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPlexSourceList`")))),
6372 }
6373 } else {
6374 let content = resp.text().await?;
6375 let entity: Option<SourcesPlexListError> = serde_json::from_str(&content).ok();
6376 Err(Error::ResponseError(ResponseContent {
6377 status,
6378 content,
6379 entity,
6380 }))
6381 }
6382}
6383
6384pub async fn sources_plex_partial_update(
6386 configuration: &configuration::Configuration,
6387 slug: &str,
6388 patched_plex_source_request: Option<models::PatchedPlexSourceRequest>,
6389) -> Result<models::PlexSource, Error<SourcesPlexPartialUpdateError>> {
6390 let p_path_slug = slug;
6392 let p_body_patched_plex_source_request = patched_plex_source_request;
6393
6394 let uri_str = format!(
6395 "{}/sources/plex/{slug}/",
6396 configuration.base_path,
6397 slug = crate::apis::urlencode(p_path_slug)
6398 );
6399 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6400
6401 if let Some(ref user_agent) = configuration.user_agent {
6402 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6403 }
6404 if let Some(ref token) = configuration.bearer_access_token {
6405 req_builder = req_builder.bearer_auth(token.to_owned());
6406 };
6407 req_builder = req_builder.json(&p_body_patched_plex_source_request);
6408
6409 let req = req_builder.build()?;
6410 let resp = configuration.client.execute(req).await?;
6411
6412 let status = resp.status();
6413 let content_type = resp
6414 .headers()
6415 .get("content-type")
6416 .and_then(|v| v.to_str().ok())
6417 .unwrap_or("application/octet-stream");
6418 let content_type = super::ContentType::from(content_type);
6419
6420 if !status.is_client_error() && !status.is_server_error() {
6421 let content = resp.text().await?;
6422 match content_type {
6423 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6424 ContentType::Text => {
6425 return Err(Error::from(serde_json::Error::custom(
6426 "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6427 )))
6428 }
6429 ContentType::Unsupported(unknown_type) => {
6430 return Err(Error::from(serde_json::Error::custom(format!(
6431 "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6432 ))))
6433 }
6434 }
6435 } else {
6436 let content = resp.text().await?;
6437 let entity: Option<SourcesPlexPartialUpdateError> = serde_json::from_str(&content).ok();
6438 Err(Error::ResponseError(ResponseContent {
6439 status,
6440 content,
6441 entity,
6442 }))
6443 }
6444}
6445
6446pub async fn sources_plex_redeem_token_authenticated_create(
6448 configuration: &configuration::Configuration,
6449 plex_token_redeem_request: models::PlexTokenRedeemRequest,
6450 slug: Option<&str>,
6451) -> Result<(), Error<SourcesPlexRedeemTokenAuthenticatedCreateError>> {
6452 let p_body_plex_token_redeem_request = plex_token_redeem_request;
6454 let p_query_slug = slug;
6455
6456 let uri_str = format!("{}/sources/plex/redeem_token_authenticated/", configuration.base_path);
6457 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6458
6459 if let Some(ref param_value) = p_query_slug {
6460 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
6461 }
6462 if let Some(ref user_agent) = configuration.user_agent {
6463 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6464 }
6465 if let Some(ref token) = configuration.bearer_access_token {
6466 req_builder = req_builder.bearer_auth(token.to_owned());
6467 };
6468 req_builder = req_builder.json(&p_body_plex_token_redeem_request);
6469
6470 let req = req_builder.build()?;
6471 let resp = configuration.client.execute(req).await?;
6472
6473 let status = resp.status();
6474
6475 if !status.is_client_error() && !status.is_server_error() {
6476 Ok(())
6477 } else {
6478 let content = resp.text().await?;
6479 let entity: Option<SourcesPlexRedeemTokenAuthenticatedCreateError> = serde_json::from_str(&content).ok();
6480 Err(Error::ResponseError(ResponseContent {
6481 status,
6482 content,
6483 entity,
6484 }))
6485 }
6486}
6487
6488pub async fn sources_plex_redeem_token_create(
6490 configuration: &configuration::Configuration,
6491 plex_token_redeem_request: models::PlexTokenRedeemRequest,
6492 slug: Option<&str>,
6493) -> Result<models::RedirectChallenge, Error<SourcesPlexRedeemTokenCreateError>> {
6494 let p_body_plex_token_redeem_request = plex_token_redeem_request;
6496 let p_query_slug = slug;
6497
6498 let uri_str = format!("{}/sources/plex/redeem_token/", configuration.base_path);
6499 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6500
6501 if let Some(ref param_value) = p_query_slug {
6502 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
6503 }
6504 if let Some(ref user_agent) = configuration.user_agent {
6505 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6506 }
6507 if let Some(ref token) = configuration.bearer_access_token {
6508 req_builder = req_builder.bearer_auth(token.to_owned());
6509 };
6510 req_builder = req_builder.json(&p_body_plex_token_redeem_request);
6511
6512 let req = req_builder.build()?;
6513 let resp = configuration.client.execute(req).await?;
6514
6515 let status = resp.status();
6516 let content_type = resp
6517 .headers()
6518 .get("content-type")
6519 .and_then(|v| v.to_str().ok())
6520 .unwrap_or("application/octet-stream");
6521 let content_type = super::ContentType::from(content_type);
6522
6523 if !status.is_client_error() && !status.is_server_error() {
6524 let content = resp.text().await?;
6525 match content_type {
6526 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6527 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RedirectChallenge`"))),
6528 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RedirectChallenge`")))),
6529 }
6530 } else {
6531 let content = resp.text().await?;
6532 let entity: Option<SourcesPlexRedeemTokenCreateError> = serde_json::from_str(&content).ok();
6533 Err(Error::ResponseError(ResponseContent {
6534 status,
6535 content,
6536 entity,
6537 }))
6538 }
6539}
6540
6541pub async fn sources_plex_retrieve(
6543 configuration: &configuration::Configuration,
6544 slug: &str,
6545) -> Result<models::PlexSource, Error<SourcesPlexRetrieveError>> {
6546 let p_path_slug = slug;
6548
6549 let uri_str = format!(
6550 "{}/sources/plex/{slug}/",
6551 configuration.base_path,
6552 slug = crate::apis::urlencode(p_path_slug)
6553 );
6554 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6555
6556 if let Some(ref user_agent) = configuration.user_agent {
6557 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6558 }
6559 if let Some(ref token) = configuration.bearer_access_token {
6560 req_builder = req_builder.bearer_auth(token.to_owned());
6561 };
6562
6563 let req = req_builder.build()?;
6564 let resp = configuration.client.execute(req).await?;
6565
6566 let status = resp.status();
6567 let content_type = resp
6568 .headers()
6569 .get("content-type")
6570 .and_then(|v| v.to_str().ok())
6571 .unwrap_or("application/octet-stream");
6572 let content_type = super::ContentType::from(content_type);
6573
6574 if !status.is_client_error() && !status.is_server_error() {
6575 let content = resp.text().await?;
6576 match content_type {
6577 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6578 ContentType::Text => {
6579 return Err(Error::from(serde_json::Error::custom(
6580 "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6581 )))
6582 }
6583 ContentType::Unsupported(unknown_type) => {
6584 return Err(Error::from(serde_json::Error::custom(format!(
6585 "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6586 ))))
6587 }
6588 }
6589 } else {
6590 let content = resp.text().await?;
6591 let entity: Option<SourcesPlexRetrieveError> = serde_json::from_str(&content).ok();
6592 Err(Error::ResponseError(ResponseContent {
6593 status,
6594 content,
6595 entity,
6596 }))
6597 }
6598}
6599
6600pub async fn sources_plex_update(
6602 configuration: &configuration::Configuration,
6603 slug: &str,
6604 plex_source_request: models::PlexSourceRequest,
6605) -> Result<models::PlexSource, Error<SourcesPlexUpdateError>> {
6606 let p_path_slug = slug;
6608 let p_body_plex_source_request = plex_source_request;
6609
6610 let uri_str = format!(
6611 "{}/sources/plex/{slug}/",
6612 configuration.base_path,
6613 slug = crate::apis::urlencode(p_path_slug)
6614 );
6615 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6616
6617 if let Some(ref user_agent) = configuration.user_agent {
6618 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6619 }
6620 if let Some(ref token) = configuration.bearer_access_token {
6621 req_builder = req_builder.bearer_auth(token.to_owned());
6622 };
6623 req_builder = req_builder.json(&p_body_plex_source_request);
6624
6625 let req = req_builder.build()?;
6626 let resp = configuration.client.execute(req).await?;
6627
6628 let status = resp.status();
6629 let content_type = resp
6630 .headers()
6631 .get("content-type")
6632 .and_then(|v| v.to_str().ok())
6633 .unwrap_or("application/octet-stream");
6634 let content_type = super::ContentType::from(content_type);
6635
6636 if !status.is_client_error() && !status.is_server_error() {
6637 let content = resp.text().await?;
6638 match content_type {
6639 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6640 ContentType::Text => {
6641 return Err(Error::from(serde_json::Error::custom(
6642 "Received `text/plain` content type response that cannot be converted to `models::PlexSource`",
6643 )))
6644 }
6645 ContentType::Unsupported(unknown_type) => {
6646 return Err(Error::from(serde_json::Error::custom(format!(
6647 "Received `{unknown_type}` content type response that cannot be converted to `models::PlexSource`"
6648 ))))
6649 }
6650 }
6651 } else {
6652 let content = resp.text().await?;
6653 let entity: Option<SourcesPlexUpdateError> = serde_json::from_str(&content).ok();
6654 Err(Error::ResponseError(ResponseContent {
6655 status,
6656 content,
6657 entity,
6658 }))
6659 }
6660}
6661
6662pub async fn sources_plex_used_by_list(
6664 configuration: &configuration::Configuration,
6665 slug: &str,
6666) -> Result<Vec<models::UsedBy>, Error<SourcesPlexUsedByListError>> {
6667 let p_path_slug = slug;
6669
6670 let uri_str = format!(
6671 "{}/sources/plex/{slug}/used_by/",
6672 configuration.base_path,
6673 slug = crate::apis::urlencode(p_path_slug)
6674 );
6675 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6676
6677 if let Some(ref user_agent) = configuration.user_agent {
6678 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6679 }
6680 if let Some(ref token) = configuration.bearer_access_token {
6681 req_builder = req_builder.bearer_auth(token.to_owned());
6682 };
6683
6684 let req = req_builder.build()?;
6685 let resp = configuration.client.execute(req).await?;
6686
6687 let status = resp.status();
6688 let content_type = resp
6689 .headers()
6690 .get("content-type")
6691 .and_then(|v| v.to_str().ok())
6692 .unwrap_or("application/octet-stream");
6693 let content_type = super::ContentType::from(content_type);
6694
6695 if !status.is_client_error() && !status.is_server_error() {
6696 let content = resp.text().await?;
6697 match content_type {
6698 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6699 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
6700 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
6701 }
6702 } else {
6703 let content = resp.text().await?;
6704 let entity: Option<SourcesPlexUsedByListError> = serde_json::from_str(&content).ok();
6705 Err(Error::ResponseError(ResponseContent {
6706 status,
6707 content,
6708 entity,
6709 }))
6710 }
6711}
6712
6713pub async fn sources_saml_create(
6715 configuration: &configuration::Configuration,
6716 saml_source_request: models::SamlSourceRequest,
6717) -> Result<models::SamlSource, Error<SourcesSamlCreateError>> {
6718 let p_body_saml_source_request = saml_source_request;
6720
6721 let uri_str = format!("{}/sources/saml/", configuration.base_path);
6722 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6723
6724 if let Some(ref user_agent) = configuration.user_agent {
6725 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6726 }
6727 if let Some(ref token) = configuration.bearer_access_token {
6728 req_builder = req_builder.bearer_auth(token.to_owned());
6729 };
6730 req_builder = req_builder.json(&p_body_saml_source_request);
6731
6732 let req = req_builder.build()?;
6733 let resp = configuration.client.execute(req).await?;
6734
6735 let status = resp.status();
6736 let content_type = resp
6737 .headers()
6738 .get("content-type")
6739 .and_then(|v| v.to_str().ok())
6740 .unwrap_or("application/octet-stream");
6741 let content_type = super::ContentType::from(content_type);
6742
6743 if !status.is_client_error() && !status.is_server_error() {
6744 let content = resp.text().await?;
6745 match content_type {
6746 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6747 ContentType::Text => {
6748 return Err(Error::from(serde_json::Error::custom(
6749 "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
6750 )))
6751 }
6752 ContentType::Unsupported(unknown_type) => {
6753 return Err(Error::from(serde_json::Error::custom(format!(
6754 "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
6755 ))))
6756 }
6757 }
6758 } else {
6759 let content = resp.text().await?;
6760 let entity: Option<SourcesSamlCreateError> = serde_json::from_str(&content).ok();
6761 Err(Error::ResponseError(ResponseContent {
6762 status,
6763 content,
6764 entity,
6765 }))
6766 }
6767}
6768
6769pub async fn sources_saml_destroy(
6771 configuration: &configuration::Configuration,
6772 slug: &str,
6773) -> Result<(), Error<SourcesSamlDestroyError>> {
6774 let p_path_slug = slug;
6776
6777 let uri_str = format!(
6778 "{}/sources/saml/{slug}/",
6779 configuration.base_path,
6780 slug = crate::apis::urlencode(p_path_slug)
6781 );
6782 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6783
6784 if let Some(ref user_agent) = configuration.user_agent {
6785 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6786 }
6787 if let Some(ref token) = configuration.bearer_access_token {
6788 req_builder = req_builder.bearer_auth(token.to_owned());
6789 };
6790
6791 let req = req_builder.build()?;
6792 let resp = configuration.client.execute(req).await?;
6793
6794 let status = resp.status();
6795
6796 if !status.is_client_error() && !status.is_server_error() {
6797 Ok(())
6798 } else {
6799 let content = resp.text().await?;
6800 let entity: Option<SourcesSamlDestroyError> = serde_json::from_str(&content).ok();
6801 Err(Error::ResponseError(ResponseContent {
6802 status,
6803 content,
6804 entity,
6805 }))
6806 }
6807}
6808
6809pub async fn sources_saml_list(
6811 configuration: &configuration::Configuration,
6812 allow_idp_initiated: Option<bool>,
6813 authentication_flow: Option<&str>,
6814 binding_type: Option<&str>,
6815 digest_algorithm: Option<&str>,
6816 enabled: Option<bool>,
6817 enrollment_flow: Option<&str>,
6818 issuer: Option<&str>,
6819 managed: Option<&str>,
6820 name: Option<&str>,
6821 name_id_policy: Option<&str>,
6822 ordering: Option<&str>,
6823 page: Option<i32>,
6824 page_size: Option<i32>,
6825 pbm_uuid: Option<&str>,
6826 policy_engine_mode: Option<&str>,
6827 pre_authentication_flow: Option<&str>,
6828 search: Option<&str>,
6829 signature_algorithm: Option<&str>,
6830 signed_assertion: Option<bool>,
6831 signed_response: Option<bool>,
6832 signing_kp: Option<&str>,
6833 slo_url: Option<&str>,
6834 slug: Option<&str>,
6835 sso_url: Option<&str>,
6836 temporary_user_delete_after: Option<&str>,
6837 user_matching_mode: Option<&str>,
6838 verification_kp: Option<&str>,
6839) -> Result<models::PaginatedSamlSourceList, Error<SourcesSamlListError>> {
6840 let p_query_allow_idp_initiated = allow_idp_initiated;
6842 let p_query_authentication_flow = authentication_flow;
6843 let p_query_binding_type = binding_type;
6844 let p_query_digest_algorithm = digest_algorithm;
6845 let p_query_enabled = enabled;
6846 let p_query_enrollment_flow = enrollment_flow;
6847 let p_query_issuer = issuer;
6848 let p_query_managed = managed;
6849 let p_query_name = name;
6850 let p_query_name_id_policy = name_id_policy;
6851 let p_query_ordering = ordering;
6852 let p_query_page = page;
6853 let p_query_page_size = page_size;
6854 let p_query_pbm_uuid = pbm_uuid;
6855 let p_query_policy_engine_mode = policy_engine_mode;
6856 let p_query_pre_authentication_flow = pre_authentication_flow;
6857 let p_query_search = search;
6858 let p_query_signature_algorithm = signature_algorithm;
6859 let p_query_signed_assertion = signed_assertion;
6860 let p_query_signed_response = signed_response;
6861 let p_query_signing_kp = signing_kp;
6862 let p_query_slo_url = slo_url;
6863 let p_query_slug = slug;
6864 let p_query_sso_url = sso_url;
6865 let p_query_temporary_user_delete_after = temporary_user_delete_after;
6866 let p_query_user_matching_mode = user_matching_mode;
6867 let p_query_verification_kp = verification_kp;
6868
6869 let uri_str = format!("{}/sources/saml/", configuration.base_path);
6870 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6871
6872 if let Some(ref param_value) = p_query_allow_idp_initiated {
6873 req_builder = req_builder.query(&[("allow_idp_initiated", ¶m_value.to_string())]);
6874 }
6875 if let Some(ref param_value) = p_query_authentication_flow {
6876 req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]);
6877 }
6878 if let Some(ref param_value) = p_query_binding_type {
6879 req_builder = req_builder.query(&[("binding_type", ¶m_value.to_string())]);
6880 }
6881 if let Some(ref param_value) = p_query_digest_algorithm {
6882 req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]);
6883 }
6884 if let Some(ref param_value) = p_query_enabled {
6885 req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]);
6886 }
6887 if let Some(ref param_value) = p_query_enrollment_flow {
6888 req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]);
6889 }
6890 if let Some(ref param_value) = p_query_issuer {
6891 req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]);
6892 }
6893 if let Some(ref param_value) = p_query_managed {
6894 req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]);
6895 }
6896 if let Some(ref param_value) = p_query_name {
6897 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
6898 }
6899 if let Some(ref param_value) = p_query_name_id_policy {
6900 req_builder = req_builder.query(&[("name_id_policy", ¶m_value.to_string())]);
6901 }
6902 if let Some(ref param_value) = p_query_ordering {
6903 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
6904 }
6905 if let Some(ref param_value) = p_query_page {
6906 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
6907 }
6908 if let Some(ref param_value) = p_query_page_size {
6909 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
6910 }
6911 if let Some(ref param_value) = p_query_pbm_uuid {
6912 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
6913 }
6914 if let Some(ref param_value) = p_query_policy_engine_mode {
6915 req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]);
6916 }
6917 if let Some(ref param_value) = p_query_pre_authentication_flow {
6918 req_builder = req_builder.query(&[("pre_authentication_flow", ¶m_value.to_string())]);
6919 }
6920 if let Some(ref param_value) = p_query_search {
6921 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
6922 }
6923 if let Some(ref param_value) = p_query_signature_algorithm {
6924 req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]);
6925 }
6926 if let Some(ref param_value) = p_query_signed_assertion {
6927 req_builder = req_builder.query(&[("signed_assertion", ¶m_value.to_string())]);
6928 }
6929 if let Some(ref param_value) = p_query_signed_response {
6930 req_builder = req_builder.query(&[("signed_response", ¶m_value.to_string())]);
6931 }
6932 if let Some(ref param_value) = p_query_signing_kp {
6933 req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]);
6934 }
6935 if let Some(ref param_value) = p_query_slo_url {
6936 req_builder = req_builder.query(&[("slo_url", ¶m_value.to_string())]);
6937 }
6938 if let Some(ref param_value) = p_query_slug {
6939 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
6940 }
6941 if let Some(ref param_value) = p_query_sso_url {
6942 req_builder = req_builder.query(&[("sso_url", ¶m_value.to_string())]);
6943 }
6944 if let Some(ref param_value) = p_query_temporary_user_delete_after {
6945 req_builder = req_builder.query(&[("temporary_user_delete_after", ¶m_value.to_string())]);
6946 }
6947 if let Some(ref param_value) = p_query_user_matching_mode {
6948 req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]);
6949 }
6950 if let Some(ref param_value) = p_query_verification_kp {
6951 req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]);
6952 }
6953 if let Some(ref user_agent) = configuration.user_agent {
6954 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6955 }
6956 if let Some(ref token) = configuration.bearer_access_token {
6957 req_builder = req_builder.bearer_auth(token.to_owned());
6958 };
6959
6960 let req = req_builder.build()?;
6961 let resp = configuration.client.execute(req).await?;
6962
6963 let status = resp.status();
6964 let content_type = resp
6965 .headers()
6966 .get("content-type")
6967 .and_then(|v| v.to_str().ok())
6968 .unwrap_or("application/octet-stream");
6969 let content_type = super::ContentType::from(content_type);
6970
6971 if !status.is_client_error() && !status.is_server_error() {
6972 let content = resp.text().await?;
6973 match content_type {
6974 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6975 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlSourceList`"))),
6976 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSamlSourceList`")))),
6977 }
6978 } else {
6979 let content = resp.text().await?;
6980 let entity: Option<SourcesSamlListError> = serde_json::from_str(&content).ok();
6981 Err(Error::ResponseError(ResponseContent {
6982 status,
6983 content,
6984 entity,
6985 }))
6986 }
6987}
6988
6989pub async fn sources_saml_metadata_retrieve(
6991 configuration: &configuration::Configuration,
6992 slug: &str,
6993) -> Result<models::SamlMetadata, Error<SourcesSamlMetadataRetrieveError>> {
6994 let p_path_slug = slug;
6996
6997 let uri_str = format!(
6998 "{}/sources/saml/{slug}/metadata/",
6999 configuration.base_path,
7000 slug = crate::apis::urlencode(p_path_slug)
7001 );
7002 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7003
7004 if let Some(ref user_agent) = configuration.user_agent {
7005 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7006 }
7007 if let Some(ref token) = configuration.bearer_access_token {
7008 req_builder = req_builder.bearer_auth(token.to_owned());
7009 };
7010
7011 let req = req_builder.build()?;
7012 let resp = configuration.client.execute(req).await?;
7013
7014 let status = resp.status();
7015 let content_type = resp
7016 .headers()
7017 .get("content-type")
7018 .and_then(|v| v.to_str().ok())
7019 .unwrap_or("application/octet-stream");
7020 let content_type = super::ContentType::from(content_type);
7021
7022 if !status.is_client_error() && !status.is_server_error() {
7023 let content = resp.text().await?;
7024 match content_type {
7025 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7026 ContentType::Text => {
7027 return Err(Error::from(serde_json::Error::custom(
7028 "Received `text/plain` content type response that cannot be converted to `models::SamlMetadata`",
7029 )))
7030 }
7031 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7032 "Received `{unknown_type}` content type response that cannot be converted to `models::SamlMetadata`"
7033 )))),
7034 }
7035 } else {
7036 let content = resp.text().await?;
7037 let entity: Option<SourcesSamlMetadataRetrieveError> = serde_json::from_str(&content).ok();
7038 Err(Error::ResponseError(ResponseContent {
7039 status,
7040 content,
7041 entity,
7042 }))
7043 }
7044}
7045
7046pub async fn sources_saml_partial_update(
7048 configuration: &configuration::Configuration,
7049 slug: &str,
7050 patched_saml_source_request: Option<models::PatchedSamlSourceRequest>,
7051) -> Result<models::SamlSource, Error<SourcesSamlPartialUpdateError>> {
7052 let p_path_slug = slug;
7054 let p_body_patched_saml_source_request = patched_saml_source_request;
7055
7056 let uri_str = format!(
7057 "{}/sources/saml/{slug}/",
7058 configuration.base_path,
7059 slug = crate::apis::urlencode(p_path_slug)
7060 );
7061 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7062
7063 if let Some(ref user_agent) = configuration.user_agent {
7064 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7065 }
7066 if let Some(ref token) = configuration.bearer_access_token {
7067 req_builder = req_builder.bearer_auth(token.to_owned());
7068 };
7069 req_builder = req_builder.json(&p_body_patched_saml_source_request);
7070
7071 let req = req_builder.build()?;
7072 let resp = configuration.client.execute(req).await?;
7073
7074 let status = resp.status();
7075 let content_type = resp
7076 .headers()
7077 .get("content-type")
7078 .and_then(|v| v.to_str().ok())
7079 .unwrap_or("application/octet-stream");
7080 let content_type = super::ContentType::from(content_type);
7081
7082 if !status.is_client_error() && !status.is_server_error() {
7083 let content = resp.text().await?;
7084 match content_type {
7085 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7086 ContentType::Text => {
7087 return Err(Error::from(serde_json::Error::custom(
7088 "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
7089 )))
7090 }
7091 ContentType::Unsupported(unknown_type) => {
7092 return Err(Error::from(serde_json::Error::custom(format!(
7093 "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
7094 ))))
7095 }
7096 }
7097 } else {
7098 let content = resp.text().await?;
7099 let entity: Option<SourcesSamlPartialUpdateError> = serde_json::from_str(&content).ok();
7100 Err(Error::ResponseError(ResponseContent {
7101 status,
7102 content,
7103 entity,
7104 }))
7105 }
7106}
7107
7108pub async fn sources_saml_retrieve(
7110 configuration: &configuration::Configuration,
7111 slug: &str,
7112) -> Result<models::SamlSource, Error<SourcesSamlRetrieveError>> {
7113 let p_path_slug = slug;
7115
7116 let uri_str = format!(
7117 "{}/sources/saml/{slug}/",
7118 configuration.base_path,
7119 slug = crate::apis::urlencode(p_path_slug)
7120 );
7121 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7122
7123 if let Some(ref user_agent) = configuration.user_agent {
7124 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7125 }
7126 if let Some(ref token) = configuration.bearer_access_token {
7127 req_builder = req_builder.bearer_auth(token.to_owned());
7128 };
7129
7130 let req = req_builder.build()?;
7131 let resp = configuration.client.execute(req).await?;
7132
7133 let status = resp.status();
7134 let content_type = resp
7135 .headers()
7136 .get("content-type")
7137 .and_then(|v| v.to_str().ok())
7138 .unwrap_or("application/octet-stream");
7139 let content_type = super::ContentType::from(content_type);
7140
7141 if !status.is_client_error() && !status.is_server_error() {
7142 let content = resp.text().await?;
7143 match content_type {
7144 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7145 ContentType::Text => {
7146 return Err(Error::from(serde_json::Error::custom(
7147 "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
7148 )))
7149 }
7150 ContentType::Unsupported(unknown_type) => {
7151 return Err(Error::from(serde_json::Error::custom(format!(
7152 "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
7153 ))))
7154 }
7155 }
7156 } else {
7157 let content = resp.text().await?;
7158 let entity: Option<SourcesSamlRetrieveError> = serde_json::from_str(&content).ok();
7159 Err(Error::ResponseError(ResponseContent {
7160 status,
7161 content,
7162 entity,
7163 }))
7164 }
7165}
7166
7167pub async fn sources_saml_update(
7169 configuration: &configuration::Configuration,
7170 slug: &str,
7171 saml_source_request: models::SamlSourceRequest,
7172) -> Result<models::SamlSource, Error<SourcesSamlUpdateError>> {
7173 let p_path_slug = slug;
7175 let p_body_saml_source_request = saml_source_request;
7176
7177 let uri_str = format!(
7178 "{}/sources/saml/{slug}/",
7179 configuration.base_path,
7180 slug = crate::apis::urlencode(p_path_slug)
7181 );
7182 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7183
7184 if let Some(ref user_agent) = configuration.user_agent {
7185 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7186 }
7187 if let Some(ref token) = configuration.bearer_access_token {
7188 req_builder = req_builder.bearer_auth(token.to_owned());
7189 };
7190 req_builder = req_builder.json(&p_body_saml_source_request);
7191
7192 let req = req_builder.build()?;
7193 let resp = configuration.client.execute(req).await?;
7194
7195 let status = resp.status();
7196 let content_type = resp
7197 .headers()
7198 .get("content-type")
7199 .and_then(|v| v.to_str().ok())
7200 .unwrap_or("application/octet-stream");
7201 let content_type = super::ContentType::from(content_type);
7202
7203 if !status.is_client_error() && !status.is_server_error() {
7204 let content = resp.text().await?;
7205 match content_type {
7206 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7207 ContentType::Text => {
7208 return Err(Error::from(serde_json::Error::custom(
7209 "Received `text/plain` content type response that cannot be converted to `models::SamlSource`",
7210 )))
7211 }
7212 ContentType::Unsupported(unknown_type) => {
7213 return Err(Error::from(serde_json::Error::custom(format!(
7214 "Received `{unknown_type}` content type response that cannot be converted to `models::SamlSource`"
7215 ))))
7216 }
7217 }
7218 } else {
7219 let content = resp.text().await?;
7220 let entity: Option<SourcesSamlUpdateError> = serde_json::from_str(&content).ok();
7221 Err(Error::ResponseError(ResponseContent {
7222 status,
7223 content,
7224 entity,
7225 }))
7226 }
7227}
7228
7229pub async fn sources_saml_used_by_list(
7231 configuration: &configuration::Configuration,
7232 slug: &str,
7233) -> Result<Vec<models::UsedBy>, Error<SourcesSamlUsedByListError>> {
7234 let p_path_slug = slug;
7236
7237 let uri_str = format!(
7238 "{}/sources/saml/{slug}/used_by/",
7239 configuration.base_path,
7240 slug = crate::apis::urlencode(p_path_slug)
7241 );
7242 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7243
7244 if let Some(ref user_agent) = configuration.user_agent {
7245 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7246 }
7247 if let Some(ref token) = configuration.bearer_access_token {
7248 req_builder = req_builder.bearer_auth(token.to_owned());
7249 };
7250
7251 let req = req_builder.build()?;
7252 let resp = configuration.client.execute(req).await?;
7253
7254 let status = resp.status();
7255 let content_type = resp
7256 .headers()
7257 .get("content-type")
7258 .and_then(|v| v.to_str().ok())
7259 .unwrap_or("application/octet-stream");
7260 let content_type = super::ContentType::from(content_type);
7261
7262 if !status.is_client_error() && !status.is_server_error() {
7263 let content = resp.text().await?;
7264 match content_type {
7265 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7266 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
7267 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
7268 }
7269 } else {
7270 let content = resp.text().await?;
7271 let entity: Option<SourcesSamlUsedByListError> = serde_json::from_str(&content).ok();
7272 Err(Error::ResponseError(ResponseContent {
7273 status,
7274 content,
7275 entity,
7276 }))
7277 }
7278}
7279
7280pub async fn sources_scim_create(
7282 configuration: &configuration::Configuration,
7283 scim_source_request: models::ScimSourceRequest,
7284) -> Result<models::ScimSource, Error<SourcesScimCreateError>> {
7285 let p_body_scim_source_request = scim_source_request;
7287
7288 let uri_str = format!("{}/sources/scim/", configuration.base_path);
7289 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7290
7291 if let Some(ref user_agent) = configuration.user_agent {
7292 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7293 }
7294 if let Some(ref token) = configuration.bearer_access_token {
7295 req_builder = req_builder.bearer_auth(token.to_owned());
7296 };
7297 req_builder = req_builder.json(&p_body_scim_source_request);
7298
7299 let req = req_builder.build()?;
7300 let resp = configuration.client.execute(req).await?;
7301
7302 let status = resp.status();
7303 let content_type = resp
7304 .headers()
7305 .get("content-type")
7306 .and_then(|v| v.to_str().ok())
7307 .unwrap_or("application/octet-stream");
7308 let content_type = super::ContentType::from(content_type);
7309
7310 if !status.is_client_error() && !status.is_server_error() {
7311 let content = resp.text().await?;
7312 match content_type {
7313 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7314 ContentType::Text => {
7315 return Err(Error::from(serde_json::Error::custom(
7316 "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7317 )))
7318 }
7319 ContentType::Unsupported(unknown_type) => {
7320 return Err(Error::from(serde_json::Error::custom(format!(
7321 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7322 ))))
7323 }
7324 }
7325 } else {
7326 let content = resp.text().await?;
7327 let entity: Option<SourcesScimCreateError> = serde_json::from_str(&content).ok();
7328 Err(Error::ResponseError(ResponseContent {
7329 status,
7330 content,
7331 entity,
7332 }))
7333 }
7334}
7335
7336pub async fn sources_scim_destroy(
7338 configuration: &configuration::Configuration,
7339 slug: &str,
7340) -> Result<(), Error<SourcesScimDestroyError>> {
7341 let p_path_slug = slug;
7343
7344 let uri_str = format!(
7345 "{}/sources/scim/{slug}/",
7346 configuration.base_path,
7347 slug = crate::apis::urlencode(p_path_slug)
7348 );
7349 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7350
7351 if let Some(ref user_agent) = configuration.user_agent {
7352 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7353 }
7354 if let Some(ref token) = configuration.bearer_access_token {
7355 req_builder = req_builder.bearer_auth(token.to_owned());
7356 };
7357
7358 let req = req_builder.build()?;
7359 let resp = configuration.client.execute(req).await?;
7360
7361 let status = resp.status();
7362
7363 if !status.is_client_error() && !status.is_server_error() {
7364 Ok(())
7365 } else {
7366 let content = resp.text().await?;
7367 let entity: Option<SourcesScimDestroyError> = serde_json::from_str(&content).ok();
7368 Err(Error::ResponseError(ResponseContent {
7369 status,
7370 content,
7371 entity,
7372 }))
7373 }
7374}
7375
7376pub async fn sources_scim_groups_create(
7378 configuration: &configuration::Configuration,
7379 scim_source_group_request: models::ScimSourceGroupRequest,
7380) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsCreateError>> {
7381 let p_body_scim_source_group_request = scim_source_group_request;
7383
7384 let uri_str = format!("{}/sources/scim_groups/", configuration.base_path);
7385 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7386
7387 if let Some(ref user_agent) = configuration.user_agent {
7388 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7389 }
7390 if let Some(ref token) = configuration.bearer_access_token {
7391 req_builder = req_builder.bearer_auth(token.to_owned());
7392 };
7393 req_builder = req_builder.json(&p_body_scim_source_group_request);
7394
7395 let req = req_builder.build()?;
7396 let resp = configuration.client.execute(req).await?;
7397
7398 let status = resp.status();
7399 let content_type = resp
7400 .headers()
7401 .get("content-type")
7402 .and_then(|v| v.to_str().ok())
7403 .unwrap_or("application/octet-stream");
7404 let content_type = super::ContentType::from(content_type);
7405
7406 if !status.is_client_error() && !status.is_server_error() {
7407 let content = resp.text().await?;
7408 match content_type {
7409 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7410 ContentType::Text => {
7411 return Err(Error::from(serde_json::Error::custom(
7412 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7413 )))
7414 }
7415 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7416 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7417 )))),
7418 }
7419 } else {
7420 let content = resp.text().await?;
7421 let entity: Option<SourcesScimGroupsCreateError> = serde_json::from_str(&content).ok();
7422 Err(Error::ResponseError(ResponseContent {
7423 status,
7424 content,
7425 entity,
7426 }))
7427 }
7428}
7429
7430pub async fn sources_scim_groups_destroy(
7432 configuration: &configuration::Configuration,
7433 id: &str,
7434) -> Result<(), Error<SourcesScimGroupsDestroyError>> {
7435 let p_path_id = id;
7437
7438 let uri_str = format!(
7439 "{}/sources/scim_groups/{id}/",
7440 configuration.base_path,
7441 id = crate::apis::urlencode(p_path_id)
7442 );
7443 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7444
7445 if let Some(ref user_agent) = configuration.user_agent {
7446 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7447 }
7448 if let Some(ref token) = configuration.bearer_access_token {
7449 req_builder = req_builder.bearer_auth(token.to_owned());
7450 };
7451
7452 let req = req_builder.build()?;
7453 let resp = configuration.client.execute(req).await?;
7454
7455 let status = resp.status();
7456
7457 if !status.is_client_error() && !status.is_server_error() {
7458 Ok(())
7459 } else {
7460 let content = resp.text().await?;
7461 let entity: Option<SourcesScimGroupsDestroyError> = serde_json::from_str(&content).ok();
7462 Err(Error::ResponseError(ResponseContent {
7463 status,
7464 content,
7465 entity,
7466 }))
7467 }
7468}
7469
7470pub async fn sources_scim_groups_list(
7472 configuration: &configuration::Configuration,
7473 group__group_uuid: Option<&str>,
7474 group__name: Option<&str>,
7475 ordering: Option<&str>,
7476 page: Option<i32>,
7477 page_size: Option<i32>,
7478 search: Option<&str>,
7479 source__slug: Option<&str>,
7480) -> Result<models::PaginatedScimSourceGroupList, Error<SourcesScimGroupsListError>> {
7481 let p_query_group__group_uuid = group__group_uuid;
7483 let p_query_group__name = group__name;
7484 let p_query_ordering = ordering;
7485 let p_query_page = page;
7486 let p_query_page_size = page_size;
7487 let p_query_search = search;
7488 let p_query_source__slug = source__slug;
7489
7490 let uri_str = format!("{}/sources/scim_groups/", configuration.base_path);
7491 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7492
7493 if let Some(ref param_value) = p_query_group__group_uuid {
7494 req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]);
7495 }
7496 if let Some(ref param_value) = p_query_group__name {
7497 req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]);
7498 }
7499 if let Some(ref param_value) = p_query_ordering {
7500 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
7501 }
7502 if let Some(ref param_value) = p_query_page {
7503 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
7504 }
7505 if let Some(ref param_value) = p_query_page_size {
7506 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
7507 }
7508 if let Some(ref param_value) = p_query_search {
7509 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
7510 }
7511 if let Some(ref param_value) = p_query_source__slug {
7512 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
7513 }
7514 if let Some(ref user_agent) = configuration.user_agent {
7515 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7516 }
7517 if let Some(ref token) = configuration.bearer_access_token {
7518 req_builder = req_builder.bearer_auth(token.to_owned());
7519 };
7520
7521 let req = req_builder.build()?;
7522 let resp = configuration.client.execute(req).await?;
7523
7524 let status = resp.status();
7525 let content_type = resp
7526 .headers()
7527 .get("content-type")
7528 .and_then(|v| v.to_str().ok())
7529 .unwrap_or("application/octet-stream");
7530 let content_type = super::ContentType::from(content_type);
7531
7532 if !status.is_client_error() && !status.is_server_error() {
7533 let content = resp.text().await?;
7534 match content_type {
7535 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7536 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceGroupList`"))),
7537 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourceGroupList`")))),
7538 }
7539 } else {
7540 let content = resp.text().await?;
7541 let entity: Option<SourcesScimGroupsListError> = serde_json::from_str(&content).ok();
7542 Err(Error::ResponseError(ResponseContent {
7543 status,
7544 content,
7545 entity,
7546 }))
7547 }
7548}
7549
7550pub async fn sources_scim_groups_partial_update(
7552 configuration: &configuration::Configuration,
7553 id: &str,
7554 patched_scim_source_group_request: Option<models::PatchedScimSourceGroupRequest>,
7555) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsPartialUpdateError>> {
7556 let p_path_id = id;
7558 let p_body_patched_scim_source_group_request = patched_scim_source_group_request;
7559
7560 let uri_str = format!(
7561 "{}/sources/scim_groups/{id}/",
7562 configuration.base_path,
7563 id = crate::apis::urlencode(p_path_id)
7564 );
7565 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7566
7567 if let Some(ref user_agent) = configuration.user_agent {
7568 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7569 }
7570 if let Some(ref token) = configuration.bearer_access_token {
7571 req_builder = req_builder.bearer_auth(token.to_owned());
7572 };
7573 req_builder = req_builder.json(&p_body_patched_scim_source_group_request);
7574
7575 let req = req_builder.build()?;
7576 let resp = configuration.client.execute(req).await?;
7577
7578 let status = resp.status();
7579 let content_type = resp
7580 .headers()
7581 .get("content-type")
7582 .and_then(|v| v.to_str().ok())
7583 .unwrap_or("application/octet-stream");
7584 let content_type = super::ContentType::from(content_type);
7585
7586 if !status.is_client_error() && !status.is_server_error() {
7587 let content = resp.text().await?;
7588 match content_type {
7589 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7590 ContentType::Text => {
7591 return Err(Error::from(serde_json::Error::custom(
7592 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7593 )))
7594 }
7595 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7596 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7597 )))),
7598 }
7599 } else {
7600 let content = resp.text().await?;
7601 let entity: Option<SourcesScimGroupsPartialUpdateError> = serde_json::from_str(&content).ok();
7602 Err(Error::ResponseError(ResponseContent {
7603 status,
7604 content,
7605 entity,
7606 }))
7607 }
7608}
7609
7610pub async fn sources_scim_groups_retrieve(
7612 configuration: &configuration::Configuration,
7613 id: &str,
7614) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsRetrieveError>> {
7615 let p_path_id = id;
7617
7618 let uri_str = format!(
7619 "{}/sources/scim_groups/{id}/",
7620 configuration.base_path,
7621 id = crate::apis::urlencode(p_path_id)
7622 );
7623 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7624
7625 if let Some(ref user_agent) = configuration.user_agent {
7626 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7627 }
7628 if let Some(ref token) = configuration.bearer_access_token {
7629 req_builder = req_builder.bearer_auth(token.to_owned());
7630 };
7631
7632 let req = req_builder.build()?;
7633 let resp = configuration.client.execute(req).await?;
7634
7635 let status = resp.status();
7636 let content_type = resp
7637 .headers()
7638 .get("content-type")
7639 .and_then(|v| v.to_str().ok())
7640 .unwrap_or("application/octet-stream");
7641 let content_type = super::ContentType::from(content_type);
7642
7643 if !status.is_client_error() && !status.is_server_error() {
7644 let content = resp.text().await?;
7645 match content_type {
7646 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7647 ContentType::Text => {
7648 return Err(Error::from(serde_json::Error::custom(
7649 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7650 )))
7651 }
7652 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7653 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7654 )))),
7655 }
7656 } else {
7657 let content = resp.text().await?;
7658 let entity: Option<SourcesScimGroupsRetrieveError> = serde_json::from_str(&content).ok();
7659 Err(Error::ResponseError(ResponseContent {
7660 status,
7661 content,
7662 entity,
7663 }))
7664 }
7665}
7666
7667pub async fn sources_scim_groups_update(
7669 configuration: &configuration::Configuration,
7670 id: &str,
7671 scim_source_group_request: models::ScimSourceGroupRequest,
7672) -> Result<models::ScimSourceGroup, Error<SourcesScimGroupsUpdateError>> {
7673 let p_path_id = id;
7675 let p_body_scim_source_group_request = scim_source_group_request;
7676
7677 let uri_str = format!(
7678 "{}/sources/scim_groups/{id}/",
7679 configuration.base_path,
7680 id = crate::apis::urlencode(p_path_id)
7681 );
7682 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7683
7684 if let Some(ref user_agent) = configuration.user_agent {
7685 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7686 }
7687 if let Some(ref token) = configuration.bearer_access_token {
7688 req_builder = req_builder.bearer_auth(token.to_owned());
7689 };
7690 req_builder = req_builder.json(&p_body_scim_source_group_request);
7691
7692 let req = req_builder.build()?;
7693 let resp = configuration.client.execute(req).await?;
7694
7695 let status = resp.status();
7696 let content_type = resp
7697 .headers()
7698 .get("content-type")
7699 .and_then(|v| v.to_str().ok())
7700 .unwrap_or("application/octet-stream");
7701 let content_type = super::ContentType::from(content_type);
7702
7703 if !status.is_client_error() && !status.is_server_error() {
7704 let content = resp.text().await?;
7705 match content_type {
7706 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7707 ContentType::Text => {
7708 return Err(Error::from(serde_json::Error::custom(
7709 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceGroup`",
7710 )))
7711 }
7712 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
7713 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceGroup`"
7714 )))),
7715 }
7716 } else {
7717 let content = resp.text().await?;
7718 let entity: Option<SourcesScimGroupsUpdateError> = serde_json::from_str(&content).ok();
7719 Err(Error::ResponseError(ResponseContent {
7720 status,
7721 content,
7722 entity,
7723 }))
7724 }
7725}
7726
7727pub async fn sources_scim_groups_used_by_list(
7729 configuration: &configuration::Configuration,
7730 id: &str,
7731) -> Result<Vec<models::UsedBy>, Error<SourcesScimGroupsUsedByListError>> {
7732 let p_path_id = id;
7734
7735 let uri_str = format!(
7736 "{}/sources/scim_groups/{id}/used_by/",
7737 configuration.base_path,
7738 id = crate::apis::urlencode(p_path_id)
7739 );
7740 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7741
7742 if let Some(ref user_agent) = configuration.user_agent {
7743 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7744 }
7745 if let Some(ref token) = configuration.bearer_access_token {
7746 req_builder = req_builder.bearer_auth(token.to_owned());
7747 };
7748
7749 let req = req_builder.build()?;
7750 let resp = configuration.client.execute(req).await?;
7751
7752 let status = resp.status();
7753 let content_type = resp
7754 .headers()
7755 .get("content-type")
7756 .and_then(|v| v.to_str().ok())
7757 .unwrap_or("application/octet-stream");
7758 let content_type = super::ContentType::from(content_type);
7759
7760 if !status.is_client_error() && !status.is_server_error() {
7761 let content = resp.text().await?;
7762 match content_type {
7763 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7764 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
7765 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
7766 }
7767 } else {
7768 let content = resp.text().await?;
7769 let entity: Option<SourcesScimGroupsUsedByListError> = serde_json::from_str(&content).ok();
7770 Err(Error::ResponseError(ResponseContent {
7771 status,
7772 content,
7773 entity,
7774 }))
7775 }
7776}
7777
7778pub async fn sources_scim_list(
7780 configuration: &configuration::Configuration,
7781 name: Option<&str>,
7782 ordering: Option<&str>,
7783 page: Option<i32>,
7784 page_size: Option<i32>,
7785 pbm_uuid: Option<&str>,
7786 search: Option<&str>,
7787 slug: Option<&str>,
7788) -> Result<models::PaginatedScimSourceList, Error<SourcesScimListError>> {
7789 let p_query_name = name;
7791 let p_query_ordering = ordering;
7792 let p_query_page = page;
7793 let p_query_page_size = page_size;
7794 let p_query_pbm_uuid = pbm_uuid;
7795 let p_query_search = search;
7796 let p_query_slug = slug;
7797
7798 let uri_str = format!("{}/sources/scim/", configuration.base_path);
7799 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7800
7801 if let Some(ref param_value) = p_query_name {
7802 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
7803 }
7804 if let Some(ref param_value) = p_query_ordering {
7805 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
7806 }
7807 if let Some(ref param_value) = p_query_page {
7808 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
7809 }
7810 if let Some(ref param_value) = p_query_page_size {
7811 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
7812 }
7813 if let Some(ref param_value) = p_query_pbm_uuid {
7814 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
7815 }
7816 if let Some(ref param_value) = p_query_search {
7817 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
7818 }
7819 if let Some(ref param_value) = p_query_slug {
7820 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
7821 }
7822 if let Some(ref user_agent) = configuration.user_agent {
7823 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7824 }
7825 if let Some(ref token) = configuration.bearer_access_token {
7826 req_builder = req_builder.bearer_auth(token.to_owned());
7827 };
7828
7829 let req = req_builder.build()?;
7830 let resp = configuration.client.execute(req).await?;
7831
7832 let status = resp.status();
7833 let content_type = resp
7834 .headers()
7835 .get("content-type")
7836 .and_then(|v| v.to_str().ok())
7837 .unwrap_or("application/octet-stream");
7838 let content_type = super::ContentType::from(content_type);
7839
7840 if !status.is_client_error() && !status.is_server_error() {
7841 let content = resp.text().await?;
7842 match content_type {
7843 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7844 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceList`"))),
7845 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourceList`")))),
7846 }
7847 } else {
7848 let content = resp.text().await?;
7849 let entity: Option<SourcesScimListError> = serde_json::from_str(&content).ok();
7850 Err(Error::ResponseError(ResponseContent {
7851 status,
7852 content,
7853 entity,
7854 }))
7855 }
7856}
7857
7858pub async fn sources_scim_partial_update(
7860 configuration: &configuration::Configuration,
7861 slug: &str,
7862 patched_scim_source_request: Option<models::PatchedScimSourceRequest>,
7863) -> Result<models::ScimSource, Error<SourcesScimPartialUpdateError>> {
7864 let p_path_slug = slug;
7866 let p_body_patched_scim_source_request = patched_scim_source_request;
7867
7868 let uri_str = format!(
7869 "{}/sources/scim/{slug}/",
7870 configuration.base_path,
7871 slug = crate::apis::urlencode(p_path_slug)
7872 );
7873 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7874
7875 if let Some(ref user_agent) = configuration.user_agent {
7876 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7877 }
7878 if let Some(ref token) = configuration.bearer_access_token {
7879 req_builder = req_builder.bearer_auth(token.to_owned());
7880 };
7881 req_builder = req_builder.json(&p_body_patched_scim_source_request);
7882
7883 let req = req_builder.build()?;
7884 let resp = configuration.client.execute(req).await?;
7885
7886 let status = resp.status();
7887 let content_type = resp
7888 .headers()
7889 .get("content-type")
7890 .and_then(|v| v.to_str().ok())
7891 .unwrap_or("application/octet-stream");
7892 let content_type = super::ContentType::from(content_type);
7893
7894 if !status.is_client_error() && !status.is_server_error() {
7895 let content = resp.text().await?;
7896 match content_type {
7897 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7898 ContentType::Text => {
7899 return Err(Error::from(serde_json::Error::custom(
7900 "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7901 )))
7902 }
7903 ContentType::Unsupported(unknown_type) => {
7904 return Err(Error::from(serde_json::Error::custom(format!(
7905 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7906 ))))
7907 }
7908 }
7909 } else {
7910 let content = resp.text().await?;
7911 let entity: Option<SourcesScimPartialUpdateError> = serde_json::from_str(&content).ok();
7912 Err(Error::ResponseError(ResponseContent {
7913 status,
7914 content,
7915 entity,
7916 }))
7917 }
7918}
7919
7920pub async fn sources_scim_retrieve(
7922 configuration: &configuration::Configuration,
7923 slug: &str,
7924) -> Result<models::ScimSource, Error<SourcesScimRetrieveError>> {
7925 let p_path_slug = slug;
7927
7928 let uri_str = format!(
7929 "{}/sources/scim/{slug}/",
7930 configuration.base_path,
7931 slug = crate::apis::urlencode(p_path_slug)
7932 );
7933 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7934
7935 if let Some(ref user_agent) = configuration.user_agent {
7936 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7937 }
7938 if let Some(ref token) = configuration.bearer_access_token {
7939 req_builder = req_builder.bearer_auth(token.to_owned());
7940 };
7941
7942 let req = req_builder.build()?;
7943 let resp = configuration.client.execute(req).await?;
7944
7945 let status = resp.status();
7946 let content_type = resp
7947 .headers()
7948 .get("content-type")
7949 .and_then(|v| v.to_str().ok())
7950 .unwrap_or("application/octet-stream");
7951 let content_type = super::ContentType::from(content_type);
7952
7953 if !status.is_client_error() && !status.is_server_error() {
7954 let content = resp.text().await?;
7955 match content_type {
7956 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7957 ContentType::Text => {
7958 return Err(Error::from(serde_json::Error::custom(
7959 "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
7960 )))
7961 }
7962 ContentType::Unsupported(unknown_type) => {
7963 return Err(Error::from(serde_json::Error::custom(format!(
7964 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
7965 ))))
7966 }
7967 }
7968 } else {
7969 let content = resp.text().await?;
7970 let entity: Option<SourcesScimRetrieveError> = serde_json::from_str(&content).ok();
7971 Err(Error::ResponseError(ResponseContent {
7972 status,
7973 content,
7974 entity,
7975 }))
7976 }
7977}
7978
7979pub async fn sources_scim_update(
7981 configuration: &configuration::Configuration,
7982 slug: &str,
7983 scim_source_request: models::ScimSourceRequest,
7984) -> Result<models::ScimSource, Error<SourcesScimUpdateError>> {
7985 let p_path_slug = slug;
7987 let p_body_scim_source_request = scim_source_request;
7988
7989 let uri_str = format!(
7990 "{}/sources/scim/{slug}/",
7991 configuration.base_path,
7992 slug = crate::apis::urlencode(p_path_slug)
7993 );
7994 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7995
7996 if let Some(ref user_agent) = configuration.user_agent {
7997 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7998 }
7999 if let Some(ref token) = configuration.bearer_access_token {
8000 req_builder = req_builder.bearer_auth(token.to_owned());
8001 };
8002 req_builder = req_builder.json(&p_body_scim_source_request);
8003
8004 let req = req_builder.build()?;
8005 let resp = configuration.client.execute(req).await?;
8006
8007 let status = resp.status();
8008 let content_type = resp
8009 .headers()
8010 .get("content-type")
8011 .and_then(|v| v.to_str().ok())
8012 .unwrap_or("application/octet-stream");
8013 let content_type = super::ContentType::from(content_type);
8014
8015 if !status.is_client_error() && !status.is_server_error() {
8016 let content = resp.text().await?;
8017 match content_type {
8018 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8019 ContentType::Text => {
8020 return Err(Error::from(serde_json::Error::custom(
8021 "Received `text/plain` content type response that cannot be converted to `models::ScimSource`",
8022 )))
8023 }
8024 ContentType::Unsupported(unknown_type) => {
8025 return Err(Error::from(serde_json::Error::custom(format!(
8026 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSource`"
8027 ))))
8028 }
8029 }
8030 } else {
8031 let content = resp.text().await?;
8032 let entity: Option<SourcesScimUpdateError> = serde_json::from_str(&content).ok();
8033 Err(Error::ResponseError(ResponseContent {
8034 status,
8035 content,
8036 entity,
8037 }))
8038 }
8039}
8040
8041pub async fn sources_scim_used_by_list(
8043 configuration: &configuration::Configuration,
8044 slug: &str,
8045) -> Result<Vec<models::UsedBy>, Error<SourcesScimUsedByListError>> {
8046 let p_path_slug = slug;
8048
8049 let uri_str = format!(
8050 "{}/sources/scim/{slug}/used_by/",
8051 configuration.base_path,
8052 slug = crate::apis::urlencode(p_path_slug)
8053 );
8054 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8055
8056 if let Some(ref user_agent) = configuration.user_agent {
8057 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8058 }
8059 if let Some(ref token) = configuration.bearer_access_token {
8060 req_builder = req_builder.bearer_auth(token.to_owned());
8061 };
8062
8063 let req = req_builder.build()?;
8064 let resp = configuration.client.execute(req).await?;
8065
8066 let status = resp.status();
8067 let content_type = resp
8068 .headers()
8069 .get("content-type")
8070 .and_then(|v| v.to_str().ok())
8071 .unwrap_or("application/octet-stream");
8072 let content_type = super::ContentType::from(content_type);
8073
8074 if !status.is_client_error() && !status.is_server_error() {
8075 let content = resp.text().await?;
8076 match content_type {
8077 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8078 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
8079 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
8080 }
8081 } else {
8082 let content = resp.text().await?;
8083 let entity: Option<SourcesScimUsedByListError> = serde_json::from_str(&content).ok();
8084 Err(Error::ResponseError(ResponseContent {
8085 status,
8086 content,
8087 entity,
8088 }))
8089 }
8090}
8091
8092pub async fn sources_scim_users_create(
8094 configuration: &configuration::Configuration,
8095 scim_source_user_request: models::ScimSourceUserRequest,
8096) -> Result<models::ScimSourceUser, Error<SourcesScimUsersCreateError>> {
8097 let p_body_scim_source_user_request = scim_source_user_request;
8099
8100 let uri_str = format!("{}/sources/scim_users/", configuration.base_path);
8101 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8102
8103 if let Some(ref user_agent) = configuration.user_agent {
8104 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8105 }
8106 if let Some(ref token) = configuration.bearer_access_token {
8107 req_builder = req_builder.bearer_auth(token.to_owned());
8108 };
8109 req_builder = req_builder.json(&p_body_scim_source_user_request);
8110
8111 let req = req_builder.build()?;
8112 let resp = configuration.client.execute(req).await?;
8113
8114 let status = resp.status();
8115 let content_type = resp
8116 .headers()
8117 .get("content-type")
8118 .and_then(|v| v.to_str().ok())
8119 .unwrap_or("application/octet-stream");
8120 let content_type = super::ContentType::from(content_type);
8121
8122 if !status.is_client_error() && !status.is_server_error() {
8123 let content = resp.text().await?;
8124 match content_type {
8125 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8126 ContentType::Text => {
8127 return Err(Error::from(serde_json::Error::custom(
8128 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8129 )))
8130 }
8131 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8132 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8133 )))),
8134 }
8135 } else {
8136 let content = resp.text().await?;
8137 let entity: Option<SourcesScimUsersCreateError> = serde_json::from_str(&content).ok();
8138 Err(Error::ResponseError(ResponseContent {
8139 status,
8140 content,
8141 entity,
8142 }))
8143 }
8144}
8145
8146pub async fn sources_scim_users_destroy(
8148 configuration: &configuration::Configuration,
8149 id: &str,
8150) -> Result<(), Error<SourcesScimUsersDestroyError>> {
8151 let p_path_id = id;
8153
8154 let uri_str = format!(
8155 "{}/sources/scim_users/{id}/",
8156 configuration.base_path,
8157 id = crate::apis::urlencode(p_path_id)
8158 );
8159 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8160
8161 if let Some(ref user_agent) = configuration.user_agent {
8162 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8163 }
8164 if let Some(ref token) = configuration.bearer_access_token {
8165 req_builder = req_builder.bearer_auth(token.to_owned());
8166 };
8167
8168 let req = req_builder.build()?;
8169 let resp = configuration.client.execute(req).await?;
8170
8171 let status = resp.status();
8172
8173 if !status.is_client_error() && !status.is_server_error() {
8174 Ok(())
8175 } else {
8176 let content = resp.text().await?;
8177 let entity: Option<SourcesScimUsersDestroyError> = serde_json::from_str(&content).ok();
8178 Err(Error::ResponseError(ResponseContent {
8179 status,
8180 content,
8181 entity,
8182 }))
8183 }
8184}
8185
8186pub async fn sources_scim_users_list(
8188 configuration: &configuration::Configuration,
8189 ordering: Option<&str>,
8190 page: Option<i32>,
8191 page_size: Option<i32>,
8192 search: Option<&str>,
8193 source__slug: Option<&str>,
8194 user__id: Option<i32>,
8195 user__username: Option<&str>,
8196) -> Result<models::PaginatedScimSourceUserList, Error<SourcesScimUsersListError>> {
8197 let p_query_ordering = ordering;
8199 let p_query_page = page;
8200 let p_query_page_size = page_size;
8201 let p_query_search = search;
8202 let p_query_source__slug = source__slug;
8203 let p_query_user__id = user__id;
8204 let p_query_user__username = user__username;
8205
8206 let uri_str = format!("{}/sources/scim_users/", configuration.base_path);
8207 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8208
8209 if let Some(ref param_value) = p_query_ordering {
8210 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
8211 }
8212 if let Some(ref param_value) = p_query_page {
8213 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
8214 }
8215 if let Some(ref param_value) = p_query_page_size {
8216 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
8217 }
8218 if let Some(ref param_value) = p_query_search {
8219 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
8220 }
8221 if let Some(ref param_value) = p_query_source__slug {
8222 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
8223 }
8224 if let Some(ref param_value) = p_query_user__id {
8225 req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]);
8226 }
8227 if let Some(ref param_value) = p_query_user__username {
8228 req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]);
8229 }
8230 if let Some(ref user_agent) = configuration.user_agent {
8231 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8232 }
8233 if let Some(ref token) = configuration.bearer_access_token {
8234 req_builder = req_builder.bearer_auth(token.to_owned());
8235 };
8236
8237 let req = req_builder.build()?;
8238 let resp = configuration.client.execute(req).await?;
8239
8240 let status = resp.status();
8241 let content_type = resp
8242 .headers()
8243 .get("content-type")
8244 .and_then(|v| v.to_str().ok())
8245 .unwrap_or("application/octet-stream");
8246 let content_type = super::ContentType::from(content_type);
8247
8248 if !status.is_client_error() && !status.is_server_error() {
8249 let content = resp.text().await?;
8250 match content_type {
8251 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8252 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourceUserList`"))),
8253 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourceUserList`")))),
8254 }
8255 } else {
8256 let content = resp.text().await?;
8257 let entity: Option<SourcesScimUsersListError> = serde_json::from_str(&content).ok();
8258 Err(Error::ResponseError(ResponseContent {
8259 status,
8260 content,
8261 entity,
8262 }))
8263 }
8264}
8265
8266pub async fn sources_scim_users_partial_update(
8268 configuration: &configuration::Configuration,
8269 id: &str,
8270 patched_scim_source_user_request: Option<models::PatchedScimSourceUserRequest>,
8271) -> Result<models::ScimSourceUser, Error<SourcesScimUsersPartialUpdateError>> {
8272 let p_path_id = id;
8274 let p_body_patched_scim_source_user_request = patched_scim_source_user_request;
8275
8276 let uri_str = format!(
8277 "{}/sources/scim_users/{id}/",
8278 configuration.base_path,
8279 id = crate::apis::urlencode(p_path_id)
8280 );
8281 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8282
8283 if let Some(ref user_agent) = configuration.user_agent {
8284 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8285 }
8286 if let Some(ref token) = configuration.bearer_access_token {
8287 req_builder = req_builder.bearer_auth(token.to_owned());
8288 };
8289 req_builder = req_builder.json(&p_body_patched_scim_source_user_request);
8290
8291 let req = req_builder.build()?;
8292 let resp = configuration.client.execute(req).await?;
8293
8294 let status = resp.status();
8295 let content_type = resp
8296 .headers()
8297 .get("content-type")
8298 .and_then(|v| v.to_str().ok())
8299 .unwrap_or("application/octet-stream");
8300 let content_type = super::ContentType::from(content_type);
8301
8302 if !status.is_client_error() && !status.is_server_error() {
8303 let content = resp.text().await?;
8304 match content_type {
8305 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8306 ContentType::Text => {
8307 return Err(Error::from(serde_json::Error::custom(
8308 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8309 )))
8310 }
8311 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8312 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8313 )))),
8314 }
8315 } else {
8316 let content = resp.text().await?;
8317 let entity: Option<SourcesScimUsersPartialUpdateError> = serde_json::from_str(&content).ok();
8318 Err(Error::ResponseError(ResponseContent {
8319 status,
8320 content,
8321 entity,
8322 }))
8323 }
8324}
8325
8326pub async fn sources_scim_users_retrieve(
8328 configuration: &configuration::Configuration,
8329 id: &str,
8330) -> Result<models::ScimSourceUser, Error<SourcesScimUsersRetrieveError>> {
8331 let p_path_id = id;
8333
8334 let uri_str = format!(
8335 "{}/sources/scim_users/{id}/",
8336 configuration.base_path,
8337 id = crate::apis::urlencode(p_path_id)
8338 );
8339 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8340
8341 if let Some(ref user_agent) = configuration.user_agent {
8342 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8343 }
8344 if let Some(ref token) = configuration.bearer_access_token {
8345 req_builder = req_builder.bearer_auth(token.to_owned());
8346 };
8347
8348 let req = req_builder.build()?;
8349 let resp = configuration.client.execute(req).await?;
8350
8351 let status = resp.status();
8352 let content_type = resp
8353 .headers()
8354 .get("content-type")
8355 .and_then(|v| v.to_str().ok())
8356 .unwrap_or("application/octet-stream");
8357 let content_type = super::ContentType::from(content_type);
8358
8359 if !status.is_client_error() && !status.is_server_error() {
8360 let content = resp.text().await?;
8361 match content_type {
8362 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8363 ContentType::Text => {
8364 return Err(Error::from(serde_json::Error::custom(
8365 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8366 )))
8367 }
8368 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8369 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8370 )))),
8371 }
8372 } else {
8373 let content = resp.text().await?;
8374 let entity: Option<SourcesScimUsersRetrieveError> = serde_json::from_str(&content).ok();
8375 Err(Error::ResponseError(ResponseContent {
8376 status,
8377 content,
8378 entity,
8379 }))
8380 }
8381}
8382
8383pub async fn sources_scim_users_update(
8385 configuration: &configuration::Configuration,
8386 id: &str,
8387 scim_source_user_request: models::ScimSourceUserRequest,
8388) -> Result<models::ScimSourceUser, Error<SourcesScimUsersUpdateError>> {
8389 let p_path_id = id;
8391 let p_body_scim_source_user_request = scim_source_user_request;
8392
8393 let uri_str = format!(
8394 "{}/sources/scim_users/{id}/",
8395 configuration.base_path,
8396 id = crate::apis::urlencode(p_path_id)
8397 );
8398 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8399
8400 if let Some(ref user_agent) = configuration.user_agent {
8401 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8402 }
8403 if let Some(ref token) = configuration.bearer_access_token {
8404 req_builder = req_builder.bearer_auth(token.to_owned());
8405 };
8406 req_builder = req_builder.json(&p_body_scim_source_user_request);
8407
8408 let req = req_builder.build()?;
8409 let resp = configuration.client.execute(req).await?;
8410
8411 let status = resp.status();
8412 let content_type = resp
8413 .headers()
8414 .get("content-type")
8415 .and_then(|v| v.to_str().ok())
8416 .unwrap_or("application/octet-stream");
8417 let content_type = super::ContentType::from(content_type);
8418
8419 if !status.is_client_error() && !status.is_server_error() {
8420 let content = resp.text().await?;
8421 match content_type {
8422 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8423 ContentType::Text => {
8424 return Err(Error::from(serde_json::Error::custom(
8425 "Received `text/plain` content type response that cannot be converted to `models::ScimSourceUser`",
8426 )))
8427 }
8428 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8429 "Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourceUser`"
8430 )))),
8431 }
8432 } else {
8433 let content = resp.text().await?;
8434 let entity: Option<SourcesScimUsersUpdateError> = serde_json::from_str(&content).ok();
8435 Err(Error::ResponseError(ResponseContent {
8436 status,
8437 content,
8438 entity,
8439 }))
8440 }
8441}
8442
8443pub async fn sources_scim_users_used_by_list(
8445 configuration: &configuration::Configuration,
8446 id: &str,
8447) -> Result<Vec<models::UsedBy>, Error<SourcesScimUsersUsedByListError>> {
8448 let p_path_id = id;
8450
8451 let uri_str = format!(
8452 "{}/sources/scim_users/{id}/used_by/",
8453 configuration.base_path,
8454 id = crate::apis::urlencode(p_path_id)
8455 );
8456 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8457
8458 if let Some(ref user_agent) = configuration.user_agent {
8459 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8460 }
8461 if let Some(ref token) = configuration.bearer_access_token {
8462 req_builder = req_builder.bearer_auth(token.to_owned());
8463 };
8464
8465 let req = req_builder.build()?;
8466 let resp = configuration.client.execute(req).await?;
8467
8468 let status = resp.status();
8469 let content_type = resp
8470 .headers()
8471 .get("content-type")
8472 .and_then(|v| v.to_str().ok())
8473 .unwrap_or("application/octet-stream");
8474 let content_type = super::ContentType::from(content_type);
8475
8476 if !status.is_client_error() && !status.is_server_error() {
8477 let content = resp.text().await?;
8478 match content_type {
8479 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8480 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
8481 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
8482 }
8483 } else {
8484 let content = resp.text().await?;
8485 let entity: Option<SourcesScimUsersUsedByListError> = serde_json::from_str(&content).ok();
8486 Err(Error::ResponseError(ResponseContent {
8487 status,
8488 content,
8489 entity,
8490 }))
8491 }
8492}
8493
8494pub async fn sources_telegram_connect_user_create(
8496 configuration: &configuration::Configuration,
8497 slug: &str,
8498 telegram_auth_request: models::TelegramAuthRequest,
8499) -> Result<models::UserTelegramSourceConnection, Error<SourcesTelegramConnectUserCreateError>> {
8500 let p_path_slug = slug;
8502 let p_body_telegram_auth_request = telegram_auth_request;
8503
8504 let uri_str = format!(
8505 "{}/sources/telegram/{slug}/connect_user/",
8506 configuration.base_path,
8507 slug = crate::apis::urlencode(p_path_slug)
8508 );
8509 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8510
8511 if let Some(ref user_agent) = configuration.user_agent {
8512 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8513 }
8514 if let Some(ref token) = configuration.bearer_access_token {
8515 req_builder = req_builder.bearer_auth(token.to_owned());
8516 };
8517 req_builder = req_builder.json(&p_body_telegram_auth_request);
8518
8519 let req = req_builder.build()?;
8520 let resp = configuration.client.execute(req).await?;
8521
8522 let status = resp.status();
8523 let content_type = resp
8524 .headers()
8525 .get("content-type")
8526 .and_then(|v| v.to_str().ok())
8527 .unwrap_or("application/octet-stream");
8528 let content_type = super::ContentType::from(content_type);
8529
8530 if !status.is_client_error() && !status.is_server_error() {
8531 let content = resp.text().await?;
8532 match content_type {
8533 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8534 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
8535 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
8536 }
8537 } else {
8538 let content = resp.text().await?;
8539 let entity: Option<SourcesTelegramConnectUserCreateError> = serde_json::from_str(&content).ok();
8540 Err(Error::ResponseError(ResponseContent {
8541 status,
8542 content,
8543 entity,
8544 }))
8545 }
8546}
8547
8548pub async fn sources_telegram_create(
8550 configuration: &configuration::Configuration,
8551 telegram_source_request: models::TelegramSourceRequest,
8552) -> Result<models::TelegramSource, Error<SourcesTelegramCreateError>> {
8553 let p_body_telegram_source_request = telegram_source_request;
8555
8556 let uri_str = format!("{}/sources/telegram/", configuration.base_path);
8557 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8558
8559 if let Some(ref user_agent) = configuration.user_agent {
8560 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8561 }
8562 if let Some(ref token) = configuration.bearer_access_token {
8563 req_builder = req_builder.bearer_auth(token.to_owned());
8564 };
8565 req_builder = req_builder.json(&p_body_telegram_source_request);
8566
8567 let req = req_builder.build()?;
8568 let resp = configuration.client.execute(req).await?;
8569
8570 let status = resp.status();
8571 let content_type = resp
8572 .headers()
8573 .get("content-type")
8574 .and_then(|v| v.to_str().ok())
8575 .unwrap_or("application/octet-stream");
8576 let content_type = super::ContentType::from(content_type);
8577
8578 if !status.is_client_error() && !status.is_server_error() {
8579 let content = resp.text().await?;
8580 match content_type {
8581 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8582 ContentType::Text => {
8583 return Err(Error::from(serde_json::Error::custom(
8584 "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8585 )))
8586 }
8587 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8588 "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8589 )))),
8590 }
8591 } else {
8592 let content = resp.text().await?;
8593 let entity: Option<SourcesTelegramCreateError> = serde_json::from_str(&content).ok();
8594 Err(Error::ResponseError(ResponseContent {
8595 status,
8596 content,
8597 entity,
8598 }))
8599 }
8600}
8601
8602pub async fn sources_telegram_destroy(
8604 configuration: &configuration::Configuration,
8605 slug: &str,
8606) -> Result<(), Error<SourcesTelegramDestroyError>> {
8607 let p_path_slug = slug;
8609
8610 let uri_str = format!(
8611 "{}/sources/telegram/{slug}/",
8612 configuration.base_path,
8613 slug = crate::apis::urlencode(p_path_slug)
8614 );
8615 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8616
8617 if let Some(ref user_agent) = configuration.user_agent {
8618 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8619 }
8620 if let Some(ref token) = configuration.bearer_access_token {
8621 req_builder = req_builder.bearer_auth(token.to_owned());
8622 };
8623
8624 let req = req_builder.build()?;
8625 let resp = configuration.client.execute(req).await?;
8626
8627 let status = resp.status();
8628
8629 if !status.is_client_error() && !status.is_server_error() {
8630 Ok(())
8631 } else {
8632 let content = resp.text().await?;
8633 let entity: Option<SourcesTelegramDestroyError> = serde_json::from_str(&content).ok();
8634 Err(Error::ResponseError(ResponseContent {
8635 status,
8636 content,
8637 entity,
8638 }))
8639 }
8640}
8641
8642pub async fn sources_telegram_list(
8644 configuration: &configuration::Configuration,
8645 authentication_flow: Option<&str>,
8646 bot_username: Option<&str>,
8647 enabled: Option<bool>,
8648 enrollment_flow: Option<&str>,
8649 group_matching_mode: Option<&str>,
8650 name: Option<&str>,
8651 ordering: Option<&str>,
8652 page: Option<i32>,
8653 page_size: Option<i32>,
8654 pbm_uuid: Option<&str>,
8655 policy_engine_mode: Option<&str>,
8656 request_message_access: Option<bool>,
8657 search: Option<&str>,
8658 slug: Option<&str>,
8659 user_matching_mode: Option<&str>,
8660) -> Result<models::PaginatedTelegramSourceList, Error<SourcesTelegramListError>> {
8661 let p_query_authentication_flow = authentication_flow;
8663 let p_query_bot_username = bot_username;
8664 let p_query_enabled = enabled;
8665 let p_query_enrollment_flow = enrollment_flow;
8666 let p_query_group_matching_mode = group_matching_mode;
8667 let p_query_name = name;
8668 let p_query_ordering = ordering;
8669 let p_query_page = page;
8670 let p_query_page_size = page_size;
8671 let p_query_pbm_uuid = pbm_uuid;
8672 let p_query_policy_engine_mode = policy_engine_mode;
8673 let p_query_request_message_access = request_message_access;
8674 let p_query_search = search;
8675 let p_query_slug = slug;
8676 let p_query_user_matching_mode = user_matching_mode;
8677
8678 let uri_str = format!("{}/sources/telegram/", configuration.base_path);
8679 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8680
8681 if let Some(ref param_value) = p_query_authentication_flow {
8682 req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]);
8683 }
8684 if let Some(ref param_value) = p_query_bot_username {
8685 req_builder = req_builder.query(&[("bot_username", ¶m_value.to_string())]);
8686 }
8687 if let Some(ref param_value) = p_query_enabled {
8688 req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]);
8689 }
8690 if let Some(ref param_value) = p_query_enrollment_flow {
8691 req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]);
8692 }
8693 if let Some(ref param_value) = p_query_group_matching_mode {
8694 req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]);
8695 }
8696 if let Some(ref param_value) = p_query_name {
8697 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
8698 }
8699 if let Some(ref param_value) = p_query_ordering {
8700 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
8701 }
8702 if let Some(ref param_value) = p_query_page {
8703 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
8704 }
8705 if let Some(ref param_value) = p_query_page_size {
8706 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
8707 }
8708 if let Some(ref param_value) = p_query_pbm_uuid {
8709 req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]);
8710 }
8711 if let Some(ref param_value) = p_query_policy_engine_mode {
8712 req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]);
8713 }
8714 if let Some(ref param_value) = p_query_request_message_access {
8715 req_builder = req_builder.query(&[("request_message_access", ¶m_value.to_string())]);
8716 }
8717 if let Some(ref param_value) = p_query_search {
8718 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
8719 }
8720 if let Some(ref param_value) = p_query_slug {
8721 req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]);
8722 }
8723 if let Some(ref param_value) = p_query_user_matching_mode {
8724 req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]);
8725 }
8726 if let Some(ref user_agent) = configuration.user_agent {
8727 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8728 }
8729 if let Some(ref token) = configuration.bearer_access_token {
8730 req_builder = req_builder.bearer_auth(token.to_owned());
8731 };
8732
8733 let req = req_builder.build()?;
8734 let resp = configuration.client.execute(req).await?;
8735
8736 let status = resp.status();
8737 let content_type = resp
8738 .headers()
8739 .get("content-type")
8740 .and_then(|v| v.to_str().ok())
8741 .unwrap_or("application/octet-stream");
8742 let content_type = super::ContentType::from(content_type);
8743
8744 if !status.is_client_error() && !status.is_server_error() {
8745 let content = resp.text().await?;
8746 match content_type {
8747 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8748 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedTelegramSourceList`"))),
8749 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedTelegramSourceList`")))),
8750 }
8751 } else {
8752 let content = resp.text().await?;
8753 let entity: Option<SourcesTelegramListError> = serde_json::from_str(&content).ok();
8754 Err(Error::ResponseError(ResponseContent {
8755 status,
8756 content,
8757 entity,
8758 }))
8759 }
8760}
8761
8762pub async fn sources_telegram_partial_update(
8764 configuration: &configuration::Configuration,
8765 slug: &str,
8766 patched_telegram_source_request: Option<models::PatchedTelegramSourceRequest>,
8767) -> Result<models::TelegramSource, Error<SourcesTelegramPartialUpdateError>> {
8768 let p_path_slug = slug;
8770 let p_body_patched_telegram_source_request = patched_telegram_source_request;
8771
8772 let uri_str = format!(
8773 "{}/sources/telegram/{slug}/",
8774 configuration.base_path,
8775 slug = crate::apis::urlencode(p_path_slug)
8776 );
8777 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8778
8779 if let Some(ref user_agent) = configuration.user_agent {
8780 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8781 }
8782 if let Some(ref token) = configuration.bearer_access_token {
8783 req_builder = req_builder.bearer_auth(token.to_owned());
8784 };
8785 req_builder = req_builder.json(&p_body_patched_telegram_source_request);
8786
8787 let req = req_builder.build()?;
8788 let resp = configuration.client.execute(req).await?;
8789
8790 let status = resp.status();
8791 let content_type = resp
8792 .headers()
8793 .get("content-type")
8794 .and_then(|v| v.to_str().ok())
8795 .unwrap_or("application/octet-stream");
8796 let content_type = super::ContentType::from(content_type);
8797
8798 if !status.is_client_error() && !status.is_server_error() {
8799 let content = resp.text().await?;
8800 match content_type {
8801 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8802 ContentType::Text => {
8803 return Err(Error::from(serde_json::Error::custom(
8804 "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8805 )))
8806 }
8807 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8808 "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8809 )))),
8810 }
8811 } else {
8812 let content = resp.text().await?;
8813 let entity: Option<SourcesTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
8814 Err(Error::ResponseError(ResponseContent {
8815 status,
8816 content,
8817 entity,
8818 }))
8819 }
8820}
8821
8822pub async fn sources_telegram_retrieve(
8824 configuration: &configuration::Configuration,
8825 slug: &str,
8826) -> Result<models::TelegramSource, Error<SourcesTelegramRetrieveError>> {
8827 let p_path_slug = slug;
8829
8830 let uri_str = format!(
8831 "{}/sources/telegram/{slug}/",
8832 configuration.base_path,
8833 slug = crate::apis::urlencode(p_path_slug)
8834 );
8835 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8836
8837 if let Some(ref user_agent) = configuration.user_agent {
8838 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8839 }
8840 if let Some(ref token) = configuration.bearer_access_token {
8841 req_builder = req_builder.bearer_auth(token.to_owned());
8842 };
8843
8844 let req = req_builder.build()?;
8845 let resp = configuration.client.execute(req).await?;
8846
8847 let status = resp.status();
8848 let content_type = resp
8849 .headers()
8850 .get("content-type")
8851 .and_then(|v| v.to_str().ok())
8852 .unwrap_or("application/octet-stream");
8853 let content_type = super::ContentType::from(content_type);
8854
8855 if !status.is_client_error() && !status.is_server_error() {
8856 let content = resp.text().await?;
8857 match content_type {
8858 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8859 ContentType::Text => {
8860 return Err(Error::from(serde_json::Error::custom(
8861 "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8862 )))
8863 }
8864 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8865 "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8866 )))),
8867 }
8868 } else {
8869 let content = resp.text().await?;
8870 let entity: Option<SourcesTelegramRetrieveError> = serde_json::from_str(&content).ok();
8871 Err(Error::ResponseError(ResponseContent {
8872 status,
8873 content,
8874 entity,
8875 }))
8876 }
8877}
8878
8879pub async fn sources_telegram_update(
8881 configuration: &configuration::Configuration,
8882 slug: &str,
8883 telegram_source_request: models::TelegramSourceRequest,
8884) -> Result<models::TelegramSource, Error<SourcesTelegramUpdateError>> {
8885 let p_path_slug = slug;
8887 let p_body_telegram_source_request = telegram_source_request;
8888
8889 let uri_str = format!(
8890 "{}/sources/telegram/{slug}/",
8891 configuration.base_path,
8892 slug = crate::apis::urlencode(p_path_slug)
8893 );
8894 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8895
8896 if let Some(ref user_agent) = configuration.user_agent {
8897 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8898 }
8899 if let Some(ref token) = configuration.bearer_access_token {
8900 req_builder = req_builder.bearer_auth(token.to_owned());
8901 };
8902 req_builder = req_builder.json(&p_body_telegram_source_request);
8903
8904 let req = req_builder.build()?;
8905 let resp = configuration.client.execute(req).await?;
8906
8907 let status = resp.status();
8908 let content_type = resp
8909 .headers()
8910 .get("content-type")
8911 .and_then(|v| v.to_str().ok())
8912 .unwrap_or("application/octet-stream");
8913 let content_type = super::ContentType::from(content_type);
8914
8915 if !status.is_client_error() && !status.is_server_error() {
8916 let content = resp.text().await?;
8917 match content_type {
8918 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8919 ContentType::Text => {
8920 return Err(Error::from(serde_json::Error::custom(
8921 "Received `text/plain` content type response that cannot be converted to `models::TelegramSource`",
8922 )))
8923 }
8924 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8925 "Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSource`"
8926 )))),
8927 }
8928 } else {
8929 let content = resp.text().await?;
8930 let entity: Option<SourcesTelegramUpdateError> = serde_json::from_str(&content).ok();
8931 Err(Error::ResponseError(ResponseContent {
8932 status,
8933 content,
8934 entity,
8935 }))
8936 }
8937}
8938
8939pub async fn sources_telegram_used_by_list(
8941 configuration: &configuration::Configuration,
8942 slug: &str,
8943) -> Result<Vec<models::UsedBy>, Error<SourcesTelegramUsedByListError>> {
8944 let p_path_slug = slug;
8946
8947 let uri_str = format!(
8948 "{}/sources/telegram/{slug}/used_by/",
8949 configuration.base_path,
8950 slug = crate::apis::urlencode(p_path_slug)
8951 );
8952 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8953
8954 if let Some(ref user_agent) = configuration.user_agent {
8955 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8956 }
8957 if let Some(ref token) = configuration.bearer_access_token {
8958 req_builder = req_builder.bearer_auth(token.to_owned());
8959 };
8960
8961 let req = req_builder.build()?;
8962 let resp = configuration.client.execute(req).await?;
8963
8964 let status = resp.status();
8965 let content_type = resp
8966 .headers()
8967 .get("content-type")
8968 .and_then(|v| v.to_str().ok())
8969 .unwrap_or("application/octet-stream");
8970 let content_type = super::ContentType::from(content_type);
8971
8972 if !status.is_client_error() && !status.is_server_error() {
8973 let content = resp.text().await?;
8974 match content_type {
8975 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8976 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
8977 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
8978 }
8979 } else {
8980 let content = resp.text().await?;
8981 let entity: Option<SourcesTelegramUsedByListError> = serde_json::from_str(&content).ok();
8982 Err(Error::ResponseError(ResponseContent {
8983 status,
8984 content,
8985 entity,
8986 }))
8987 }
8988}
8989
8990pub async fn sources_user_connections_all_destroy(
8992 configuration: &configuration::Configuration,
8993 id: i32,
8994) -> Result<(), Error<SourcesUserConnectionsAllDestroyError>> {
8995 let p_path_id = id;
8997
8998 let uri_str = format!(
8999 "{}/sources/user_connections/all/{id}/",
9000 configuration.base_path,
9001 id = p_path_id
9002 );
9003 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9004
9005 if let Some(ref user_agent) = configuration.user_agent {
9006 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9007 }
9008 if let Some(ref token) = configuration.bearer_access_token {
9009 req_builder = req_builder.bearer_auth(token.to_owned());
9010 };
9011
9012 let req = req_builder.build()?;
9013 let resp = configuration.client.execute(req).await?;
9014
9015 let status = resp.status();
9016
9017 if !status.is_client_error() && !status.is_server_error() {
9018 Ok(())
9019 } else {
9020 let content = resp.text().await?;
9021 let entity: Option<SourcesUserConnectionsAllDestroyError> = serde_json::from_str(&content).ok();
9022 Err(Error::ResponseError(ResponseContent {
9023 status,
9024 content,
9025 entity,
9026 }))
9027 }
9028}
9029
9030pub async fn sources_user_connections_all_list(
9032 configuration: &configuration::Configuration,
9033 ordering: Option<&str>,
9034 page: Option<i32>,
9035 page_size: Option<i32>,
9036 search: Option<&str>,
9037 source__slug: Option<&str>,
9038 user: Option<i32>,
9039) -> Result<models::PaginatedUserSourceConnectionList, Error<SourcesUserConnectionsAllListError>> {
9040 let p_query_ordering = ordering;
9042 let p_query_page = page;
9043 let p_query_page_size = page_size;
9044 let p_query_search = search;
9045 let p_query_source__slug = source__slug;
9046 let p_query_user = user;
9047
9048 let uri_str = format!("{}/sources/user_connections/all/", configuration.base_path);
9049 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9050
9051 if let Some(ref param_value) = p_query_ordering {
9052 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
9053 }
9054 if let Some(ref param_value) = p_query_page {
9055 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
9056 }
9057 if let Some(ref param_value) = p_query_page_size {
9058 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
9059 }
9060 if let Some(ref param_value) = p_query_search {
9061 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
9062 }
9063 if let Some(ref param_value) = p_query_source__slug {
9064 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
9065 }
9066 if let Some(ref param_value) = p_query_user {
9067 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
9068 }
9069 if let Some(ref user_agent) = configuration.user_agent {
9070 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9071 }
9072 if let Some(ref token) = configuration.bearer_access_token {
9073 req_builder = req_builder.bearer_auth(token.to_owned());
9074 };
9075
9076 let req = req_builder.build()?;
9077 let resp = configuration.client.execute(req).await?;
9078
9079 let status = resp.status();
9080 let content_type = resp
9081 .headers()
9082 .get("content-type")
9083 .and_then(|v| v.to_str().ok())
9084 .unwrap_or("application/octet-stream");
9085 let content_type = super::ContentType::from(content_type);
9086
9087 if !status.is_client_error() && !status.is_server_error() {
9088 let content = resp.text().await?;
9089 match content_type {
9090 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9091 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserSourceConnectionList`"))),
9092 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserSourceConnectionList`")))),
9093 }
9094 } else {
9095 let content = resp.text().await?;
9096 let entity: Option<SourcesUserConnectionsAllListError> = serde_json::from_str(&content).ok();
9097 Err(Error::ResponseError(ResponseContent {
9098 status,
9099 content,
9100 entity,
9101 }))
9102 }
9103}
9104
9105pub async fn sources_user_connections_all_partial_update(
9107 configuration: &configuration::Configuration,
9108 id: i32,
9109 patched_user_source_connection_request: Option<models::PatchedUserSourceConnectionRequest>,
9110) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllPartialUpdateError>> {
9111 let p_path_id = id;
9113 let p_body_patched_user_source_connection_request = patched_user_source_connection_request;
9114
9115 let uri_str = format!(
9116 "{}/sources/user_connections/all/{id}/",
9117 configuration.base_path,
9118 id = p_path_id
9119 );
9120 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9121
9122 if let Some(ref user_agent) = configuration.user_agent {
9123 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9124 }
9125 if let Some(ref token) = configuration.bearer_access_token {
9126 req_builder = req_builder.bearer_auth(token.to_owned());
9127 };
9128 req_builder = req_builder.json(&p_body_patched_user_source_connection_request);
9129
9130 let req = req_builder.build()?;
9131 let resp = configuration.client.execute(req).await?;
9132
9133 let status = resp.status();
9134 let content_type = resp
9135 .headers()
9136 .get("content-type")
9137 .and_then(|v| v.to_str().ok())
9138 .unwrap_or("application/octet-stream");
9139 let content_type = super::ContentType::from(content_type);
9140
9141 if !status.is_client_error() && !status.is_server_error() {
9142 let content = resp.text().await?;
9143 match content_type {
9144 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9145 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
9146 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSourceConnection`")))),
9147 }
9148 } else {
9149 let content = resp.text().await?;
9150 let entity: Option<SourcesUserConnectionsAllPartialUpdateError> = serde_json::from_str(&content).ok();
9151 Err(Error::ResponseError(ResponseContent {
9152 status,
9153 content,
9154 entity,
9155 }))
9156 }
9157}
9158
9159pub async fn sources_user_connections_all_retrieve(
9161 configuration: &configuration::Configuration,
9162 id: i32,
9163) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllRetrieveError>> {
9164 let p_path_id = id;
9166
9167 let uri_str = format!(
9168 "{}/sources/user_connections/all/{id}/",
9169 configuration.base_path,
9170 id = p_path_id
9171 );
9172 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9173
9174 if let Some(ref user_agent) = configuration.user_agent {
9175 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9176 }
9177 if let Some(ref token) = configuration.bearer_access_token {
9178 req_builder = req_builder.bearer_auth(token.to_owned());
9179 };
9180
9181 let req = req_builder.build()?;
9182 let resp = configuration.client.execute(req).await?;
9183
9184 let status = resp.status();
9185 let content_type = resp
9186 .headers()
9187 .get("content-type")
9188 .and_then(|v| v.to_str().ok())
9189 .unwrap_or("application/octet-stream");
9190 let content_type = super::ContentType::from(content_type);
9191
9192 if !status.is_client_error() && !status.is_server_error() {
9193 let content = resp.text().await?;
9194 match content_type {
9195 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9196 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
9197 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSourceConnection`")))),
9198 }
9199 } else {
9200 let content = resp.text().await?;
9201 let entity: Option<SourcesUserConnectionsAllRetrieveError> = serde_json::from_str(&content).ok();
9202 Err(Error::ResponseError(ResponseContent {
9203 status,
9204 content,
9205 entity,
9206 }))
9207 }
9208}
9209
9210pub async fn sources_user_connections_all_update(
9212 configuration: &configuration::Configuration,
9213 id: i32,
9214 user_source_connection_request: models::UserSourceConnectionRequest,
9215) -> Result<models::UserSourceConnection, Error<SourcesUserConnectionsAllUpdateError>> {
9216 let p_path_id = id;
9218 let p_body_user_source_connection_request = user_source_connection_request;
9219
9220 let uri_str = format!(
9221 "{}/sources/user_connections/all/{id}/",
9222 configuration.base_path,
9223 id = p_path_id
9224 );
9225 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9226
9227 if let Some(ref user_agent) = configuration.user_agent {
9228 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9229 }
9230 if let Some(ref token) = configuration.bearer_access_token {
9231 req_builder = req_builder.bearer_auth(token.to_owned());
9232 };
9233 req_builder = req_builder.json(&p_body_user_source_connection_request);
9234
9235 let req = req_builder.build()?;
9236 let resp = configuration.client.execute(req).await?;
9237
9238 let status = resp.status();
9239 let content_type = resp
9240 .headers()
9241 .get("content-type")
9242 .and_then(|v| v.to_str().ok())
9243 .unwrap_or("application/octet-stream");
9244 let content_type = super::ContentType::from(content_type);
9245
9246 if !status.is_client_error() && !status.is_server_error() {
9247 let content = resp.text().await?;
9248 match content_type {
9249 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9250 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSourceConnection`"))),
9251 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSourceConnection`")))),
9252 }
9253 } else {
9254 let content = resp.text().await?;
9255 let entity: Option<SourcesUserConnectionsAllUpdateError> = serde_json::from_str(&content).ok();
9256 Err(Error::ResponseError(ResponseContent {
9257 status,
9258 content,
9259 entity,
9260 }))
9261 }
9262}
9263
9264pub async fn sources_user_connections_all_used_by_list(
9266 configuration: &configuration::Configuration,
9267 id: i32,
9268) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsAllUsedByListError>> {
9269 let p_path_id = id;
9271
9272 let uri_str = format!(
9273 "{}/sources/user_connections/all/{id}/used_by/",
9274 configuration.base_path,
9275 id = p_path_id
9276 );
9277 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9278
9279 if let Some(ref user_agent) = configuration.user_agent {
9280 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9281 }
9282 if let Some(ref token) = configuration.bearer_access_token {
9283 req_builder = req_builder.bearer_auth(token.to_owned());
9284 };
9285
9286 let req = req_builder.build()?;
9287 let resp = configuration.client.execute(req).await?;
9288
9289 let status = resp.status();
9290 let content_type = resp
9291 .headers()
9292 .get("content-type")
9293 .and_then(|v| v.to_str().ok())
9294 .unwrap_or("application/octet-stream");
9295 let content_type = super::ContentType::from(content_type);
9296
9297 if !status.is_client_error() && !status.is_server_error() {
9298 let content = resp.text().await?;
9299 match content_type {
9300 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9301 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
9302 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
9303 }
9304 } else {
9305 let content = resp.text().await?;
9306 let entity: Option<SourcesUserConnectionsAllUsedByListError> = serde_json::from_str(&content).ok();
9307 Err(Error::ResponseError(ResponseContent {
9308 status,
9309 content,
9310 entity,
9311 }))
9312 }
9313}
9314
9315pub async fn sources_user_connections_kerberos_create(
9317 configuration: &configuration::Configuration,
9318 user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest,
9319) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosCreateError>> {
9320 let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request;
9322
9323 let uri_str = format!("{}/sources/user_connections/kerberos/", configuration.base_path);
9324 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9325
9326 if let Some(ref user_agent) = configuration.user_agent {
9327 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9328 }
9329 if let Some(ref token) = configuration.bearer_access_token {
9330 req_builder = req_builder.bearer_auth(token.to_owned());
9331 };
9332 req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request);
9333
9334 let req = req_builder.build()?;
9335 let resp = configuration.client.execute(req).await?;
9336
9337 let status = resp.status();
9338 let content_type = resp
9339 .headers()
9340 .get("content-type")
9341 .and_then(|v| v.to_str().ok())
9342 .unwrap_or("application/octet-stream");
9343 let content_type = super::ContentType::from(content_type);
9344
9345 if !status.is_client_error() && !status.is_server_error() {
9346 let content = resp.text().await?;
9347 match content_type {
9348 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9349 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9350 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
9351 }
9352 } else {
9353 let content = resp.text().await?;
9354 let entity: Option<SourcesUserConnectionsKerberosCreateError> = serde_json::from_str(&content).ok();
9355 Err(Error::ResponseError(ResponseContent {
9356 status,
9357 content,
9358 entity,
9359 }))
9360 }
9361}
9362
9363pub async fn sources_user_connections_kerberos_destroy(
9365 configuration: &configuration::Configuration,
9366 id: i32,
9367) -> Result<(), Error<SourcesUserConnectionsKerberosDestroyError>> {
9368 let p_path_id = id;
9370
9371 let uri_str = format!(
9372 "{}/sources/user_connections/kerberos/{id}/",
9373 configuration.base_path,
9374 id = p_path_id
9375 );
9376 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9377
9378 if let Some(ref user_agent) = configuration.user_agent {
9379 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9380 }
9381 if let Some(ref token) = configuration.bearer_access_token {
9382 req_builder = req_builder.bearer_auth(token.to_owned());
9383 };
9384
9385 let req = req_builder.build()?;
9386 let resp = configuration.client.execute(req).await?;
9387
9388 let status = resp.status();
9389
9390 if !status.is_client_error() && !status.is_server_error() {
9391 Ok(())
9392 } else {
9393 let content = resp.text().await?;
9394 let entity: Option<SourcesUserConnectionsKerberosDestroyError> = serde_json::from_str(&content).ok();
9395 Err(Error::ResponseError(ResponseContent {
9396 status,
9397 content,
9398 entity,
9399 }))
9400 }
9401}
9402
9403pub async fn sources_user_connections_kerberos_list(
9405 configuration: &configuration::Configuration,
9406 ordering: Option<&str>,
9407 page: Option<i32>,
9408 page_size: Option<i32>,
9409 search: Option<&str>,
9410 source__slug: Option<&str>,
9411 user: Option<i32>,
9412) -> Result<models::PaginatedUserKerberosSourceConnectionList, Error<SourcesUserConnectionsKerberosListError>> {
9413 let p_query_ordering = ordering;
9415 let p_query_page = page;
9416 let p_query_page_size = page_size;
9417 let p_query_search = search;
9418 let p_query_source__slug = source__slug;
9419 let p_query_user = user;
9420
9421 let uri_str = format!("{}/sources/user_connections/kerberos/", configuration.base_path);
9422 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9423
9424 if let Some(ref param_value) = p_query_ordering {
9425 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
9426 }
9427 if let Some(ref param_value) = p_query_page {
9428 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
9429 }
9430 if let Some(ref param_value) = p_query_page_size {
9431 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
9432 }
9433 if let Some(ref param_value) = p_query_search {
9434 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
9435 }
9436 if let Some(ref param_value) = p_query_source__slug {
9437 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
9438 }
9439 if let Some(ref param_value) = p_query_user {
9440 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
9441 }
9442 if let Some(ref user_agent) = configuration.user_agent {
9443 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9444 }
9445 if let Some(ref token) = configuration.bearer_access_token {
9446 req_builder = req_builder.bearer_auth(token.to_owned());
9447 };
9448
9449 let req = req_builder.build()?;
9450 let resp = configuration.client.execute(req).await?;
9451
9452 let status = resp.status();
9453 let content_type = resp
9454 .headers()
9455 .get("content-type")
9456 .and_then(|v| v.to_str().ok())
9457 .unwrap_or("application/octet-stream");
9458 let content_type = super::ContentType::from(content_type);
9459
9460 if !status.is_client_error() && !status.is_server_error() {
9461 let content = resp.text().await?;
9462 match content_type {
9463 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9464 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserKerberosSourceConnectionList`"))),
9465 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserKerberosSourceConnectionList`")))),
9466 }
9467 } else {
9468 let content = resp.text().await?;
9469 let entity: Option<SourcesUserConnectionsKerberosListError> = serde_json::from_str(&content).ok();
9470 Err(Error::ResponseError(ResponseContent {
9471 status,
9472 content,
9473 entity,
9474 }))
9475 }
9476}
9477
9478pub async fn sources_user_connections_kerberos_partial_update(
9480 configuration: &configuration::Configuration,
9481 id: i32,
9482 patched_user_kerberos_source_connection_request: Option<models::PatchedUserKerberosSourceConnectionRequest>,
9483) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosPartialUpdateError>> {
9484 let p_path_id = id;
9486 let p_body_patched_user_kerberos_source_connection_request = patched_user_kerberos_source_connection_request;
9487
9488 let uri_str = format!(
9489 "{}/sources/user_connections/kerberos/{id}/",
9490 configuration.base_path,
9491 id = p_path_id
9492 );
9493 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9494
9495 if let Some(ref user_agent) = configuration.user_agent {
9496 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9497 }
9498 if let Some(ref token) = configuration.bearer_access_token {
9499 req_builder = req_builder.bearer_auth(token.to_owned());
9500 };
9501 req_builder = req_builder.json(&p_body_patched_user_kerberos_source_connection_request);
9502
9503 let req = req_builder.build()?;
9504 let resp = configuration.client.execute(req).await?;
9505
9506 let status = resp.status();
9507 let content_type = resp
9508 .headers()
9509 .get("content-type")
9510 .and_then(|v| v.to_str().ok())
9511 .unwrap_or("application/octet-stream");
9512 let content_type = super::ContentType::from(content_type);
9513
9514 if !status.is_client_error() && !status.is_server_error() {
9515 let content = resp.text().await?;
9516 match content_type {
9517 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9518 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9519 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
9520 }
9521 } else {
9522 let content = resp.text().await?;
9523 let entity: Option<SourcesUserConnectionsKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
9524 Err(Error::ResponseError(ResponseContent {
9525 status,
9526 content,
9527 entity,
9528 }))
9529 }
9530}
9531
9532pub async fn sources_user_connections_kerberos_retrieve(
9534 configuration: &configuration::Configuration,
9535 id: i32,
9536) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosRetrieveError>> {
9537 let p_path_id = id;
9539
9540 let uri_str = format!(
9541 "{}/sources/user_connections/kerberos/{id}/",
9542 configuration.base_path,
9543 id = p_path_id
9544 );
9545 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9546
9547 if let Some(ref user_agent) = configuration.user_agent {
9548 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9549 }
9550 if let Some(ref token) = configuration.bearer_access_token {
9551 req_builder = req_builder.bearer_auth(token.to_owned());
9552 };
9553
9554 let req = req_builder.build()?;
9555 let resp = configuration.client.execute(req).await?;
9556
9557 let status = resp.status();
9558 let content_type = resp
9559 .headers()
9560 .get("content-type")
9561 .and_then(|v| v.to_str().ok())
9562 .unwrap_or("application/octet-stream");
9563 let content_type = super::ContentType::from(content_type);
9564
9565 if !status.is_client_error() && !status.is_server_error() {
9566 let content = resp.text().await?;
9567 match content_type {
9568 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9569 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9570 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
9571 }
9572 } else {
9573 let content = resp.text().await?;
9574 let entity: Option<SourcesUserConnectionsKerberosRetrieveError> = serde_json::from_str(&content).ok();
9575 Err(Error::ResponseError(ResponseContent {
9576 status,
9577 content,
9578 entity,
9579 }))
9580 }
9581}
9582
9583pub async fn sources_user_connections_kerberos_update(
9585 configuration: &configuration::Configuration,
9586 id: i32,
9587 user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest,
9588) -> Result<models::UserKerberosSourceConnection, Error<SourcesUserConnectionsKerberosUpdateError>> {
9589 let p_path_id = id;
9591 let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request;
9592
9593 let uri_str = format!(
9594 "{}/sources/user_connections/kerberos/{id}/",
9595 configuration.base_path,
9596 id = p_path_id
9597 );
9598 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9599
9600 if let Some(ref user_agent) = configuration.user_agent {
9601 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9602 }
9603 if let Some(ref token) = configuration.bearer_access_token {
9604 req_builder = req_builder.bearer_auth(token.to_owned());
9605 };
9606 req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request);
9607
9608 let req = req_builder.build()?;
9609 let resp = configuration.client.execute(req).await?;
9610
9611 let status = resp.status();
9612 let content_type = resp
9613 .headers()
9614 .get("content-type")
9615 .and_then(|v| v.to_str().ok())
9616 .unwrap_or("application/octet-stream");
9617 let content_type = super::ContentType::from(content_type);
9618
9619 if !status.is_client_error() && !status.is_server_error() {
9620 let content = resp.text().await?;
9621 match content_type {
9622 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9623 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserKerberosSourceConnection`"))),
9624 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserKerberosSourceConnection`")))),
9625 }
9626 } else {
9627 let content = resp.text().await?;
9628 let entity: Option<SourcesUserConnectionsKerberosUpdateError> = serde_json::from_str(&content).ok();
9629 Err(Error::ResponseError(ResponseContent {
9630 status,
9631 content,
9632 entity,
9633 }))
9634 }
9635}
9636
9637pub async fn sources_user_connections_kerberos_used_by_list(
9639 configuration: &configuration::Configuration,
9640 id: i32,
9641) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsKerberosUsedByListError>> {
9642 let p_path_id = id;
9644
9645 let uri_str = format!(
9646 "{}/sources/user_connections/kerberos/{id}/used_by/",
9647 configuration.base_path,
9648 id = p_path_id
9649 );
9650 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9651
9652 if let Some(ref user_agent) = configuration.user_agent {
9653 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9654 }
9655 if let Some(ref token) = configuration.bearer_access_token {
9656 req_builder = req_builder.bearer_auth(token.to_owned());
9657 };
9658
9659 let req = req_builder.build()?;
9660 let resp = configuration.client.execute(req).await?;
9661
9662 let status = resp.status();
9663 let content_type = resp
9664 .headers()
9665 .get("content-type")
9666 .and_then(|v| v.to_str().ok())
9667 .unwrap_or("application/octet-stream");
9668 let content_type = super::ContentType::from(content_type);
9669
9670 if !status.is_client_error() && !status.is_server_error() {
9671 let content = resp.text().await?;
9672 match content_type {
9673 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9674 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
9675 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
9676 }
9677 } else {
9678 let content = resp.text().await?;
9679 let entity: Option<SourcesUserConnectionsKerberosUsedByListError> = serde_json::from_str(&content).ok();
9680 Err(Error::ResponseError(ResponseContent {
9681 status,
9682 content,
9683 entity,
9684 }))
9685 }
9686}
9687
9688pub async fn sources_user_connections_ldap_create(
9690 configuration: &configuration::Configuration,
9691 user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest,
9692) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapCreateError>> {
9693 let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request;
9695
9696 let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path);
9697 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9698
9699 if let Some(ref user_agent) = configuration.user_agent {
9700 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9701 }
9702 if let Some(ref token) = configuration.bearer_access_token {
9703 req_builder = req_builder.bearer_auth(token.to_owned());
9704 };
9705 req_builder = req_builder.json(&p_body_user_ldap_source_connection_request);
9706
9707 let req = req_builder.build()?;
9708 let resp = configuration.client.execute(req).await?;
9709
9710 let status = resp.status();
9711 let content_type = resp
9712 .headers()
9713 .get("content-type")
9714 .and_then(|v| v.to_str().ok())
9715 .unwrap_or("application/octet-stream");
9716 let content_type = super::ContentType::from(content_type);
9717
9718 if !status.is_client_error() && !status.is_server_error() {
9719 let content = resp.text().await?;
9720 match content_type {
9721 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9722 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9723 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
9724 }
9725 } else {
9726 let content = resp.text().await?;
9727 let entity: Option<SourcesUserConnectionsLdapCreateError> = serde_json::from_str(&content).ok();
9728 Err(Error::ResponseError(ResponseContent {
9729 status,
9730 content,
9731 entity,
9732 }))
9733 }
9734}
9735
9736pub async fn sources_user_connections_ldap_destroy(
9738 configuration: &configuration::Configuration,
9739 id: i32,
9740) -> Result<(), Error<SourcesUserConnectionsLdapDestroyError>> {
9741 let p_path_id = id;
9743
9744 let uri_str = format!(
9745 "{}/sources/user_connections/ldap/{id}/",
9746 configuration.base_path,
9747 id = p_path_id
9748 );
9749 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9750
9751 if let Some(ref user_agent) = configuration.user_agent {
9752 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9753 }
9754 if let Some(ref token) = configuration.bearer_access_token {
9755 req_builder = req_builder.bearer_auth(token.to_owned());
9756 };
9757
9758 let req = req_builder.build()?;
9759 let resp = configuration.client.execute(req).await?;
9760
9761 let status = resp.status();
9762
9763 if !status.is_client_error() && !status.is_server_error() {
9764 Ok(())
9765 } else {
9766 let content = resp.text().await?;
9767 let entity: Option<SourcesUserConnectionsLdapDestroyError> = serde_json::from_str(&content).ok();
9768 Err(Error::ResponseError(ResponseContent {
9769 status,
9770 content,
9771 entity,
9772 }))
9773 }
9774}
9775
9776pub async fn sources_user_connections_ldap_list(
9778 configuration: &configuration::Configuration,
9779 ordering: Option<&str>,
9780 page: Option<i32>,
9781 page_size: Option<i32>,
9782 search: Option<&str>,
9783 source__slug: Option<&str>,
9784 user: Option<i32>,
9785) -> Result<models::PaginatedUserLdapSourceConnectionList, Error<SourcesUserConnectionsLdapListError>> {
9786 let p_query_ordering = ordering;
9788 let p_query_page = page;
9789 let p_query_page_size = page_size;
9790 let p_query_search = search;
9791 let p_query_source__slug = source__slug;
9792 let p_query_user = user;
9793
9794 let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path);
9795 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9796
9797 if let Some(ref param_value) = p_query_ordering {
9798 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
9799 }
9800 if let Some(ref param_value) = p_query_page {
9801 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
9802 }
9803 if let Some(ref param_value) = p_query_page_size {
9804 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
9805 }
9806 if let Some(ref param_value) = p_query_search {
9807 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
9808 }
9809 if let Some(ref param_value) = p_query_source__slug {
9810 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
9811 }
9812 if let Some(ref param_value) = p_query_user {
9813 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
9814 }
9815 if let Some(ref user_agent) = configuration.user_agent {
9816 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9817 }
9818 if let Some(ref token) = configuration.bearer_access_token {
9819 req_builder = req_builder.bearer_auth(token.to_owned());
9820 };
9821
9822 let req = req_builder.build()?;
9823 let resp = configuration.client.execute(req).await?;
9824
9825 let status = resp.status();
9826 let content_type = resp
9827 .headers()
9828 .get("content-type")
9829 .and_then(|v| v.to_str().ok())
9830 .unwrap_or("application/octet-stream");
9831 let content_type = super::ContentType::from(content_type);
9832
9833 if !status.is_client_error() && !status.is_server_error() {
9834 let content = resp.text().await?;
9835 match content_type {
9836 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9837 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserLdapSourceConnectionList`"))),
9838 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserLdapSourceConnectionList`")))),
9839 }
9840 } else {
9841 let content = resp.text().await?;
9842 let entity: Option<SourcesUserConnectionsLdapListError> = serde_json::from_str(&content).ok();
9843 Err(Error::ResponseError(ResponseContent {
9844 status,
9845 content,
9846 entity,
9847 }))
9848 }
9849}
9850
9851pub async fn sources_user_connections_ldap_partial_update(
9853 configuration: &configuration::Configuration,
9854 id: i32,
9855 patched_user_ldap_source_connection_request: Option<models::PatchedUserLdapSourceConnectionRequest>,
9856) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapPartialUpdateError>> {
9857 let p_path_id = id;
9859 let p_body_patched_user_ldap_source_connection_request = patched_user_ldap_source_connection_request;
9860
9861 let uri_str = format!(
9862 "{}/sources/user_connections/ldap/{id}/",
9863 configuration.base_path,
9864 id = p_path_id
9865 );
9866 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9867
9868 if let Some(ref user_agent) = configuration.user_agent {
9869 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9870 }
9871 if let Some(ref token) = configuration.bearer_access_token {
9872 req_builder = req_builder.bearer_auth(token.to_owned());
9873 };
9874 req_builder = req_builder.json(&p_body_patched_user_ldap_source_connection_request);
9875
9876 let req = req_builder.build()?;
9877 let resp = configuration.client.execute(req).await?;
9878
9879 let status = resp.status();
9880 let content_type = resp
9881 .headers()
9882 .get("content-type")
9883 .and_then(|v| v.to_str().ok())
9884 .unwrap_or("application/octet-stream");
9885 let content_type = super::ContentType::from(content_type);
9886
9887 if !status.is_client_error() && !status.is_server_error() {
9888 let content = resp.text().await?;
9889 match content_type {
9890 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9891 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9892 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
9893 }
9894 } else {
9895 let content = resp.text().await?;
9896 let entity: Option<SourcesUserConnectionsLdapPartialUpdateError> = serde_json::from_str(&content).ok();
9897 Err(Error::ResponseError(ResponseContent {
9898 status,
9899 content,
9900 entity,
9901 }))
9902 }
9903}
9904
9905pub async fn sources_user_connections_ldap_retrieve(
9907 configuration: &configuration::Configuration,
9908 id: i32,
9909) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapRetrieveError>> {
9910 let p_path_id = id;
9912
9913 let uri_str = format!(
9914 "{}/sources/user_connections/ldap/{id}/",
9915 configuration.base_path,
9916 id = p_path_id
9917 );
9918 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9919
9920 if let Some(ref user_agent) = configuration.user_agent {
9921 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9922 }
9923 if let Some(ref token) = configuration.bearer_access_token {
9924 req_builder = req_builder.bearer_auth(token.to_owned());
9925 };
9926
9927 let req = req_builder.build()?;
9928 let resp = configuration.client.execute(req).await?;
9929
9930 let status = resp.status();
9931 let content_type = resp
9932 .headers()
9933 .get("content-type")
9934 .and_then(|v| v.to_str().ok())
9935 .unwrap_or("application/octet-stream");
9936 let content_type = super::ContentType::from(content_type);
9937
9938 if !status.is_client_error() && !status.is_server_error() {
9939 let content = resp.text().await?;
9940 match content_type {
9941 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9942 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9943 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
9944 }
9945 } else {
9946 let content = resp.text().await?;
9947 let entity: Option<SourcesUserConnectionsLdapRetrieveError> = serde_json::from_str(&content).ok();
9948 Err(Error::ResponseError(ResponseContent {
9949 status,
9950 content,
9951 entity,
9952 }))
9953 }
9954}
9955
9956pub async fn sources_user_connections_ldap_update(
9958 configuration: &configuration::Configuration,
9959 id: i32,
9960 user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest,
9961) -> Result<models::UserLdapSourceConnection, Error<SourcesUserConnectionsLdapUpdateError>> {
9962 let p_path_id = id;
9964 let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request;
9965
9966 let uri_str = format!(
9967 "{}/sources/user_connections/ldap/{id}/",
9968 configuration.base_path,
9969 id = p_path_id
9970 );
9971 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9972
9973 if let Some(ref user_agent) = configuration.user_agent {
9974 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9975 }
9976 if let Some(ref token) = configuration.bearer_access_token {
9977 req_builder = req_builder.bearer_auth(token.to_owned());
9978 };
9979 req_builder = req_builder.json(&p_body_user_ldap_source_connection_request);
9980
9981 let req = req_builder.build()?;
9982 let resp = configuration.client.execute(req).await?;
9983
9984 let status = resp.status();
9985 let content_type = resp
9986 .headers()
9987 .get("content-type")
9988 .and_then(|v| v.to_str().ok())
9989 .unwrap_or("application/octet-stream");
9990 let content_type = super::ContentType::from(content_type);
9991
9992 if !status.is_client_error() && !status.is_server_error() {
9993 let content = resp.text().await?;
9994 match content_type {
9995 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9996 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLdapSourceConnection`"))),
9997 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLdapSourceConnection`")))),
9998 }
9999 } else {
10000 let content = resp.text().await?;
10001 let entity: Option<SourcesUserConnectionsLdapUpdateError> = serde_json::from_str(&content).ok();
10002 Err(Error::ResponseError(ResponseContent {
10003 status,
10004 content,
10005 entity,
10006 }))
10007 }
10008}
10009
10010pub async fn sources_user_connections_ldap_used_by_list(
10012 configuration: &configuration::Configuration,
10013 id: i32,
10014) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsLdapUsedByListError>> {
10015 let p_path_id = id;
10017
10018 let uri_str = format!(
10019 "{}/sources/user_connections/ldap/{id}/used_by/",
10020 configuration.base_path,
10021 id = p_path_id
10022 );
10023 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10024
10025 if let Some(ref user_agent) = configuration.user_agent {
10026 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10027 }
10028 if let Some(ref token) = configuration.bearer_access_token {
10029 req_builder = req_builder.bearer_auth(token.to_owned());
10030 };
10031
10032 let req = req_builder.build()?;
10033 let resp = configuration.client.execute(req).await?;
10034
10035 let status = resp.status();
10036 let content_type = resp
10037 .headers()
10038 .get("content-type")
10039 .and_then(|v| v.to_str().ok())
10040 .unwrap_or("application/octet-stream");
10041 let content_type = super::ContentType::from(content_type);
10042
10043 if !status.is_client_error() && !status.is_server_error() {
10044 let content = resp.text().await?;
10045 match content_type {
10046 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10047 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
10048 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
10049 }
10050 } else {
10051 let content = resp.text().await?;
10052 let entity: Option<SourcesUserConnectionsLdapUsedByListError> = serde_json::from_str(&content).ok();
10053 Err(Error::ResponseError(ResponseContent {
10054 status,
10055 content,
10056 entity,
10057 }))
10058 }
10059}
10060
10061pub async fn sources_user_connections_oauth_create(
10063 configuration: &configuration::Configuration,
10064 user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest,
10065) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthCreateError>> {
10066 let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request;
10068
10069 let uri_str = format!("{}/sources/user_connections/oauth/", configuration.base_path);
10070 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10071
10072 if let Some(ref user_agent) = configuration.user_agent {
10073 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10074 }
10075 if let Some(ref token) = configuration.bearer_access_token {
10076 req_builder = req_builder.bearer_auth(token.to_owned());
10077 };
10078 req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request);
10079
10080 let req = req_builder.build()?;
10081 let resp = configuration.client.execute(req).await?;
10082
10083 let status = resp.status();
10084 let content_type = resp
10085 .headers()
10086 .get("content-type")
10087 .and_then(|v| v.to_str().ok())
10088 .unwrap_or("application/octet-stream");
10089 let content_type = super::ContentType::from(content_type);
10090
10091 if !status.is_client_error() && !status.is_server_error() {
10092 let content = resp.text().await?;
10093 match content_type {
10094 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10095 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10096 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
10097 }
10098 } else {
10099 let content = resp.text().await?;
10100 let entity: Option<SourcesUserConnectionsOauthCreateError> = serde_json::from_str(&content).ok();
10101 Err(Error::ResponseError(ResponseContent {
10102 status,
10103 content,
10104 entity,
10105 }))
10106 }
10107}
10108
10109pub async fn sources_user_connections_oauth_destroy(
10111 configuration: &configuration::Configuration,
10112 id: i32,
10113) -> Result<(), Error<SourcesUserConnectionsOauthDestroyError>> {
10114 let p_path_id = id;
10116
10117 let uri_str = format!(
10118 "{}/sources/user_connections/oauth/{id}/",
10119 configuration.base_path,
10120 id = p_path_id
10121 );
10122 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10123
10124 if let Some(ref user_agent) = configuration.user_agent {
10125 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10126 }
10127 if let Some(ref token) = configuration.bearer_access_token {
10128 req_builder = req_builder.bearer_auth(token.to_owned());
10129 };
10130
10131 let req = req_builder.build()?;
10132 let resp = configuration.client.execute(req).await?;
10133
10134 let status = resp.status();
10135
10136 if !status.is_client_error() && !status.is_server_error() {
10137 Ok(())
10138 } else {
10139 let content = resp.text().await?;
10140 let entity: Option<SourcesUserConnectionsOauthDestroyError> = serde_json::from_str(&content).ok();
10141 Err(Error::ResponseError(ResponseContent {
10142 status,
10143 content,
10144 entity,
10145 }))
10146 }
10147}
10148
10149pub async fn sources_user_connections_oauth_list(
10151 configuration: &configuration::Configuration,
10152 ordering: Option<&str>,
10153 page: Option<i32>,
10154 page_size: Option<i32>,
10155 search: Option<&str>,
10156 source__slug: Option<&str>,
10157 user: Option<i32>,
10158) -> Result<models::PaginatedUserOAuthSourceConnectionList, Error<SourcesUserConnectionsOauthListError>> {
10159 let p_query_ordering = ordering;
10161 let p_query_page = page;
10162 let p_query_page_size = page_size;
10163 let p_query_search = search;
10164 let p_query_source__slug = source__slug;
10165 let p_query_user = user;
10166
10167 let uri_str = format!("{}/sources/user_connections/oauth/", configuration.base_path);
10168 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10169
10170 if let Some(ref param_value) = p_query_ordering {
10171 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
10172 }
10173 if let Some(ref param_value) = p_query_page {
10174 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
10175 }
10176 if let Some(ref param_value) = p_query_page_size {
10177 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
10178 }
10179 if let Some(ref param_value) = p_query_search {
10180 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
10181 }
10182 if let Some(ref param_value) = p_query_source__slug {
10183 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
10184 }
10185 if let Some(ref param_value) = p_query_user {
10186 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
10187 }
10188 if let Some(ref user_agent) = configuration.user_agent {
10189 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10190 }
10191 if let Some(ref token) = configuration.bearer_access_token {
10192 req_builder = req_builder.bearer_auth(token.to_owned());
10193 };
10194
10195 let req = req_builder.build()?;
10196 let resp = configuration.client.execute(req).await?;
10197
10198 let status = resp.status();
10199 let content_type = resp
10200 .headers()
10201 .get("content-type")
10202 .and_then(|v| v.to_str().ok())
10203 .unwrap_or("application/octet-stream");
10204 let content_type = super::ContentType::from(content_type);
10205
10206 if !status.is_client_error() && !status.is_server_error() {
10207 let content = resp.text().await?;
10208 match content_type {
10209 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10210 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserOAuthSourceConnectionList`"))),
10211 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserOAuthSourceConnectionList`")))),
10212 }
10213 } else {
10214 let content = resp.text().await?;
10215 let entity: Option<SourcesUserConnectionsOauthListError> = serde_json::from_str(&content).ok();
10216 Err(Error::ResponseError(ResponseContent {
10217 status,
10218 content,
10219 entity,
10220 }))
10221 }
10222}
10223
10224pub async fn sources_user_connections_oauth_partial_update(
10226 configuration: &configuration::Configuration,
10227 id: i32,
10228 patched_user_o_auth_source_connection_request: Option<models::PatchedUserOAuthSourceConnectionRequest>,
10229) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthPartialUpdateError>> {
10230 let p_path_id = id;
10232 let p_body_patched_user_o_auth_source_connection_request = patched_user_o_auth_source_connection_request;
10233
10234 let uri_str = format!(
10235 "{}/sources/user_connections/oauth/{id}/",
10236 configuration.base_path,
10237 id = p_path_id
10238 );
10239 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10240
10241 if let Some(ref user_agent) = configuration.user_agent {
10242 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10243 }
10244 if let Some(ref token) = configuration.bearer_access_token {
10245 req_builder = req_builder.bearer_auth(token.to_owned());
10246 };
10247 req_builder = req_builder.json(&p_body_patched_user_o_auth_source_connection_request);
10248
10249 let req = req_builder.build()?;
10250 let resp = configuration.client.execute(req).await?;
10251
10252 let status = resp.status();
10253 let content_type = resp
10254 .headers()
10255 .get("content-type")
10256 .and_then(|v| v.to_str().ok())
10257 .unwrap_or("application/octet-stream");
10258 let content_type = super::ContentType::from(content_type);
10259
10260 if !status.is_client_error() && !status.is_server_error() {
10261 let content = resp.text().await?;
10262 match content_type {
10263 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10264 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10265 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
10266 }
10267 } else {
10268 let content = resp.text().await?;
10269 let entity: Option<SourcesUserConnectionsOauthPartialUpdateError> = serde_json::from_str(&content).ok();
10270 Err(Error::ResponseError(ResponseContent {
10271 status,
10272 content,
10273 entity,
10274 }))
10275 }
10276}
10277
10278pub async fn sources_user_connections_oauth_retrieve(
10280 configuration: &configuration::Configuration,
10281 id: i32,
10282) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthRetrieveError>> {
10283 let p_path_id = id;
10285
10286 let uri_str = format!(
10287 "{}/sources/user_connections/oauth/{id}/",
10288 configuration.base_path,
10289 id = p_path_id
10290 );
10291 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10292
10293 if let Some(ref user_agent) = configuration.user_agent {
10294 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10295 }
10296 if let Some(ref token) = configuration.bearer_access_token {
10297 req_builder = req_builder.bearer_auth(token.to_owned());
10298 };
10299
10300 let req = req_builder.build()?;
10301 let resp = configuration.client.execute(req).await?;
10302
10303 let status = resp.status();
10304 let content_type = resp
10305 .headers()
10306 .get("content-type")
10307 .and_then(|v| v.to_str().ok())
10308 .unwrap_or("application/octet-stream");
10309 let content_type = super::ContentType::from(content_type);
10310
10311 if !status.is_client_error() && !status.is_server_error() {
10312 let content = resp.text().await?;
10313 match content_type {
10314 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10315 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10316 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
10317 }
10318 } else {
10319 let content = resp.text().await?;
10320 let entity: Option<SourcesUserConnectionsOauthRetrieveError> = serde_json::from_str(&content).ok();
10321 Err(Error::ResponseError(ResponseContent {
10322 status,
10323 content,
10324 entity,
10325 }))
10326 }
10327}
10328
10329pub async fn sources_user_connections_oauth_update(
10331 configuration: &configuration::Configuration,
10332 id: i32,
10333 user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest,
10334) -> Result<models::UserOAuthSourceConnection, Error<SourcesUserConnectionsOauthUpdateError>> {
10335 let p_path_id = id;
10337 let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request;
10338
10339 let uri_str = format!(
10340 "{}/sources/user_connections/oauth/{id}/",
10341 configuration.base_path,
10342 id = p_path_id
10343 );
10344 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10345
10346 if let Some(ref user_agent) = configuration.user_agent {
10347 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10348 }
10349 if let Some(ref token) = configuration.bearer_access_token {
10350 req_builder = req_builder.bearer_auth(token.to_owned());
10351 };
10352 req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request);
10353
10354 let req = req_builder.build()?;
10355 let resp = configuration.client.execute(req).await?;
10356
10357 let status = resp.status();
10358 let content_type = resp
10359 .headers()
10360 .get("content-type")
10361 .and_then(|v| v.to_str().ok())
10362 .unwrap_or("application/octet-stream");
10363 let content_type = super::ContentType::from(content_type);
10364
10365 if !status.is_client_error() && !status.is_server_error() {
10366 let content = resp.text().await?;
10367 match content_type {
10368 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10369 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserOAuthSourceConnection`"))),
10370 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserOAuthSourceConnection`")))),
10371 }
10372 } else {
10373 let content = resp.text().await?;
10374 let entity: Option<SourcesUserConnectionsOauthUpdateError> = serde_json::from_str(&content).ok();
10375 Err(Error::ResponseError(ResponseContent {
10376 status,
10377 content,
10378 entity,
10379 }))
10380 }
10381}
10382
10383pub async fn sources_user_connections_oauth_used_by_list(
10385 configuration: &configuration::Configuration,
10386 id: i32,
10387) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsOauthUsedByListError>> {
10388 let p_path_id = id;
10390
10391 let uri_str = format!(
10392 "{}/sources/user_connections/oauth/{id}/used_by/",
10393 configuration.base_path,
10394 id = p_path_id
10395 );
10396 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10397
10398 if let Some(ref user_agent) = configuration.user_agent {
10399 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10400 }
10401 if let Some(ref token) = configuration.bearer_access_token {
10402 req_builder = req_builder.bearer_auth(token.to_owned());
10403 };
10404
10405 let req = req_builder.build()?;
10406 let resp = configuration.client.execute(req).await?;
10407
10408 let status = resp.status();
10409 let content_type = resp
10410 .headers()
10411 .get("content-type")
10412 .and_then(|v| v.to_str().ok())
10413 .unwrap_or("application/octet-stream");
10414 let content_type = super::ContentType::from(content_type);
10415
10416 if !status.is_client_error() && !status.is_server_error() {
10417 let content = resp.text().await?;
10418 match content_type {
10419 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10420 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
10421 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
10422 }
10423 } else {
10424 let content = resp.text().await?;
10425 let entity: Option<SourcesUserConnectionsOauthUsedByListError> = serde_json::from_str(&content).ok();
10426 Err(Error::ResponseError(ResponseContent {
10427 status,
10428 content,
10429 entity,
10430 }))
10431 }
10432}
10433
10434pub async fn sources_user_connections_plex_create(
10436 configuration: &configuration::Configuration,
10437 user_plex_source_connection_request: models::UserPlexSourceConnectionRequest,
10438) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexCreateError>> {
10439 let p_body_user_plex_source_connection_request = user_plex_source_connection_request;
10441
10442 let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path);
10443 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10444
10445 if let Some(ref user_agent) = configuration.user_agent {
10446 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10447 }
10448 if let Some(ref token) = configuration.bearer_access_token {
10449 req_builder = req_builder.bearer_auth(token.to_owned());
10450 };
10451 req_builder = req_builder.json(&p_body_user_plex_source_connection_request);
10452
10453 let req = req_builder.build()?;
10454 let resp = configuration.client.execute(req).await?;
10455
10456 let status = resp.status();
10457 let content_type = resp
10458 .headers()
10459 .get("content-type")
10460 .and_then(|v| v.to_str().ok())
10461 .unwrap_or("application/octet-stream");
10462 let content_type = super::ContentType::from(content_type);
10463
10464 if !status.is_client_error() && !status.is_server_error() {
10465 let content = resp.text().await?;
10466 match content_type {
10467 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10468 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10469 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
10470 }
10471 } else {
10472 let content = resp.text().await?;
10473 let entity: Option<SourcesUserConnectionsPlexCreateError> = serde_json::from_str(&content).ok();
10474 Err(Error::ResponseError(ResponseContent {
10475 status,
10476 content,
10477 entity,
10478 }))
10479 }
10480}
10481
10482pub async fn sources_user_connections_plex_destroy(
10484 configuration: &configuration::Configuration,
10485 id: i32,
10486) -> Result<(), Error<SourcesUserConnectionsPlexDestroyError>> {
10487 let p_path_id = id;
10489
10490 let uri_str = format!(
10491 "{}/sources/user_connections/plex/{id}/",
10492 configuration.base_path,
10493 id = p_path_id
10494 );
10495 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10496
10497 if let Some(ref user_agent) = configuration.user_agent {
10498 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10499 }
10500 if let Some(ref token) = configuration.bearer_access_token {
10501 req_builder = req_builder.bearer_auth(token.to_owned());
10502 };
10503
10504 let req = req_builder.build()?;
10505 let resp = configuration.client.execute(req).await?;
10506
10507 let status = resp.status();
10508
10509 if !status.is_client_error() && !status.is_server_error() {
10510 Ok(())
10511 } else {
10512 let content = resp.text().await?;
10513 let entity: Option<SourcesUserConnectionsPlexDestroyError> = serde_json::from_str(&content).ok();
10514 Err(Error::ResponseError(ResponseContent {
10515 status,
10516 content,
10517 entity,
10518 }))
10519 }
10520}
10521
10522pub async fn sources_user_connections_plex_list(
10524 configuration: &configuration::Configuration,
10525 ordering: Option<&str>,
10526 page: Option<i32>,
10527 page_size: Option<i32>,
10528 search: Option<&str>,
10529 source__slug: Option<&str>,
10530 user: Option<i32>,
10531) -> Result<models::PaginatedUserPlexSourceConnectionList, Error<SourcesUserConnectionsPlexListError>> {
10532 let p_query_ordering = ordering;
10534 let p_query_page = page;
10535 let p_query_page_size = page_size;
10536 let p_query_search = search;
10537 let p_query_source__slug = source__slug;
10538 let p_query_user = user;
10539
10540 let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path);
10541 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10542
10543 if let Some(ref param_value) = p_query_ordering {
10544 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
10545 }
10546 if let Some(ref param_value) = p_query_page {
10547 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
10548 }
10549 if let Some(ref param_value) = p_query_page_size {
10550 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
10551 }
10552 if let Some(ref param_value) = p_query_search {
10553 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
10554 }
10555 if let Some(ref param_value) = p_query_source__slug {
10556 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
10557 }
10558 if let Some(ref param_value) = p_query_user {
10559 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
10560 }
10561 if let Some(ref user_agent) = configuration.user_agent {
10562 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10563 }
10564 if let Some(ref token) = configuration.bearer_access_token {
10565 req_builder = req_builder.bearer_auth(token.to_owned());
10566 };
10567
10568 let req = req_builder.build()?;
10569 let resp = configuration.client.execute(req).await?;
10570
10571 let status = resp.status();
10572 let content_type = resp
10573 .headers()
10574 .get("content-type")
10575 .and_then(|v| v.to_str().ok())
10576 .unwrap_or("application/octet-stream");
10577 let content_type = super::ContentType::from(content_type);
10578
10579 if !status.is_client_error() && !status.is_server_error() {
10580 let content = resp.text().await?;
10581 match content_type {
10582 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10583 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserPlexSourceConnectionList`"))),
10584 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserPlexSourceConnectionList`")))),
10585 }
10586 } else {
10587 let content = resp.text().await?;
10588 let entity: Option<SourcesUserConnectionsPlexListError> = serde_json::from_str(&content).ok();
10589 Err(Error::ResponseError(ResponseContent {
10590 status,
10591 content,
10592 entity,
10593 }))
10594 }
10595}
10596
10597pub async fn sources_user_connections_plex_partial_update(
10599 configuration: &configuration::Configuration,
10600 id: i32,
10601 patched_user_plex_source_connection_request: Option<models::PatchedUserPlexSourceConnectionRequest>,
10602) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexPartialUpdateError>> {
10603 let p_path_id = id;
10605 let p_body_patched_user_plex_source_connection_request = patched_user_plex_source_connection_request;
10606
10607 let uri_str = format!(
10608 "{}/sources/user_connections/plex/{id}/",
10609 configuration.base_path,
10610 id = p_path_id
10611 );
10612 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10613
10614 if let Some(ref user_agent) = configuration.user_agent {
10615 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10616 }
10617 if let Some(ref token) = configuration.bearer_access_token {
10618 req_builder = req_builder.bearer_auth(token.to_owned());
10619 };
10620 req_builder = req_builder.json(&p_body_patched_user_plex_source_connection_request);
10621
10622 let req = req_builder.build()?;
10623 let resp = configuration.client.execute(req).await?;
10624
10625 let status = resp.status();
10626 let content_type = resp
10627 .headers()
10628 .get("content-type")
10629 .and_then(|v| v.to_str().ok())
10630 .unwrap_or("application/octet-stream");
10631 let content_type = super::ContentType::from(content_type);
10632
10633 if !status.is_client_error() && !status.is_server_error() {
10634 let content = resp.text().await?;
10635 match content_type {
10636 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10637 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10638 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
10639 }
10640 } else {
10641 let content = resp.text().await?;
10642 let entity: Option<SourcesUserConnectionsPlexPartialUpdateError> = serde_json::from_str(&content).ok();
10643 Err(Error::ResponseError(ResponseContent {
10644 status,
10645 content,
10646 entity,
10647 }))
10648 }
10649}
10650
10651pub async fn sources_user_connections_plex_retrieve(
10653 configuration: &configuration::Configuration,
10654 id: i32,
10655) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexRetrieveError>> {
10656 let p_path_id = id;
10658
10659 let uri_str = format!(
10660 "{}/sources/user_connections/plex/{id}/",
10661 configuration.base_path,
10662 id = p_path_id
10663 );
10664 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10665
10666 if let Some(ref user_agent) = configuration.user_agent {
10667 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10668 }
10669 if let Some(ref token) = configuration.bearer_access_token {
10670 req_builder = req_builder.bearer_auth(token.to_owned());
10671 };
10672
10673 let req = req_builder.build()?;
10674 let resp = configuration.client.execute(req).await?;
10675
10676 let status = resp.status();
10677 let content_type = resp
10678 .headers()
10679 .get("content-type")
10680 .and_then(|v| v.to_str().ok())
10681 .unwrap_or("application/octet-stream");
10682 let content_type = super::ContentType::from(content_type);
10683
10684 if !status.is_client_error() && !status.is_server_error() {
10685 let content = resp.text().await?;
10686 match content_type {
10687 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10688 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10689 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
10690 }
10691 } else {
10692 let content = resp.text().await?;
10693 let entity: Option<SourcesUserConnectionsPlexRetrieveError> = serde_json::from_str(&content).ok();
10694 Err(Error::ResponseError(ResponseContent {
10695 status,
10696 content,
10697 entity,
10698 }))
10699 }
10700}
10701
10702pub async fn sources_user_connections_plex_update(
10704 configuration: &configuration::Configuration,
10705 id: i32,
10706 user_plex_source_connection_request: models::UserPlexSourceConnectionRequest,
10707) -> Result<models::UserPlexSourceConnection, Error<SourcesUserConnectionsPlexUpdateError>> {
10708 let p_path_id = id;
10710 let p_body_user_plex_source_connection_request = user_plex_source_connection_request;
10711
10712 let uri_str = format!(
10713 "{}/sources/user_connections/plex/{id}/",
10714 configuration.base_path,
10715 id = p_path_id
10716 );
10717 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10718
10719 if let Some(ref user_agent) = configuration.user_agent {
10720 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10721 }
10722 if let Some(ref token) = configuration.bearer_access_token {
10723 req_builder = req_builder.bearer_auth(token.to_owned());
10724 };
10725 req_builder = req_builder.json(&p_body_user_plex_source_connection_request);
10726
10727 let req = req_builder.build()?;
10728 let resp = configuration.client.execute(req).await?;
10729
10730 let status = resp.status();
10731 let content_type = resp
10732 .headers()
10733 .get("content-type")
10734 .and_then(|v| v.to_str().ok())
10735 .unwrap_or("application/octet-stream");
10736 let content_type = super::ContentType::from(content_type);
10737
10738 if !status.is_client_error() && !status.is_server_error() {
10739 let content = resp.text().await?;
10740 match content_type {
10741 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10742 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserPlexSourceConnection`"))),
10743 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserPlexSourceConnection`")))),
10744 }
10745 } else {
10746 let content = resp.text().await?;
10747 let entity: Option<SourcesUserConnectionsPlexUpdateError> = serde_json::from_str(&content).ok();
10748 Err(Error::ResponseError(ResponseContent {
10749 status,
10750 content,
10751 entity,
10752 }))
10753 }
10754}
10755
10756pub async fn sources_user_connections_plex_used_by_list(
10758 configuration: &configuration::Configuration,
10759 id: i32,
10760) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsPlexUsedByListError>> {
10761 let p_path_id = id;
10763
10764 let uri_str = format!(
10765 "{}/sources/user_connections/plex/{id}/used_by/",
10766 configuration.base_path,
10767 id = p_path_id
10768 );
10769 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10770
10771 if let Some(ref user_agent) = configuration.user_agent {
10772 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10773 }
10774 if let Some(ref token) = configuration.bearer_access_token {
10775 req_builder = req_builder.bearer_auth(token.to_owned());
10776 };
10777
10778 let req = req_builder.build()?;
10779 let resp = configuration.client.execute(req).await?;
10780
10781 let status = resp.status();
10782 let content_type = resp
10783 .headers()
10784 .get("content-type")
10785 .and_then(|v| v.to_str().ok())
10786 .unwrap_or("application/octet-stream");
10787 let content_type = super::ContentType::from(content_type);
10788
10789 if !status.is_client_error() && !status.is_server_error() {
10790 let content = resp.text().await?;
10791 match content_type {
10792 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10793 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
10794 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
10795 }
10796 } else {
10797 let content = resp.text().await?;
10798 let entity: Option<SourcesUserConnectionsPlexUsedByListError> = serde_json::from_str(&content).ok();
10799 Err(Error::ResponseError(ResponseContent {
10800 status,
10801 content,
10802 entity,
10803 }))
10804 }
10805}
10806
10807pub async fn sources_user_connections_saml_create(
10809 configuration: &configuration::Configuration,
10810 user_saml_source_connection_request: models::UserSamlSourceConnectionRequest,
10811) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlCreateError>> {
10812 let p_body_user_saml_source_connection_request = user_saml_source_connection_request;
10814
10815 let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path);
10816 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10817
10818 if let Some(ref user_agent) = configuration.user_agent {
10819 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10820 }
10821 if let Some(ref token) = configuration.bearer_access_token {
10822 req_builder = req_builder.bearer_auth(token.to_owned());
10823 };
10824 req_builder = req_builder.json(&p_body_user_saml_source_connection_request);
10825
10826 let req = req_builder.build()?;
10827 let resp = configuration.client.execute(req).await?;
10828
10829 let status = resp.status();
10830 let content_type = resp
10831 .headers()
10832 .get("content-type")
10833 .and_then(|v| v.to_str().ok())
10834 .unwrap_or("application/octet-stream");
10835 let content_type = super::ContentType::from(content_type);
10836
10837 if !status.is_client_error() && !status.is_server_error() {
10838 let content = resp.text().await?;
10839 match content_type {
10840 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10841 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
10842 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
10843 }
10844 } else {
10845 let content = resp.text().await?;
10846 let entity: Option<SourcesUserConnectionsSamlCreateError> = serde_json::from_str(&content).ok();
10847 Err(Error::ResponseError(ResponseContent {
10848 status,
10849 content,
10850 entity,
10851 }))
10852 }
10853}
10854
10855pub async fn sources_user_connections_saml_destroy(
10857 configuration: &configuration::Configuration,
10858 id: i32,
10859) -> Result<(), Error<SourcesUserConnectionsSamlDestroyError>> {
10860 let p_path_id = id;
10862
10863 let uri_str = format!(
10864 "{}/sources/user_connections/saml/{id}/",
10865 configuration.base_path,
10866 id = p_path_id
10867 );
10868 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10869
10870 if let Some(ref user_agent) = configuration.user_agent {
10871 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10872 }
10873 if let Some(ref token) = configuration.bearer_access_token {
10874 req_builder = req_builder.bearer_auth(token.to_owned());
10875 };
10876
10877 let req = req_builder.build()?;
10878 let resp = configuration.client.execute(req).await?;
10879
10880 let status = resp.status();
10881
10882 if !status.is_client_error() && !status.is_server_error() {
10883 Ok(())
10884 } else {
10885 let content = resp.text().await?;
10886 let entity: Option<SourcesUserConnectionsSamlDestroyError> = serde_json::from_str(&content).ok();
10887 Err(Error::ResponseError(ResponseContent {
10888 status,
10889 content,
10890 entity,
10891 }))
10892 }
10893}
10894
10895pub async fn sources_user_connections_saml_list(
10897 configuration: &configuration::Configuration,
10898 ordering: Option<&str>,
10899 page: Option<i32>,
10900 page_size: Option<i32>,
10901 search: Option<&str>,
10902 source__slug: Option<&str>,
10903 user: Option<i32>,
10904) -> Result<models::PaginatedUserSamlSourceConnectionList, Error<SourcesUserConnectionsSamlListError>> {
10905 let p_query_ordering = ordering;
10907 let p_query_page = page;
10908 let p_query_page_size = page_size;
10909 let p_query_search = search;
10910 let p_query_source__slug = source__slug;
10911 let p_query_user = user;
10912
10913 let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path);
10914 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10915
10916 if let Some(ref param_value) = p_query_ordering {
10917 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
10918 }
10919 if let Some(ref param_value) = p_query_page {
10920 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
10921 }
10922 if let Some(ref param_value) = p_query_page_size {
10923 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
10924 }
10925 if let Some(ref param_value) = p_query_search {
10926 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
10927 }
10928 if let Some(ref param_value) = p_query_source__slug {
10929 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
10930 }
10931 if let Some(ref param_value) = p_query_user {
10932 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
10933 }
10934 if let Some(ref user_agent) = configuration.user_agent {
10935 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10936 }
10937 if let Some(ref token) = configuration.bearer_access_token {
10938 req_builder = req_builder.bearer_auth(token.to_owned());
10939 };
10940
10941 let req = req_builder.build()?;
10942 let resp = configuration.client.execute(req).await?;
10943
10944 let status = resp.status();
10945 let content_type = resp
10946 .headers()
10947 .get("content-type")
10948 .and_then(|v| v.to_str().ok())
10949 .unwrap_or("application/octet-stream");
10950 let content_type = super::ContentType::from(content_type);
10951
10952 if !status.is_client_error() && !status.is_server_error() {
10953 let content = resp.text().await?;
10954 match content_type {
10955 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10956 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserSamlSourceConnectionList`"))),
10957 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserSamlSourceConnectionList`")))),
10958 }
10959 } else {
10960 let content = resp.text().await?;
10961 let entity: Option<SourcesUserConnectionsSamlListError> = serde_json::from_str(&content).ok();
10962 Err(Error::ResponseError(ResponseContent {
10963 status,
10964 content,
10965 entity,
10966 }))
10967 }
10968}
10969
10970pub async fn sources_user_connections_saml_partial_update(
10972 configuration: &configuration::Configuration,
10973 id: i32,
10974 patched_user_saml_source_connection_request: Option<models::PatchedUserSamlSourceConnectionRequest>,
10975) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlPartialUpdateError>> {
10976 let p_path_id = id;
10978 let p_body_patched_user_saml_source_connection_request = patched_user_saml_source_connection_request;
10979
10980 let uri_str = format!(
10981 "{}/sources/user_connections/saml/{id}/",
10982 configuration.base_path,
10983 id = p_path_id
10984 );
10985 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10986
10987 if let Some(ref user_agent) = configuration.user_agent {
10988 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10989 }
10990 if let Some(ref token) = configuration.bearer_access_token {
10991 req_builder = req_builder.bearer_auth(token.to_owned());
10992 };
10993 req_builder = req_builder.json(&p_body_patched_user_saml_source_connection_request);
10994
10995 let req = req_builder.build()?;
10996 let resp = configuration.client.execute(req).await?;
10997
10998 let status = resp.status();
10999 let content_type = resp
11000 .headers()
11001 .get("content-type")
11002 .and_then(|v| v.to_str().ok())
11003 .unwrap_or("application/octet-stream");
11004 let content_type = super::ContentType::from(content_type);
11005
11006 if !status.is_client_error() && !status.is_server_error() {
11007 let content = resp.text().await?;
11008 match content_type {
11009 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11010 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
11011 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
11012 }
11013 } else {
11014 let content = resp.text().await?;
11015 let entity: Option<SourcesUserConnectionsSamlPartialUpdateError> = serde_json::from_str(&content).ok();
11016 Err(Error::ResponseError(ResponseContent {
11017 status,
11018 content,
11019 entity,
11020 }))
11021 }
11022}
11023
11024pub async fn sources_user_connections_saml_retrieve(
11026 configuration: &configuration::Configuration,
11027 id: i32,
11028) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlRetrieveError>> {
11029 let p_path_id = id;
11031
11032 let uri_str = format!(
11033 "{}/sources/user_connections/saml/{id}/",
11034 configuration.base_path,
11035 id = p_path_id
11036 );
11037 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11038
11039 if let Some(ref user_agent) = configuration.user_agent {
11040 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11041 }
11042 if let Some(ref token) = configuration.bearer_access_token {
11043 req_builder = req_builder.bearer_auth(token.to_owned());
11044 };
11045
11046 let req = req_builder.build()?;
11047 let resp = configuration.client.execute(req).await?;
11048
11049 let status = resp.status();
11050 let content_type = resp
11051 .headers()
11052 .get("content-type")
11053 .and_then(|v| v.to_str().ok())
11054 .unwrap_or("application/octet-stream");
11055 let content_type = super::ContentType::from(content_type);
11056
11057 if !status.is_client_error() && !status.is_server_error() {
11058 let content = resp.text().await?;
11059 match content_type {
11060 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11061 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
11062 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
11063 }
11064 } else {
11065 let content = resp.text().await?;
11066 let entity: Option<SourcesUserConnectionsSamlRetrieveError> = serde_json::from_str(&content).ok();
11067 Err(Error::ResponseError(ResponseContent {
11068 status,
11069 content,
11070 entity,
11071 }))
11072 }
11073}
11074
11075pub async fn sources_user_connections_saml_update(
11077 configuration: &configuration::Configuration,
11078 id: i32,
11079 user_saml_source_connection_request: models::UserSamlSourceConnectionRequest,
11080) -> Result<models::UserSamlSourceConnection, Error<SourcesUserConnectionsSamlUpdateError>> {
11081 let p_path_id = id;
11083 let p_body_user_saml_source_connection_request = user_saml_source_connection_request;
11084
11085 let uri_str = format!(
11086 "{}/sources/user_connections/saml/{id}/",
11087 configuration.base_path,
11088 id = p_path_id
11089 );
11090 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
11091
11092 if let Some(ref user_agent) = configuration.user_agent {
11093 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11094 }
11095 if let Some(ref token) = configuration.bearer_access_token {
11096 req_builder = req_builder.bearer_auth(token.to_owned());
11097 };
11098 req_builder = req_builder.json(&p_body_user_saml_source_connection_request);
11099
11100 let req = req_builder.build()?;
11101 let resp = configuration.client.execute(req).await?;
11102
11103 let status = resp.status();
11104 let content_type = resp
11105 .headers()
11106 .get("content-type")
11107 .and_then(|v| v.to_str().ok())
11108 .unwrap_or("application/octet-stream");
11109 let content_type = super::ContentType::from(content_type);
11110
11111 if !status.is_client_error() && !status.is_server_error() {
11112 let content = resp.text().await?;
11113 match content_type {
11114 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11115 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSamlSourceConnection`"))),
11116 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSamlSourceConnection`")))),
11117 }
11118 } else {
11119 let content = resp.text().await?;
11120 let entity: Option<SourcesUserConnectionsSamlUpdateError> = serde_json::from_str(&content).ok();
11121 Err(Error::ResponseError(ResponseContent {
11122 status,
11123 content,
11124 entity,
11125 }))
11126 }
11127}
11128
11129pub async fn sources_user_connections_saml_used_by_list(
11131 configuration: &configuration::Configuration,
11132 id: i32,
11133) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsSamlUsedByListError>> {
11134 let p_path_id = id;
11136
11137 let uri_str = format!(
11138 "{}/sources/user_connections/saml/{id}/used_by/",
11139 configuration.base_path,
11140 id = p_path_id
11141 );
11142 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11143
11144 if let Some(ref user_agent) = configuration.user_agent {
11145 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11146 }
11147 if let Some(ref token) = configuration.bearer_access_token {
11148 req_builder = req_builder.bearer_auth(token.to_owned());
11149 };
11150
11151 let req = req_builder.build()?;
11152 let resp = configuration.client.execute(req).await?;
11153
11154 let status = resp.status();
11155 let content_type = resp
11156 .headers()
11157 .get("content-type")
11158 .and_then(|v| v.to_str().ok())
11159 .unwrap_or("application/octet-stream");
11160 let content_type = super::ContentType::from(content_type);
11161
11162 if !status.is_client_error() && !status.is_server_error() {
11163 let content = resp.text().await?;
11164 match content_type {
11165 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11166 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
11167 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
11168 }
11169 } else {
11170 let content = resp.text().await?;
11171 let entity: Option<SourcesUserConnectionsSamlUsedByListError> = serde_json::from_str(&content).ok();
11172 Err(Error::ResponseError(ResponseContent {
11173 status,
11174 content,
11175 entity,
11176 }))
11177 }
11178}
11179
11180pub async fn sources_user_connections_telegram_create(
11182 configuration: &configuration::Configuration,
11183 user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest,
11184) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramCreateError>> {
11185 let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request;
11187
11188 let uri_str = format!("{}/sources/user_connections/telegram/", configuration.base_path);
11189 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11190
11191 if let Some(ref user_agent) = configuration.user_agent {
11192 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11193 }
11194 if let Some(ref token) = configuration.bearer_access_token {
11195 req_builder = req_builder.bearer_auth(token.to_owned());
11196 };
11197 req_builder = req_builder.json(&p_body_user_telegram_source_connection_request);
11198
11199 let req = req_builder.build()?;
11200 let resp = configuration.client.execute(req).await?;
11201
11202 let status = resp.status();
11203 let content_type = resp
11204 .headers()
11205 .get("content-type")
11206 .and_then(|v| v.to_str().ok())
11207 .unwrap_or("application/octet-stream");
11208 let content_type = super::ContentType::from(content_type);
11209
11210 if !status.is_client_error() && !status.is_server_error() {
11211 let content = resp.text().await?;
11212 match content_type {
11213 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11214 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11215 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11216 }
11217 } else {
11218 let content = resp.text().await?;
11219 let entity: Option<SourcesUserConnectionsTelegramCreateError> = serde_json::from_str(&content).ok();
11220 Err(Error::ResponseError(ResponseContent {
11221 status,
11222 content,
11223 entity,
11224 }))
11225 }
11226}
11227
11228pub async fn sources_user_connections_telegram_destroy(
11230 configuration: &configuration::Configuration,
11231 id: i32,
11232) -> Result<(), Error<SourcesUserConnectionsTelegramDestroyError>> {
11233 let p_path_id = id;
11235
11236 let uri_str = format!(
11237 "{}/sources/user_connections/telegram/{id}/",
11238 configuration.base_path,
11239 id = p_path_id
11240 );
11241 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
11242
11243 if let Some(ref user_agent) = configuration.user_agent {
11244 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11245 }
11246 if let Some(ref token) = configuration.bearer_access_token {
11247 req_builder = req_builder.bearer_auth(token.to_owned());
11248 };
11249
11250 let req = req_builder.build()?;
11251 let resp = configuration.client.execute(req).await?;
11252
11253 let status = resp.status();
11254
11255 if !status.is_client_error() && !status.is_server_error() {
11256 Ok(())
11257 } else {
11258 let content = resp.text().await?;
11259 let entity: Option<SourcesUserConnectionsTelegramDestroyError> = serde_json::from_str(&content).ok();
11260 Err(Error::ResponseError(ResponseContent {
11261 status,
11262 content,
11263 entity,
11264 }))
11265 }
11266}
11267
11268pub async fn sources_user_connections_telegram_list(
11270 configuration: &configuration::Configuration,
11271 ordering: Option<&str>,
11272 page: Option<i32>,
11273 page_size: Option<i32>,
11274 search: Option<&str>,
11275 source__slug: Option<&str>,
11276 user: Option<i32>,
11277) -> Result<models::PaginatedUserTelegramSourceConnectionList, Error<SourcesUserConnectionsTelegramListError>> {
11278 let p_query_ordering = ordering;
11280 let p_query_page = page;
11281 let p_query_page_size = page_size;
11282 let p_query_search = search;
11283 let p_query_source__slug = source__slug;
11284 let p_query_user = user;
11285
11286 let uri_str = format!("{}/sources/user_connections/telegram/", configuration.base_path);
11287 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11288
11289 if let Some(ref param_value) = p_query_ordering {
11290 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
11291 }
11292 if let Some(ref param_value) = p_query_page {
11293 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
11294 }
11295 if let Some(ref param_value) = p_query_page_size {
11296 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
11297 }
11298 if let Some(ref param_value) = p_query_search {
11299 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
11300 }
11301 if let Some(ref param_value) = p_query_source__slug {
11302 req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]);
11303 }
11304 if let Some(ref param_value) = p_query_user {
11305 req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
11306 }
11307 if let Some(ref user_agent) = configuration.user_agent {
11308 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11309 }
11310 if let Some(ref token) = configuration.bearer_access_token {
11311 req_builder = req_builder.bearer_auth(token.to_owned());
11312 };
11313
11314 let req = req_builder.build()?;
11315 let resp = configuration.client.execute(req).await?;
11316
11317 let status = resp.status();
11318 let content_type = resp
11319 .headers()
11320 .get("content-type")
11321 .and_then(|v| v.to_str().ok())
11322 .unwrap_or("application/octet-stream");
11323 let content_type = super::ContentType::from(content_type);
11324
11325 if !status.is_client_error() && !status.is_server_error() {
11326 let content = resp.text().await?;
11327 match content_type {
11328 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11329 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserTelegramSourceConnectionList`"))),
11330 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserTelegramSourceConnectionList`")))),
11331 }
11332 } else {
11333 let content = resp.text().await?;
11334 let entity: Option<SourcesUserConnectionsTelegramListError> = serde_json::from_str(&content).ok();
11335 Err(Error::ResponseError(ResponseContent {
11336 status,
11337 content,
11338 entity,
11339 }))
11340 }
11341}
11342
11343pub async fn sources_user_connections_telegram_partial_update(
11345 configuration: &configuration::Configuration,
11346 id: i32,
11347 patched_user_telegram_source_connection_request: Option<models::PatchedUserTelegramSourceConnectionRequest>,
11348) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramPartialUpdateError>> {
11349 let p_path_id = id;
11351 let p_body_patched_user_telegram_source_connection_request = patched_user_telegram_source_connection_request;
11352
11353 let uri_str = format!(
11354 "{}/sources/user_connections/telegram/{id}/",
11355 configuration.base_path,
11356 id = p_path_id
11357 );
11358 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
11359
11360 if let Some(ref user_agent) = configuration.user_agent {
11361 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11362 }
11363 if let Some(ref token) = configuration.bearer_access_token {
11364 req_builder = req_builder.bearer_auth(token.to_owned());
11365 };
11366 req_builder = req_builder.json(&p_body_patched_user_telegram_source_connection_request);
11367
11368 let req = req_builder.build()?;
11369 let resp = configuration.client.execute(req).await?;
11370
11371 let status = resp.status();
11372 let content_type = resp
11373 .headers()
11374 .get("content-type")
11375 .and_then(|v| v.to_str().ok())
11376 .unwrap_or("application/octet-stream");
11377 let content_type = super::ContentType::from(content_type);
11378
11379 if !status.is_client_error() && !status.is_server_error() {
11380 let content = resp.text().await?;
11381 match content_type {
11382 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11383 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11384 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11385 }
11386 } else {
11387 let content = resp.text().await?;
11388 let entity: Option<SourcesUserConnectionsTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
11389 Err(Error::ResponseError(ResponseContent {
11390 status,
11391 content,
11392 entity,
11393 }))
11394 }
11395}
11396
11397pub async fn sources_user_connections_telegram_retrieve(
11399 configuration: &configuration::Configuration,
11400 id: i32,
11401) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramRetrieveError>> {
11402 let p_path_id = id;
11404
11405 let uri_str = format!(
11406 "{}/sources/user_connections/telegram/{id}/",
11407 configuration.base_path,
11408 id = p_path_id
11409 );
11410 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11411
11412 if let Some(ref user_agent) = configuration.user_agent {
11413 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11414 }
11415 if let Some(ref token) = configuration.bearer_access_token {
11416 req_builder = req_builder.bearer_auth(token.to_owned());
11417 };
11418
11419 let req = req_builder.build()?;
11420 let resp = configuration.client.execute(req).await?;
11421
11422 let status = resp.status();
11423 let content_type = resp
11424 .headers()
11425 .get("content-type")
11426 .and_then(|v| v.to_str().ok())
11427 .unwrap_or("application/octet-stream");
11428 let content_type = super::ContentType::from(content_type);
11429
11430 if !status.is_client_error() && !status.is_server_error() {
11431 let content = resp.text().await?;
11432 match content_type {
11433 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11434 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11435 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11436 }
11437 } else {
11438 let content = resp.text().await?;
11439 let entity: Option<SourcesUserConnectionsTelegramRetrieveError> = serde_json::from_str(&content).ok();
11440 Err(Error::ResponseError(ResponseContent {
11441 status,
11442 content,
11443 entity,
11444 }))
11445 }
11446}
11447
11448pub async fn sources_user_connections_telegram_update(
11450 configuration: &configuration::Configuration,
11451 id: i32,
11452 user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest,
11453) -> Result<models::UserTelegramSourceConnection, Error<SourcesUserConnectionsTelegramUpdateError>> {
11454 let p_path_id = id;
11456 let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request;
11457
11458 let uri_str = format!(
11459 "{}/sources/user_connections/telegram/{id}/",
11460 configuration.base_path,
11461 id = p_path_id
11462 );
11463 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
11464
11465 if let Some(ref user_agent) = configuration.user_agent {
11466 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11467 }
11468 if let Some(ref token) = configuration.bearer_access_token {
11469 req_builder = req_builder.bearer_auth(token.to_owned());
11470 };
11471 req_builder = req_builder.json(&p_body_user_telegram_source_connection_request);
11472
11473 let req = req_builder.build()?;
11474 let resp = configuration.client.execute(req).await?;
11475
11476 let status = resp.status();
11477 let content_type = resp
11478 .headers()
11479 .get("content-type")
11480 .and_then(|v| v.to_str().ok())
11481 .unwrap_or("application/octet-stream");
11482 let content_type = super::ContentType::from(content_type);
11483
11484 if !status.is_client_error() && !status.is_server_error() {
11485 let content = resp.text().await?;
11486 match content_type {
11487 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11488 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserTelegramSourceConnection`"))),
11489 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserTelegramSourceConnection`")))),
11490 }
11491 } else {
11492 let content = resp.text().await?;
11493 let entity: Option<SourcesUserConnectionsTelegramUpdateError> = serde_json::from_str(&content).ok();
11494 Err(Error::ResponseError(ResponseContent {
11495 status,
11496 content,
11497 entity,
11498 }))
11499 }
11500}
11501
11502pub async fn sources_user_connections_telegram_used_by_list(
11504 configuration: &configuration::Configuration,
11505 id: i32,
11506) -> Result<Vec<models::UsedBy>, Error<SourcesUserConnectionsTelegramUsedByListError>> {
11507 let p_path_id = id;
11509
11510 let uri_str = format!(
11511 "{}/sources/user_connections/telegram/{id}/used_by/",
11512 configuration.base_path,
11513 id = p_path_id
11514 );
11515 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11516
11517 if let Some(ref user_agent) = configuration.user_agent {
11518 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11519 }
11520 if let Some(ref token) = configuration.bearer_access_token {
11521 req_builder = req_builder.bearer_auth(token.to_owned());
11522 };
11523
11524 let req = req_builder.build()?;
11525 let resp = configuration.client.execute(req).await?;
11526
11527 let status = resp.status();
11528 let content_type = resp
11529 .headers()
11530 .get("content-type")
11531 .and_then(|v| v.to_str().ok())
11532 .unwrap_or("application/octet-stream");
11533 let content_type = super::ContentType::from(content_type);
11534
11535 if !status.is_client_error() && !status.is_server_error() {
11536 let content = resp.text().await?;
11537 match content_type {
11538 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11539 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
11540 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
11541 }
11542 } else {
11543 let content = resp.text().await?;
11544 let entity: Option<SourcesUserConnectionsTelegramUsedByListError> = serde_json::from_str(&content).ok();
11545 Err(Error::ResponseError(ResponseContent {
11546 status,
11547 content,
11548 entity,
11549 }))
11550 }
11551}