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