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 StagesAllDestroyError {
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 StagesAllListError {
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 StagesAllRetrieveError {
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 StagesAllTypesListError {
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 StagesAllUsedByListError {
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 StagesAllUserSettingsListError {
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 StagesAuthenticatorDuoCreateError {
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 StagesAuthenticatorDuoDestroyError {
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 StagesAuthenticatorDuoEnrollmentStatusCreateError {
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 StagesAuthenticatorDuoImportDeviceManualCreateError {
101 Status400(),
102 Status403(models::GenericError),
103 UnknownValue(serde_json::Value),
104}
105
106#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum StagesAuthenticatorDuoImportDevicesAutomaticCreateError {
110 Status400(),
111 Status403(models::GenericError),
112 UnknownValue(serde_json::Value),
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum StagesAuthenticatorDuoListError {
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 StagesAuthenticatorDuoPartialUpdateError {
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 StagesAuthenticatorDuoRetrieveError {
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 StagesAuthenticatorDuoUpdateError {
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 StagesAuthenticatorDuoUsedByListError {
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 StagesAuthenticatorEmailCreateError {
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 StagesAuthenticatorEmailDestroyError {
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 StagesAuthenticatorEmailListError {
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 StagesAuthenticatorEmailPartialUpdateError {
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 StagesAuthenticatorEmailRetrieveError {
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 StagesAuthenticatorEmailUpdateError {
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 StagesAuthenticatorEmailUsedByListError {
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 StagesAuthenticatorEndpointGdtcCreateError {
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 StagesAuthenticatorEndpointGdtcDestroyError {
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 StagesAuthenticatorEndpointGdtcListError {
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 StagesAuthenticatorEndpointGdtcPartialUpdateError {
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 StagesAuthenticatorEndpointGdtcRetrieveError {
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 StagesAuthenticatorEndpointGdtcUpdateError {
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 StagesAuthenticatorEndpointGdtcUsedByListError {
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 StagesAuthenticatorSmsCreateError {
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 StagesAuthenticatorSmsDestroyError {
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 StagesAuthenticatorSmsListError {
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 StagesAuthenticatorSmsPartialUpdateError {
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 StagesAuthenticatorSmsRetrieveError {
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 StagesAuthenticatorSmsUpdateError {
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 StagesAuthenticatorSmsUsedByListError {
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 StagesAuthenticatorStaticCreateError {
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 StagesAuthenticatorStaticDestroyError {
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 StagesAuthenticatorStaticListError {
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 StagesAuthenticatorStaticPartialUpdateError {
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 StagesAuthenticatorStaticRetrieveError {
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 StagesAuthenticatorStaticUpdateError {
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 StagesAuthenticatorStaticUsedByListError {
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 StagesAuthenticatorTotpCreateError {
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 StagesAuthenticatorTotpDestroyError {
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 StagesAuthenticatorTotpListError {
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 StagesAuthenticatorTotpPartialUpdateError {
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 StagesAuthenticatorTotpRetrieveError {
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 StagesAuthenticatorTotpUpdateError {
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 StagesAuthenticatorTotpUsedByListError {
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 StagesAuthenticatorValidateCreateError {
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 StagesAuthenticatorValidateDestroyError {
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 StagesAuthenticatorValidateListError {
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 StagesAuthenticatorValidatePartialUpdateError {
506 Status400(models::ValidationError),
507 Status403(models::GenericError),
508 UnknownValue(serde_json::Value),
509}
510
511#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum StagesAuthenticatorValidateRetrieveError {
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 StagesAuthenticatorValidateUpdateError {
524 Status400(models::ValidationError),
525 Status403(models::GenericError),
526 UnknownValue(serde_json::Value),
527}
528
529#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(untagged)]
532pub enum StagesAuthenticatorValidateUsedByListError {
533 Status400(models::ValidationError),
534 Status403(models::GenericError),
535 UnknownValue(serde_json::Value),
536}
537
538#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum StagesAuthenticatorWebauthnCreateError {
542 Status400(models::ValidationError),
543 Status403(models::GenericError),
544 UnknownValue(serde_json::Value),
545}
546
547#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(untagged)]
550pub enum StagesAuthenticatorWebauthnDestroyError {
551 Status400(models::ValidationError),
552 Status403(models::GenericError),
553 UnknownValue(serde_json::Value),
554}
555
556#[derive(Debug, Clone, Serialize, Deserialize)]
558#[serde(untagged)]
559pub enum StagesAuthenticatorWebauthnDeviceTypesListError {
560 Status400(models::ValidationError),
561 Status403(models::GenericError),
562 UnknownValue(serde_json::Value),
563}
564
565#[derive(Debug, Clone, Serialize, Deserialize)]
567#[serde(untagged)]
568pub enum StagesAuthenticatorWebauthnDeviceTypesRetrieveError {
569 Status400(models::ValidationError),
570 Status403(models::GenericError),
571 UnknownValue(serde_json::Value),
572}
573
574#[derive(Debug, Clone, Serialize, Deserialize)]
576#[serde(untagged)]
577pub enum StagesAuthenticatorWebauthnListError {
578 Status400(models::ValidationError),
579 Status403(models::GenericError),
580 UnknownValue(serde_json::Value),
581}
582
583#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum StagesAuthenticatorWebauthnPartialUpdateError {
587 Status400(models::ValidationError),
588 Status403(models::GenericError),
589 UnknownValue(serde_json::Value),
590}
591
592#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum StagesAuthenticatorWebauthnRetrieveError {
596 Status400(models::ValidationError),
597 Status403(models::GenericError),
598 UnknownValue(serde_json::Value),
599}
600
601#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum StagesAuthenticatorWebauthnUpdateError {
605 Status400(models::ValidationError),
606 Status403(models::GenericError),
607 UnknownValue(serde_json::Value),
608}
609
610#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum StagesAuthenticatorWebauthnUsedByListError {
614 Status400(models::ValidationError),
615 Status403(models::GenericError),
616 UnknownValue(serde_json::Value),
617}
618
619#[derive(Debug, Clone, Serialize, Deserialize)]
621#[serde(untagged)]
622pub enum StagesCaptchaCreateError {
623 Status400(models::ValidationError),
624 Status403(models::GenericError),
625 UnknownValue(serde_json::Value),
626}
627
628#[derive(Debug, Clone, Serialize, Deserialize)]
630#[serde(untagged)]
631pub enum StagesCaptchaDestroyError {
632 Status400(models::ValidationError),
633 Status403(models::GenericError),
634 UnknownValue(serde_json::Value),
635}
636
637#[derive(Debug, Clone, Serialize, Deserialize)]
639#[serde(untagged)]
640pub enum StagesCaptchaListError {
641 Status400(models::ValidationError),
642 Status403(models::GenericError),
643 UnknownValue(serde_json::Value),
644}
645
646#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum StagesCaptchaPartialUpdateError {
650 Status400(models::ValidationError),
651 Status403(models::GenericError),
652 UnknownValue(serde_json::Value),
653}
654
655#[derive(Debug, Clone, Serialize, Deserialize)]
657#[serde(untagged)]
658pub enum StagesCaptchaRetrieveError {
659 Status400(models::ValidationError),
660 Status403(models::GenericError),
661 UnknownValue(serde_json::Value),
662}
663
664#[derive(Debug, Clone, Serialize, Deserialize)]
666#[serde(untagged)]
667pub enum StagesCaptchaUpdateError {
668 Status400(models::ValidationError),
669 Status403(models::GenericError),
670 UnknownValue(serde_json::Value),
671}
672
673#[derive(Debug, Clone, Serialize, Deserialize)]
675#[serde(untagged)]
676pub enum StagesCaptchaUsedByListError {
677 Status400(models::ValidationError),
678 Status403(models::GenericError),
679 UnknownValue(serde_json::Value),
680}
681
682#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum StagesConsentCreateError {
686 Status400(models::ValidationError),
687 Status403(models::GenericError),
688 UnknownValue(serde_json::Value),
689}
690
691#[derive(Debug, Clone, Serialize, Deserialize)]
693#[serde(untagged)]
694pub enum StagesConsentDestroyError {
695 Status400(models::ValidationError),
696 Status403(models::GenericError),
697 UnknownValue(serde_json::Value),
698}
699
700#[derive(Debug, Clone, Serialize, Deserialize)]
702#[serde(untagged)]
703pub enum StagesConsentListError {
704 Status400(models::ValidationError),
705 Status403(models::GenericError),
706 UnknownValue(serde_json::Value),
707}
708
709#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum StagesConsentPartialUpdateError {
713 Status400(models::ValidationError),
714 Status403(models::GenericError),
715 UnknownValue(serde_json::Value),
716}
717
718#[derive(Debug, Clone, Serialize, Deserialize)]
720#[serde(untagged)]
721pub enum StagesConsentRetrieveError {
722 Status400(models::ValidationError),
723 Status403(models::GenericError),
724 UnknownValue(serde_json::Value),
725}
726
727#[derive(Debug, Clone, Serialize, Deserialize)]
729#[serde(untagged)]
730pub enum StagesConsentUpdateError {
731 Status400(models::ValidationError),
732 Status403(models::GenericError),
733 UnknownValue(serde_json::Value),
734}
735
736#[derive(Debug, Clone, Serialize, Deserialize)]
738#[serde(untagged)]
739pub enum StagesConsentUsedByListError {
740 Status400(models::ValidationError),
741 Status403(models::GenericError),
742 UnknownValue(serde_json::Value),
743}
744
745#[derive(Debug, Clone, Serialize, Deserialize)]
747#[serde(untagged)]
748pub enum StagesDenyCreateError {
749 Status400(models::ValidationError),
750 Status403(models::GenericError),
751 UnknownValue(serde_json::Value),
752}
753
754#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum StagesDenyDestroyError {
758 Status400(models::ValidationError),
759 Status403(models::GenericError),
760 UnknownValue(serde_json::Value),
761}
762
763#[derive(Debug, Clone, Serialize, Deserialize)]
765#[serde(untagged)]
766pub enum StagesDenyListError {
767 Status400(models::ValidationError),
768 Status403(models::GenericError),
769 UnknownValue(serde_json::Value),
770}
771
772#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum StagesDenyPartialUpdateError {
776 Status400(models::ValidationError),
777 Status403(models::GenericError),
778 UnknownValue(serde_json::Value),
779}
780
781#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum StagesDenyRetrieveError {
785 Status400(models::ValidationError),
786 Status403(models::GenericError),
787 UnknownValue(serde_json::Value),
788}
789
790#[derive(Debug, Clone, Serialize, Deserialize)]
792#[serde(untagged)]
793pub enum StagesDenyUpdateError {
794 Status400(models::ValidationError),
795 Status403(models::GenericError),
796 UnknownValue(serde_json::Value),
797}
798
799#[derive(Debug, Clone, Serialize, Deserialize)]
801#[serde(untagged)]
802pub enum StagesDenyUsedByListError {
803 Status400(models::ValidationError),
804 Status403(models::GenericError),
805 UnknownValue(serde_json::Value),
806}
807
808#[derive(Debug, Clone, Serialize, Deserialize)]
810#[serde(untagged)]
811pub enum StagesDummyCreateError {
812 Status400(models::ValidationError),
813 Status403(models::GenericError),
814 UnknownValue(serde_json::Value),
815}
816
817#[derive(Debug, Clone, Serialize, Deserialize)]
819#[serde(untagged)]
820pub enum StagesDummyDestroyError {
821 Status400(models::ValidationError),
822 Status403(models::GenericError),
823 UnknownValue(serde_json::Value),
824}
825
826#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum StagesDummyListError {
830 Status400(models::ValidationError),
831 Status403(models::GenericError),
832 UnknownValue(serde_json::Value),
833}
834
835#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum StagesDummyPartialUpdateError {
839 Status400(models::ValidationError),
840 Status403(models::GenericError),
841 UnknownValue(serde_json::Value),
842}
843
844#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(untagged)]
847pub enum StagesDummyRetrieveError {
848 Status400(models::ValidationError),
849 Status403(models::GenericError),
850 UnknownValue(serde_json::Value),
851}
852
853#[derive(Debug, Clone, Serialize, Deserialize)]
855#[serde(untagged)]
856pub enum StagesDummyUpdateError {
857 Status400(models::ValidationError),
858 Status403(models::GenericError),
859 UnknownValue(serde_json::Value),
860}
861
862#[derive(Debug, Clone, Serialize, Deserialize)]
864#[serde(untagged)]
865pub enum StagesDummyUsedByListError {
866 Status400(models::ValidationError),
867 Status403(models::GenericError),
868 UnknownValue(serde_json::Value),
869}
870
871#[derive(Debug, Clone, Serialize, Deserialize)]
873#[serde(untagged)]
874pub enum StagesEmailCreateError {
875 Status400(models::ValidationError),
876 Status403(models::GenericError),
877 UnknownValue(serde_json::Value),
878}
879
880#[derive(Debug, Clone, Serialize, Deserialize)]
882#[serde(untagged)]
883pub enum StagesEmailDestroyError {
884 Status400(models::ValidationError),
885 Status403(models::GenericError),
886 UnknownValue(serde_json::Value),
887}
888
889#[derive(Debug, Clone, Serialize, Deserialize)]
891#[serde(untagged)]
892pub enum StagesEmailListError {
893 Status400(models::ValidationError),
894 Status403(models::GenericError),
895 UnknownValue(serde_json::Value),
896}
897
898#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum StagesEmailPartialUpdateError {
902 Status400(models::ValidationError),
903 Status403(models::GenericError),
904 UnknownValue(serde_json::Value),
905}
906
907#[derive(Debug, Clone, Serialize, Deserialize)]
909#[serde(untagged)]
910pub enum StagesEmailRetrieveError {
911 Status400(models::ValidationError),
912 Status403(models::GenericError),
913 UnknownValue(serde_json::Value),
914}
915
916#[derive(Debug, Clone, Serialize, Deserialize)]
918#[serde(untagged)]
919pub enum StagesEmailTemplatesListError {
920 Status400(models::ValidationError),
921 Status403(models::GenericError),
922 UnknownValue(serde_json::Value),
923}
924
925#[derive(Debug, Clone, Serialize, Deserialize)]
927#[serde(untagged)]
928pub enum StagesEmailUpdateError {
929 Status400(models::ValidationError),
930 Status403(models::GenericError),
931 UnknownValue(serde_json::Value),
932}
933
934#[derive(Debug, Clone, Serialize, Deserialize)]
936#[serde(untagged)]
937pub enum StagesEmailUsedByListError {
938 Status400(models::ValidationError),
939 Status403(models::GenericError),
940 UnknownValue(serde_json::Value),
941}
942
943#[derive(Debug, Clone, Serialize, Deserialize)]
945#[serde(untagged)]
946pub enum StagesIdentificationCreateError {
947 Status400(models::ValidationError),
948 Status403(models::GenericError),
949 UnknownValue(serde_json::Value),
950}
951
952#[derive(Debug, Clone, Serialize, Deserialize)]
954#[serde(untagged)]
955pub enum StagesIdentificationDestroyError {
956 Status400(models::ValidationError),
957 Status403(models::GenericError),
958 UnknownValue(serde_json::Value),
959}
960
961#[derive(Debug, Clone, Serialize, Deserialize)]
963#[serde(untagged)]
964pub enum StagesIdentificationListError {
965 Status400(models::ValidationError),
966 Status403(models::GenericError),
967 UnknownValue(serde_json::Value),
968}
969
970#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum StagesIdentificationPartialUpdateError {
974 Status400(models::ValidationError),
975 Status403(models::GenericError),
976 UnknownValue(serde_json::Value),
977}
978
979#[derive(Debug, Clone, Serialize, Deserialize)]
981#[serde(untagged)]
982pub enum StagesIdentificationRetrieveError {
983 Status400(models::ValidationError),
984 Status403(models::GenericError),
985 UnknownValue(serde_json::Value),
986}
987
988#[derive(Debug, Clone, Serialize, Deserialize)]
990#[serde(untagged)]
991pub enum StagesIdentificationUpdateError {
992 Status400(models::ValidationError),
993 Status403(models::GenericError),
994 UnknownValue(serde_json::Value),
995}
996
997#[derive(Debug, Clone, Serialize, Deserialize)]
999#[serde(untagged)]
1000pub enum StagesIdentificationUsedByListError {
1001 Status400(models::ValidationError),
1002 Status403(models::GenericError),
1003 UnknownValue(serde_json::Value),
1004}
1005
1006#[derive(Debug, Clone, Serialize, Deserialize)]
1008#[serde(untagged)]
1009pub enum StagesInvitationInvitationsCreateError {
1010 Status400(models::ValidationError),
1011 Status403(models::GenericError),
1012 UnknownValue(serde_json::Value),
1013}
1014
1015#[derive(Debug, Clone, Serialize, Deserialize)]
1017#[serde(untagged)]
1018pub enum StagesInvitationInvitationsDestroyError {
1019 Status400(models::ValidationError),
1020 Status403(models::GenericError),
1021 UnknownValue(serde_json::Value),
1022}
1023
1024#[derive(Debug, Clone, Serialize, Deserialize)]
1026#[serde(untagged)]
1027pub enum StagesInvitationInvitationsListError {
1028 Status400(models::ValidationError),
1029 Status403(models::GenericError),
1030 UnknownValue(serde_json::Value),
1031}
1032
1033#[derive(Debug, Clone, Serialize, Deserialize)]
1035#[serde(untagged)]
1036pub enum StagesInvitationInvitationsPartialUpdateError {
1037 Status400(models::ValidationError),
1038 Status403(models::GenericError),
1039 UnknownValue(serde_json::Value),
1040}
1041
1042#[derive(Debug, Clone, Serialize, Deserialize)]
1044#[serde(untagged)]
1045pub enum StagesInvitationInvitationsRetrieveError {
1046 Status400(models::ValidationError),
1047 Status403(models::GenericError),
1048 UnknownValue(serde_json::Value),
1049}
1050
1051#[derive(Debug, Clone, Serialize, Deserialize)]
1053#[serde(untagged)]
1054pub enum StagesInvitationInvitationsUpdateError {
1055 Status400(models::ValidationError),
1056 Status403(models::GenericError),
1057 UnknownValue(serde_json::Value),
1058}
1059
1060#[derive(Debug, Clone, Serialize, Deserialize)]
1062#[serde(untagged)]
1063pub enum StagesInvitationInvitationsUsedByListError {
1064 Status400(models::ValidationError),
1065 Status403(models::GenericError),
1066 UnknownValue(serde_json::Value),
1067}
1068
1069#[derive(Debug, Clone, Serialize, Deserialize)]
1071#[serde(untagged)]
1072pub enum StagesInvitationStagesCreateError {
1073 Status400(models::ValidationError),
1074 Status403(models::GenericError),
1075 UnknownValue(serde_json::Value),
1076}
1077
1078#[derive(Debug, Clone, Serialize, Deserialize)]
1080#[serde(untagged)]
1081pub enum StagesInvitationStagesDestroyError {
1082 Status400(models::ValidationError),
1083 Status403(models::GenericError),
1084 UnknownValue(serde_json::Value),
1085}
1086
1087#[derive(Debug, Clone, Serialize, Deserialize)]
1089#[serde(untagged)]
1090pub enum StagesInvitationStagesListError {
1091 Status400(models::ValidationError),
1092 Status403(models::GenericError),
1093 UnknownValue(serde_json::Value),
1094}
1095
1096#[derive(Debug, Clone, Serialize, Deserialize)]
1098#[serde(untagged)]
1099pub enum StagesInvitationStagesPartialUpdateError {
1100 Status400(models::ValidationError),
1101 Status403(models::GenericError),
1102 UnknownValue(serde_json::Value),
1103}
1104
1105#[derive(Debug, Clone, Serialize, Deserialize)]
1107#[serde(untagged)]
1108pub enum StagesInvitationStagesRetrieveError {
1109 Status400(models::ValidationError),
1110 Status403(models::GenericError),
1111 UnknownValue(serde_json::Value),
1112}
1113
1114#[derive(Debug, Clone, Serialize, Deserialize)]
1116#[serde(untagged)]
1117pub enum StagesInvitationStagesUpdateError {
1118 Status400(models::ValidationError),
1119 Status403(models::GenericError),
1120 UnknownValue(serde_json::Value),
1121}
1122
1123#[derive(Debug, Clone, Serialize, Deserialize)]
1125#[serde(untagged)]
1126pub enum StagesInvitationStagesUsedByListError {
1127 Status400(models::ValidationError),
1128 Status403(models::GenericError),
1129 UnknownValue(serde_json::Value),
1130}
1131
1132#[derive(Debug, Clone, Serialize, Deserialize)]
1134#[serde(untagged)]
1135pub enum StagesMtlsCreateError {
1136 Status400(models::ValidationError),
1137 Status403(models::GenericError),
1138 UnknownValue(serde_json::Value),
1139}
1140
1141#[derive(Debug, Clone, Serialize, Deserialize)]
1143#[serde(untagged)]
1144pub enum StagesMtlsDestroyError {
1145 Status400(models::ValidationError),
1146 Status403(models::GenericError),
1147 UnknownValue(serde_json::Value),
1148}
1149
1150#[derive(Debug, Clone, Serialize, Deserialize)]
1152#[serde(untagged)]
1153pub enum StagesMtlsListError {
1154 Status400(models::ValidationError),
1155 Status403(models::GenericError),
1156 UnknownValue(serde_json::Value),
1157}
1158
1159#[derive(Debug, Clone, Serialize, Deserialize)]
1161#[serde(untagged)]
1162pub enum StagesMtlsPartialUpdateError {
1163 Status400(models::ValidationError),
1164 Status403(models::GenericError),
1165 UnknownValue(serde_json::Value),
1166}
1167
1168#[derive(Debug, Clone, Serialize, Deserialize)]
1170#[serde(untagged)]
1171pub enum StagesMtlsRetrieveError {
1172 Status400(models::ValidationError),
1173 Status403(models::GenericError),
1174 UnknownValue(serde_json::Value),
1175}
1176
1177#[derive(Debug, Clone, Serialize, Deserialize)]
1179#[serde(untagged)]
1180pub enum StagesMtlsUpdateError {
1181 Status400(models::ValidationError),
1182 Status403(models::GenericError),
1183 UnknownValue(serde_json::Value),
1184}
1185
1186#[derive(Debug, Clone, Serialize, Deserialize)]
1188#[serde(untagged)]
1189pub enum StagesMtlsUsedByListError {
1190 Status400(models::ValidationError),
1191 Status403(models::GenericError),
1192 UnknownValue(serde_json::Value),
1193}
1194
1195#[derive(Debug, Clone, Serialize, Deserialize)]
1197#[serde(untagged)]
1198pub enum StagesPasswordCreateError {
1199 Status400(models::ValidationError),
1200 Status403(models::GenericError),
1201 UnknownValue(serde_json::Value),
1202}
1203
1204#[derive(Debug, Clone, Serialize, Deserialize)]
1206#[serde(untagged)]
1207pub enum StagesPasswordDestroyError {
1208 Status400(models::ValidationError),
1209 Status403(models::GenericError),
1210 UnknownValue(serde_json::Value),
1211}
1212
1213#[derive(Debug, Clone, Serialize, Deserialize)]
1215#[serde(untagged)]
1216pub enum StagesPasswordListError {
1217 Status400(models::ValidationError),
1218 Status403(models::GenericError),
1219 UnknownValue(serde_json::Value),
1220}
1221
1222#[derive(Debug, Clone, Serialize, Deserialize)]
1224#[serde(untagged)]
1225pub enum StagesPasswordPartialUpdateError {
1226 Status400(models::ValidationError),
1227 Status403(models::GenericError),
1228 UnknownValue(serde_json::Value),
1229}
1230
1231#[derive(Debug, Clone, Serialize, Deserialize)]
1233#[serde(untagged)]
1234pub enum StagesPasswordRetrieveError {
1235 Status400(models::ValidationError),
1236 Status403(models::GenericError),
1237 UnknownValue(serde_json::Value),
1238}
1239
1240#[derive(Debug, Clone, Serialize, Deserialize)]
1242#[serde(untagged)]
1243pub enum StagesPasswordUpdateError {
1244 Status400(models::ValidationError),
1245 Status403(models::GenericError),
1246 UnknownValue(serde_json::Value),
1247}
1248
1249#[derive(Debug, Clone, Serialize, Deserialize)]
1251#[serde(untagged)]
1252pub enum StagesPasswordUsedByListError {
1253 Status400(models::ValidationError),
1254 Status403(models::GenericError),
1255 UnknownValue(serde_json::Value),
1256}
1257
1258#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum StagesPromptPromptsCreateError {
1262 Status400(models::ValidationError),
1263 Status403(models::GenericError),
1264 UnknownValue(serde_json::Value),
1265}
1266
1267#[derive(Debug, Clone, Serialize, Deserialize)]
1269#[serde(untagged)]
1270pub enum StagesPromptPromptsDestroyError {
1271 Status400(models::ValidationError),
1272 Status403(models::GenericError),
1273 UnknownValue(serde_json::Value),
1274}
1275
1276#[derive(Debug, Clone, Serialize, Deserialize)]
1278#[serde(untagged)]
1279pub enum StagesPromptPromptsListError {
1280 Status400(models::ValidationError),
1281 Status403(models::GenericError),
1282 UnknownValue(serde_json::Value),
1283}
1284
1285#[derive(Debug, Clone, Serialize, Deserialize)]
1287#[serde(untagged)]
1288pub enum StagesPromptPromptsPartialUpdateError {
1289 Status400(models::ValidationError),
1290 Status403(models::GenericError),
1291 UnknownValue(serde_json::Value),
1292}
1293
1294#[derive(Debug, Clone, Serialize, Deserialize)]
1296#[serde(untagged)]
1297pub enum StagesPromptPromptsPreviewCreateError {
1298 Status400(models::ValidationError),
1299 Status403(models::GenericError),
1300 UnknownValue(serde_json::Value),
1301}
1302
1303#[derive(Debug, Clone, Serialize, Deserialize)]
1305#[serde(untagged)]
1306pub enum StagesPromptPromptsRetrieveError {
1307 Status400(models::ValidationError),
1308 Status403(models::GenericError),
1309 UnknownValue(serde_json::Value),
1310}
1311
1312#[derive(Debug, Clone, Serialize, Deserialize)]
1314#[serde(untagged)]
1315pub enum StagesPromptPromptsUpdateError {
1316 Status400(models::ValidationError),
1317 Status403(models::GenericError),
1318 UnknownValue(serde_json::Value),
1319}
1320
1321#[derive(Debug, Clone, Serialize, Deserialize)]
1323#[serde(untagged)]
1324pub enum StagesPromptPromptsUsedByListError {
1325 Status400(models::ValidationError),
1326 Status403(models::GenericError),
1327 UnknownValue(serde_json::Value),
1328}
1329
1330#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum StagesPromptStagesCreateError {
1334 Status400(models::ValidationError),
1335 Status403(models::GenericError),
1336 UnknownValue(serde_json::Value),
1337}
1338
1339#[derive(Debug, Clone, Serialize, Deserialize)]
1341#[serde(untagged)]
1342pub enum StagesPromptStagesDestroyError {
1343 Status400(models::ValidationError),
1344 Status403(models::GenericError),
1345 UnknownValue(serde_json::Value),
1346}
1347
1348#[derive(Debug, Clone, Serialize, Deserialize)]
1350#[serde(untagged)]
1351pub enum StagesPromptStagesListError {
1352 Status400(models::ValidationError),
1353 Status403(models::GenericError),
1354 UnknownValue(serde_json::Value),
1355}
1356
1357#[derive(Debug, Clone, Serialize, Deserialize)]
1359#[serde(untagged)]
1360pub enum StagesPromptStagesPartialUpdateError {
1361 Status400(models::ValidationError),
1362 Status403(models::GenericError),
1363 UnknownValue(serde_json::Value),
1364}
1365
1366#[derive(Debug, Clone, Serialize, Deserialize)]
1368#[serde(untagged)]
1369pub enum StagesPromptStagesRetrieveError {
1370 Status400(models::ValidationError),
1371 Status403(models::GenericError),
1372 UnknownValue(serde_json::Value),
1373}
1374
1375#[derive(Debug, Clone, Serialize, Deserialize)]
1377#[serde(untagged)]
1378pub enum StagesPromptStagesUpdateError {
1379 Status400(models::ValidationError),
1380 Status403(models::GenericError),
1381 UnknownValue(serde_json::Value),
1382}
1383
1384#[derive(Debug, Clone, Serialize, Deserialize)]
1386#[serde(untagged)]
1387pub enum StagesPromptStagesUsedByListError {
1388 Status400(models::ValidationError),
1389 Status403(models::GenericError),
1390 UnknownValue(serde_json::Value),
1391}
1392
1393#[derive(Debug, Clone, Serialize, Deserialize)]
1395#[serde(untagged)]
1396pub enum StagesRedirectCreateError {
1397 Status400(models::ValidationError),
1398 Status403(models::GenericError),
1399 UnknownValue(serde_json::Value),
1400}
1401
1402#[derive(Debug, Clone, Serialize, Deserialize)]
1404#[serde(untagged)]
1405pub enum StagesRedirectDestroyError {
1406 Status400(models::ValidationError),
1407 Status403(models::GenericError),
1408 UnknownValue(serde_json::Value),
1409}
1410
1411#[derive(Debug, Clone, Serialize, Deserialize)]
1413#[serde(untagged)]
1414pub enum StagesRedirectListError {
1415 Status400(models::ValidationError),
1416 Status403(models::GenericError),
1417 UnknownValue(serde_json::Value),
1418}
1419
1420#[derive(Debug, Clone, Serialize, Deserialize)]
1422#[serde(untagged)]
1423pub enum StagesRedirectPartialUpdateError {
1424 Status400(models::ValidationError),
1425 Status403(models::GenericError),
1426 UnknownValue(serde_json::Value),
1427}
1428
1429#[derive(Debug, Clone, Serialize, Deserialize)]
1431#[serde(untagged)]
1432pub enum StagesRedirectRetrieveError {
1433 Status400(models::ValidationError),
1434 Status403(models::GenericError),
1435 UnknownValue(serde_json::Value),
1436}
1437
1438#[derive(Debug, Clone, Serialize, Deserialize)]
1440#[serde(untagged)]
1441pub enum StagesRedirectUpdateError {
1442 Status400(models::ValidationError),
1443 Status403(models::GenericError),
1444 UnknownValue(serde_json::Value),
1445}
1446
1447#[derive(Debug, Clone, Serialize, Deserialize)]
1449#[serde(untagged)]
1450pub enum StagesRedirectUsedByListError {
1451 Status400(models::ValidationError),
1452 Status403(models::GenericError),
1453 UnknownValue(serde_json::Value),
1454}
1455
1456#[derive(Debug, Clone, Serialize, Deserialize)]
1458#[serde(untagged)]
1459pub enum StagesSourceCreateError {
1460 Status400(models::ValidationError),
1461 Status403(models::GenericError),
1462 UnknownValue(serde_json::Value),
1463}
1464
1465#[derive(Debug, Clone, Serialize, Deserialize)]
1467#[serde(untagged)]
1468pub enum StagesSourceDestroyError {
1469 Status400(models::ValidationError),
1470 Status403(models::GenericError),
1471 UnknownValue(serde_json::Value),
1472}
1473
1474#[derive(Debug, Clone, Serialize, Deserialize)]
1476#[serde(untagged)]
1477pub enum StagesSourceListError {
1478 Status400(models::ValidationError),
1479 Status403(models::GenericError),
1480 UnknownValue(serde_json::Value),
1481}
1482
1483#[derive(Debug, Clone, Serialize, Deserialize)]
1485#[serde(untagged)]
1486pub enum StagesSourcePartialUpdateError {
1487 Status400(models::ValidationError),
1488 Status403(models::GenericError),
1489 UnknownValue(serde_json::Value),
1490}
1491
1492#[derive(Debug, Clone, Serialize, Deserialize)]
1494#[serde(untagged)]
1495pub enum StagesSourceRetrieveError {
1496 Status400(models::ValidationError),
1497 Status403(models::GenericError),
1498 UnknownValue(serde_json::Value),
1499}
1500
1501#[derive(Debug, Clone, Serialize, Deserialize)]
1503#[serde(untagged)]
1504pub enum StagesSourceUpdateError {
1505 Status400(models::ValidationError),
1506 Status403(models::GenericError),
1507 UnknownValue(serde_json::Value),
1508}
1509
1510#[derive(Debug, Clone, Serialize, Deserialize)]
1512#[serde(untagged)]
1513pub enum StagesSourceUsedByListError {
1514 Status400(models::ValidationError),
1515 Status403(models::GenericError),
1516 UnknownValue(serde_json::Value),
1517}
1518
1519#[derive(Debug, Clone, Serialize, Deserialize)]
1521#[serde(untagged)]
1522pub enum StagesUserDeleteCreateError {
1523 Status400(models::ValidationError),
1524 Status403(models::GenericError),
1525 UnknownValue(serde_json::Value),
1526}
1527
1528#[derive(Debug, Clone, Serialize, Deserialize)]
1530#[serde(untagged)]
1531pub enum StagesUserDeleteDestroyError {
1532 Status400(models::ValidationError),
1533 Status403(models::GenericError),
1534 UnknownValue(serde_json::Value),
1535}
1536
1537#[derive(Debug, Clone, Serialize, Deserialize)]
1539#[serde(untagged)]
1540pub enum StagesUserDeleteListError {
1541 Status400(models::ValidationError),
1542 Status403(models::GenericError),
1543 UnknownValue(serde_json::Value),
1544}
1545
1546#[derive(Debug, Clone, Serialize, Deserialize)]
1548#[serde(untagged)]
1549pub enum StagesUserDeletePartialUpdateError {
1550 Status400(models::ValidationError),
1551 Status403(models::GenericError),
1552 UnknownValue(serde_json::Value),
1553}
1554
1555#[derive(Debug, Clone, Serialize, Deserialize)]
1557#[serde(untagged)]
1558pub enum StagesUserDeleteRetrieveError {
1559 Status400(models::ValidationError),
1560 Status403(models::GenericError),
1561 UnknownValue(serde_json::Value),
1562}
1563
1564#[derive(Debug, Clone, Serialize, Deserialize)]
1566#[serde(untagged)]
1567pub enum StagesUserDeleteUpdateError {
1568 Status400(models::ValidationError),
1569 Status403(models::GenericError),
1570 UnknownValue(serde_json::Value),
1571}
1572
1573#[derive(Debug, Clone, Serialize, Deserialize)]
1575#[serde(untagged)]
1576pub enum StagesUserDeleteUsedByListError {
1577 Status400(models::ValidationError),
1578 Status403(models::GenericError),
1579 UnknownValue(serde_json::Value),
1580}
1581
1582#[derive(Debug, Clone, Serialize, Deserialize)]
1584#[serde(untagged)]
1585pub enum StagesUserLoginCreateError {
1586 Status400(models::ValidationError),
1587 Status403(models::GenericError),
1588 UnknownValue(serde_json::Value),
1589}
1590
1591#[derive(Debug, Clone, Serialize, Deserialize)]
1593#[serde(untagged)]
1594pub enum StagesUserLoginDestroyError {
1595 Status400(models::ValidationError),
1596 Status403(models::GenericError),
1597 UnknownValue(serde_json::Value),
1598}
1599
1600#[derive(Debug, Clone, Serialize, Deserialize)]
1602#[serde(untagged)]
1603pub enum StagesUserLoginListError {
1604 Status400(models::ValidationError),
1605 Status403(models::GenericError),
1606 UnknownValue(serde_json::Value),
1607}
1608
1609#[derive(Debug, Clone, Serialize, Deserialize)]
1611#[serde(untagged)]
1612pub enum StagesUserLoginPartialUpdateError {
1613 Status400(models::ValidationError),
1614 Status403(models::GenericError),
1615 UnknownValue(serde_json::Value),
1616}
1617
1618#[derive(Debug, Clone, Serialize, Deserialize)]
1620#[serde(untagged)]
1621pub enum StagesUserLoginRetrieveError {
1622 Status400(models::ValidationError),
1623 Status403(models::GenericError),
1624 UnknownValue(serde_json::Value),
1625}
1626
1627#[derive(Debug, Clone, Serialize, Deserialize)]
1629#[serde(untagged)]
1630pub enum StagesUserLoginUpdateError {
1631 Status400(models::ValidationError),
1632 Status403(models::GenericError),
1633 UnknownValue(serde_json::Value),
1634}
1635
1636#[derive(Debug, Clone, Serialize, Deserialize)]
1638#[serde(untagged)]
1639pub enum StagesUserLoginUsedByListError {
1640 Status400(models::ValidationError),
1641 Status403(models::GenericError),
1642 UnknownValue(serde_json::Value),
1643}
1644
1645#[derive(Debug, Clone, Serialize, Deserialize)]
1647#[serde(untagged)]
1648pub enum StagesUserLogoutCreateError {
1649 Status400(models::ValidationError),
1650 Status403(models::GenericError),
1651 UnknownValue(serde_json::Value),
1652}
1653
1654#[derive(Debug, Clone, Serialize, Deserialize)]
1656#[serde(untagged)]
1657pub enum StagesUserLogoutDestroyError {
1658 Status400(models::ValidationError),
1659 Status403(models::GenericError),
1660 UnknownValue(serde_json::Value),
1661}
1662
1663#[derive(Debug, Clone, Serialize, Deserialize)]
1665#[serde(untagged)]
1666pub enum StagesUserLogoutListError {
1667 Status400(models::ValidationError),
1668 Status403(models::GenericError),
1669 UnknownValue(serde_json::Value),
1670}
1671
1672#[derive(Debug, Clone, Serialize, Deserialize)]
1674#[serde(untagged)]
1675pub enum StagesUserLogoutPartialUpdateError {
1676 Status400(models::ValidationError),
1677 Status403(models::GenericError),
1678 UnknownValue(serde_json::Value),
1679}
1680
1681#[derive(Debug, Clone, Serialize, Deserialize)]
1683#[serde(untagged)]
1684pub enum StagesUserLogoutRetrieveError {
1685 Status400(models::ValidationError),
1686 Status403(models::GenericError),
1687 UnknownValue(serde_json::Value),
1688}
1689
1690#[derive(Debug, Clone, Serialize, Deserialize)]
1692#[serde(untagged)]
1693pub enum StagesUserLogoutUpdateError {
1694 Status400(models::ValidationError),
1695 Status403(models::GenericError),
1696 UnknownValue(serde_json::Value),
1697}
1698
1699#[derive(Debug, Clone, Serialize, Deserialize)]
1701#[serde(untagged)]
1702pub enum StagesUserLogoutUsedByListError {
1703 Status400(models::ValidationError),
1704 Status403(models::GenericError),
1705 UnknownValue(serde_json::Value),
1706}
1707
1708#[derive(Debug, Clone, Serialize, Deserialize)]
1710#[serde(untagged)]
1711pub enum StagesUserWriteCreateError {
1712 Status400(models::ValidationError),
1713 Status403(models::GenericError),
1714 UnknownValue(serde_json::Value),
1715}
1716
1717#[derive(Debug, Clone, Serialize, Deserialize)]
1719#[serde(untagged)]
1720pub enum StagesUserWriteDestroyError {
1721 Status400(models::ValidationError),
1722 Status403(models::GenericError),
1723 UnknownValue(serde_json::Value),
1724}
1725
1726#[derive(Debug, Clone, Serialize, Deserialize)]
1728#[serde(untagged)]
1729pub enum StagesUserWriteListError {
1730 Status400(models::ValidationError),
1731 Status403(models::GenericError),
1732 UnknownValue(serde_json::Value),
1733}
1734
1735#[derive(Debug, Clone, Serialize, Deserialize)]
1737#[serde(untagged)]
1738pub enum StagesUserWritePartialUpdateError {
1739 Status400(models::ValidationError),
1740 Status403(models::GenericError),
1741 UnknownValue(serde_json::Value),
1742}
1743
1744#[derive(Debug, Clone, Serialize, Deserialize)]
1746#[serde(untagged)]
1747pub enum StagesUserWriteRetrieveError {
1748 Status400(models::ValidationError),
1749 Status403(models::GenericError),
1750 UnknownValue(serde_json::Value),
1751}
1752
1753#[derive(Debug, Clone, Serialize, Deserialize)]
1755#[serde(untagged)]
1756pub enum StagesUserWriteUpdateError {
1757 Status400(models::ValidationError),
1758 Status403(models::GenericError),
1759 UnknownValue(serde_json::Value),
1760}
1761
1762#[derive(Debug, Clone, Serialize, Deserialize)]
1764#[serde(untagged)]
1765pub enum StagesUserWriteUsedByListError {
1766 Status400(models::ValidationError),
1767 Status403(models::GenericError),
1768 UnknownValue(serde_json::Value),
1769}
1770
1771pub async fn stages_all_destroy(
1773 configuration: &configuration::Configuration,
1774 stage_uuid: &str,
1775) -> Result<(), Error<StagesAllDestroyError>> {
1776 let p_path_stage_uuid = stage_uuid;
1778
1779 let uri_str = format!(
1780 "{}/stages/all/{stage_uuid}/",
1781 configuration.base_path,
1782 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
1783 );
1784 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1785
1786 if let Some(ref user_agent) = configuration.user_agent {
1787 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1788 }
1789 if let Some(ref token) = configuration.bearer_access_token {
1790 req_builder = req_builder.bearer_auth(token.to_owned());
1791 };
1792
1793 let req = req_builder.build()?;
1794 let resp = configuration.client.execute(req).await?;
1795
1796 let status = resp.status();
1797
1798 if !status.is_client_error() && !status.is_server_error() {
1799 Ok(())
1800 } else {
1801 let content = resp.text().await?;
1802 let entity: Option<StagesAllDestroyError> = serde_json::from_str(&content).ok();
1803 Err(Error::ResponseError(ResponseContent {
1804 status,
1805 content,
1806 entity,
1807 }))
1808 }
1809}
1810
1811pub async fn stages_all_list(
1813 configuration: &configuration::Configuration,
1814 name: Option<&str>,
1815 ordering: Option<&str>,
1816 page: Option<i32>,
1817 page_size: Option<i32>,
1818 search: Option<&str>,
1819) -> Result<models::PaginatedStageList, Error<StagesAllListError>> {
1820 let p_query_name = name;
1822 let p_query_ordering = ordering;
1823 let p_query_page = page;
1824 let p_query_page_size = page_size;
1825 let p_query_search = search;
1826
1827 let uri_str = format!("{}/stages/all/", configuration.base_path);
1828 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1829
1830 if let Some(ref param_value) = p_query_name {
1831 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
1832 }
1833 if let Some(ref param_value) = p_query_ordering {
1834 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
1835 }
1836 if let Some(ref param_value) = p_query_page {
1837 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1838 }
1839 if let Some(ref param_value) = p_query_page_size {
1840 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
1841 }
1842 if let Some(ref param_value) = p_query_search {
1843 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
1844 }
1845 if let Some(ref user_agent) = configuration.user_agent {
1846 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1847 }
1848 if let Some(ref token) = configuration.bearer_access_token {
1849 req_builder = req_builder.bearer_auth(token.to_owned());
1850 };
1851
1852 let req = req_builder.build()?;
1853 let resp = configuration.client.execute(req).await?;
1854
1855 let status = resp.status();
1856 let content_type = resp
1857 .headers()
1858 .get("content-type")
1859 .and_then(|v| v.to_str().ok())
1860 .unwrap_or("application/octet-stream");
1861 let content_type = super::ContentType::from(content_type);
1862
1863 if !status.is_client_error() && !status.is_server_error() {
1864 let content = resp.text().await?;
1865 match content_type {
1866 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1867 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedStageList`"))),
1868 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedStageList`")))),
1869 }
1870 } else {
1871 let content = resp.text().await?;
1872 let entity: Option<StagesAllListError> = serde_json::from_str(&content).ok();
1873 Err(Error::ResponseError(ResponseContent {
1874 status,
1875 content,
1876 entity,
1877 }))
1878 }
1879}
1880
1881pub async fn stages_all_retrieve(
1883 configuration: &configuration::Configuration,
1884 stage_uuid: &str,
1885) -> Result<models::Stage, Error<StagesAllRetrieveError>> {
1886 let p_path_stage_uuid = stage_uuid;
1888
1889 let uri_str = format!(
1890 "{}/stages/all/{stage_uuid}/",
1891 configuration.base_path,
1892 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
1893 );
1894 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1895
1896 if let Some(ref user_agent) = configuration.user_agent {
1897 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1898 }
1899 if let Some(ref token) = configuration.bearer_access_token {
1900 req_builder = req_builder.bearer_auth(token.to_owned());
1901 };
1902
1903 let req = req_builder.build()?;
1904 let resp = configuration.client.execute(req).await?;
1905
1906 let status = resp.status();
1907 let content_type = resp
1908 .headers()
1909 .get("content-type")
1910 .and_then(|v| v.to_str().ok())
1911 .unwrap_or("application/octet-stream");
1912 let content_type = super::ContentType::from(content_type);
1913
1914 if !status.is_client_error() && !status.is_server_error() {
1915 let content = resp.text().await?;
1916 match content_type {
1917 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1918 ContentType::Text => {
1919 return Err(Error::from(serde_json::Error::custom(
1920 "Received `text/plain` content type response that cannot be converted to `models::Stage`",
1921 )))
1922 }
1923 ContentType::Unsupported(unknown_type) => {
1924 return Err(Error::from(serde_json::Error::custom(format!(
1925 "Received `{unknown_type}` content type response that cannot be converted to `models::Stage`"
1926 ))))
1927 }
1928 }
1929 } else {
1930 let content = resp.text().await?;
1931 let entity: Option<StagesAllRetrieveError> = serde_json::from_str(&content).ok();
1932 Err(Error::ResponseError(ResponseContent {
1933 status,
1934 content,
1935 entity,
1936 }))
1937 }
1938}
1939
1940pub async fn stages_all_types_list(
1942 configuration: &configuration::Configuration,
1943) -> Result<Vec<models::TypeCreate>, Error<StagesAllTypesListError>> {
1944 let uri_str = format!("{}/stages/all/types/", configuration.base_path);
1945 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1946
1947 if let Some(ref user_agent) = configuration.user_agent {
1948 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1949 }
1950 if let Some(ref token) = configuration.bearer_access_token {
1951 req_builder = req_builder.bearer_auth(token.to_owned());
1952 };
1953
1954 let req = req_builder.build()?;
1955 let resp = configuration.client.execute(req).await?;
1956
1957 let status = resp.status();
1958 let content_type = resp
1959 .headers()
1960 .get("content-type")
1961 .and_then(|v| v.to_str().ok())
1962 .unwrap_or("application/octet-stream");
1963 let content_type = super::ContentType::from(content_type);
1964
1965 if !status.is_client_error() && !status.is_server_error() {
1966 let content = resp.text().await?;
1967 match content_type {
1968 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1969 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TypeCreate>`"))),
1970 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>`")))),
1971 }
1972 } else {
1973 let content = resp.text().await?;
1974 let entity: Option<StagesAllTypesListError> = serde_json::from_str(&content).ok();
1975 Err(Error::ResponseError(ResponseContent {
1976 status,
1977 content,
1978 entity,
1979 }))
1980 }
1981}
1982
1983pub async fn stages_all_used_by_list(
1985 configuration: &configuration::Configuration,
1986 stage_uuid: &str,
1987) -> Result<Vec<models::UsedBy>, Error<StagesAllUsedByListError>> {
1988 let p_path_stage_uuid = stage_uuid;
1990
1991 let uri_str = format!(
1992 "{}/stages/all/{stage_uuid}/used_by/",
1993 configuration.base_path,
1994 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
1995 );
1996 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1997
1998 if let Some(ref user_agent) = configuration.user_agent {
1999 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2000 }
2001 if let Some(ref token) = configuration.bearer_access_token {
2002 req_builder = req_builder.bearer_auth(token.to_owned());
2003 };
2004
2005 let req = req_builder.build()?;
2006 let resp = configuration.client.execute(req).await?;
2007
2008 let status = resp.status();
2009 let content_type = resp
2010 .headers()
2011 .get("content-type")
2012 .and_then(|v| v.to_str().ok())
2013 .unwrap_or("application/octet-stream");
2014 let content_type = super::ContentType::from(content_type);
2015
2016 if !status.is_client_error() && !status.is_server_error() {
2017 let content = resp.text().await?;
2018 match content_type {
2019 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2020 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
2021 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>`")))),
2022 }
2023 } else {
2024 let content = resp.text().await?;
2025 let entity: Option<StagesAllUsedByListError> = serde_json::from_str(&content).ok();
2026 Err(Error::ResponseError(ResponseContent {
2027 status,
2028 content,
2029 entity,
2030 }))
2031 }
2032}
2033
2034pub async fn stages_all_user_settings_list(
2036 configuration: &configuration::Configuration,
2037) -> Result<Vec<models::UserSetting>, Error<StagesAllUserSettingsListError>> {
2038 let uri_str = format!("{}/stages/all/user_settings/", configuration.base_path);
2039 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2040
2041 if let Some(ref user_agent) = configuration.user_agent {
2042 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2043 }
2044 if let Some(ref token) = configuration.bearer_access_token {
2045 req_builder = req_builder.bearer_auth(token.to_owned());
2046 };
2047
2048 let req = req_builder.build()?;
2049 let resp = configuration.client.execute(req).await?;
2050
2051 let status = resp.status();
2052 let content_type = resp
2053 .headers()
2054 .get("content-type")
2055 .and_then(|v| v.to_str().ok())
2056 .unwrap_or("application/octet-stream");
2057 let content_type = super::ContentType::from(content_type);
2058
2059 if !status.is_client_error() && !status.is_server_error() {
2060 let content = resp.text().await?;
2061 match content_type {
2062 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2063 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserSetting>`"))),
2064 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UserSetting>`")))),
2065 }
2066 } else {
2067 let content = resp.text().await?;
2068 let entity: Option<StagesAllUserSettingsListError> = serde_json::from_str(&content).ok();
2069 Err(Error::ResponseError(ResponseContent {
2070 status,
2071 content,
2072 entity,
2073 }))
2074 }
2075}
2076
2077pub async fn stages_authenticator_duo_create(
2079 configuration: &configuration::Configuration,
2080 authenticator_duo_stage_request: models::AuthenticatorDuoStageRequest,
2081) -> Result<models::AuthenticatorDuoStage, Error<StagesAuthenticatorDuoCreateError>> {
2082 let p_body_authenticator_duo_stage_request = authenticator_duo_stage_request;
2084
2085 let uri_str = format!("{}/stages/authenticator/duo/", configuration.base_path);
2086 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2087
2088 if let Some(ref user_agent) = configuration.user_agent {
2089 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2090 }
2091 if let Some(ref token) = configuration.bearer_access_token {
2092 req_builder = req_builder.bearer_auth(token.to_owned());
2093 };
2094 req_builder = req_builder.json(&p_body_authenticator_duo_stage_request);
2095
2096 let req = req_builder.build()?;
2097 let resp = configuration.client.execute(req).await?;
2098
2099 let status = resp.status();
2100 let content_type = resp
2101 .headers()
2102 .get("content-type")
2103 .and_then(|v| v.to_str().ok())
2104 .unwrap_or("application/octet-stream");
2105 let content_type = super::ContentType::from(content_type);
2106
2107 if !status.is_client_error() && !status.is_server_error() {
2108 let content = resp.text().await?;
2109 match content_type {
2110 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2111 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorDuoStage`"))),
2112 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorDuoStage`")))),
2113 }
2114 } else {
2115 let content = resp.text().await?;
2116 let entity: Option<StagesAuthenticatorDuoCreateError> = serde_json::from_str(&content).ok();
2117 Err(Error::ResponseError(ResponseContent {
2118 status,
2119 content,
2120 entity,
2121 }))
2122 }
2123}
2124
2125pub async fn stages_authenticator_duo_destroy(
2127 configuration: &configuration::Configuration,
2128 stage_uuid: &str,
2129) -> Result<(), Error<StagesAuthenticatorDuoDestroyError>> {
2130 let p_path_stage_uuid = stage_uuid;
2132
2133 let uri_str = format!(
2134 "{}/stages/authenticator/duo/{stage_uuid}/",
2135 configuration.base_path,
2136 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2137 );
2138 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2139
2140 if let Some(ref user_agent) = configuration.user_agent {
2141 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2142 }
2143 if let Some(ref token) = configuration.bearer_access_token {
2144 req_builder = req_builder.bearer_auth(token.to_owned());
2145 };
2146
2147 let req = req_builder.build()?;
2148 let resp = configuration.client.execute(req).await?;
2149
2150 let status = resp.status();
2151
2152 if !status.is_client_error() && !status.is_server_error() {
2153 Ok(())
2154 } else {
2155 let content = resp.text().await?;
2156 let entity: Option<StagesAuthenticatorDuoDestroyError> = serde_json::from_str(&content).ok();
2157 Err(Error::ResponseError(ResponseContent {
2158 status,
2159 content,
2160 entity,
2161 }))
2162 }
2163}
2164
2165pub async fn stages_authenticator_duo_enrollment_status_create(
2167 configuration: &configuration::Configuration,
2168 stage_uuid: &str,
2169) -> Result<models::DuoDeviceEnrollmentStatus, Error<StagesAuthenticatorDuoEnrollmentStatusCreateError>> {
2170 let p_path_stage_uuid = stage_uuid;
2172
2173 let uri_str = format!(
2174 "{}/stages/authenticator/duo/{stage_uuid}/enrollment_status/",
2175 configuration.base_path,
2176 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2177 );
2178 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2179
2180 if let Some(ref user_agent) = configuration.user_agent {
2181 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2182 }
2183 if let Some(ref token) = configuration.bearer_access_token {
2184 req_builder = req_builder.bearer_auth(token.to_owned());
2185 };
2186
2187 let req = req_builder.build()?;
2188 let resp = configuration.client.execute(req).await?;
2189
2190 let status = resp.status();
2191 let content_type = resp
2192 .headers()
2193 .get("content-type")
2194 .and_then(|v| v.to_str().ok())
2195 .unwrap_or("application/octet-stream");
2196 let content_type = super::ContentType::from(content_type);
2197
2198 if !status.is_client_error() && !status.is_server_error() {
2199 let content = resp.text().await?;
2200 match content_type {
2201 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2202 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DuoDeviceEnrollmentStatus`"))),
2203 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DuoDeviceEnrollmentStatus`")))),
2204 }
2205 } else {
2206 let content = resp.text().await?;
2207 let entity: Option<StagesAuthenticatorDuoEnrollmentStatusCreateError> = serde_json::from_str(&content).ok();
2208 Err(Error::ResponseError(ResponseContent {
2209 status,
2210 content,
2211 entity,
2212 }))
2213 }
2214}
2215
2216pub async fn stages_authenticator_duo_import_device_manual_create(
2218 configuration: &configuration::Configuration,
2219 stage_uuid: &str,
2220 authenticator_duo_stage_manual_device_import_request: models::AuthenticatorDuoStageManualDeviceImportRequest,
2221) -> Result<(), Error<StagesAuthenticatorDuoImportDeviceManualCreateError>> {
2222 let p_path_stage_uuid = stage_uuid;
2224 let p_body_authenticator_duo_stage_manual_device_import_request =
2225 authenticator_duo_stage_manual_device_import_request;
2226
2227 let uri_str = format!(
2228 "{}/stages/authenticator/duo/{stage_uuid}/import_device_manual/",
2229 configuration.base_path,
2230 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2231 );
2232 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2233
2234 if let Some(ref user_agent) = configuration.user_agent {
2235 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2236 }
2237 if let Some(ref token) = configuration.bearer_access_token {
2238 req_builder = req_builder.bearer_auth(token.to_owned());
2239 };
2240 req_builder = req_builder.json(&p_body_authenticator_duo_stage_manual_device_import_request);
2241
2242 let req = req_builder.build()?;
2243 let resp = configuration.client.execute(req).await?;
2244
2245 let status = resp.status();
2246
2247 if !status.is_client_error() && !status.is_server_error() {
2248 Ok(())
2249 } else {
2250 let content = resp.text().await?;
2251 let entity: Option<StagesAuthenticatorDuoImportDeviceManualCreateError> = serde_json::from_str(&content).ok();
2252 Err(Error::ResponseError(ResponseContent {
2253 status,
2254 content,
2255 entity,
2256 }))
2257 }
2258}
2259
2260pub async fn stages_authenticator_duo_import_devices_automatic_create(
2262 configuration: &configuration::Configuration,
2263 stage_uuid: &str,
2264) -> Result<
2265 models::AuthenticatorDuoStageDeviceImportResponse,
2266 Error<StagesAuthenticatorDuoImportDevicesAutomaticCreateError>,
2267> {
2268 let p_path_stage_uuid = stage_uuid;
2270
2271 let uri_str = format!(
2272 "{}/stages/authenticator/duo/{stage_uuid}/import_devices_automatic/",
2273 configuration.base_path,
2274 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2275 );
2276 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2277
2278 if let Some(ref user_agent) = configuration.user_agent {
2279 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2280 }
2281 if let Some(ref token) = configuration.bearer_access_token {
2282 req_builder = req_builder.bearer_auth(token.to_owned());
2283 };
2284
2285 let req = req_builder.build()?;
2286 let resp = configuration.client.execute(req).await?;
2287
2288 let status = resp.status();
2289 let content_type = resp
2290 .headers()
2291 .get("content-type")
2292 .and_then(|v| v.to_str().ok())
2293 .unwrap_or("application/octet-stream");
2294 let content_type = super::ContentType::from(content_type);
2295
2296 if !status.is_client_error() && !status.is_server_error() {
2297 let content = resp.text().await?;
2298 match content_type {
2299 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2300 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorDuoStageDeviceImportResponse`"))),
2301 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorDuoStageDeviceImportResponse`")))),
2302 }
2303 } else {
2304 let content = resp.text().await?;
2305 let entity: Option<StagesAuthenticatorDuoImportDevicesAutomaticCreateError> =
2306 serde_json::from_str(&content).ok();
2307 Err(Error::ResponseError(ResponseContent {
2308 status,
2309 content,
2310 entity,
2311 }))
2312 }
2313}
2314
2315pub async fn stages_authenticator_duo_list(
2317 configuration: &configuration::Configuration,
2318 api_hostname: Option<&str>,
2319 client_id: Option<&str>,
2320 configure_flow: Option<&str>,
2321 name: Option<&str>,
2322 ordering: Option<&str>,
2323 page: Option<i32>,
2324 page_size: Option<i32>,
2325 search: Option<&str>,
2326) -> Result<models::PaginatedAuthenticatorDuoStageList, Error<StagesAuthenticatorDuoListError>> {
2327 let p_query_api_hostname = api_hostname;
2329 let p_query_client_id = client_id;
2330 let p_query_configure_flow = configure_flow;
2331 let p_query_name = name;
2332 let p_query_ordering = ordering;
2333 let p_query_page = page;
2334 let p_query_page_size = page_size;
2335 let p_query_search = search;
2336
2337 let uri_str = format!("{}/stages/authenticator/duo/", configuration.base_path);
2338 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2339
2340 if let Some(ref param_value) = p_query_api_hostname {
2341 req_builder = req_builder.query(&[("api_hostname", ¶m_value.to_string())]);
2342 }
2343 if let Some(ref param_value) = p_query_client_id {
2344 req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]);
2345 }
2346 if let Some(ref param_value) = p_query_configure_flow {
2347 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
2348 }
2349 if let Some(ref param_value) = p_query_name {
2350 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
2351 }
2352 if let Some(ref param_value) = p_query_ordering {
2353 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
2354 }
2355 if let Some(ref param_value) = p_query_page {
2356 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2357 }
2358 if let Some(ref param_value) = p_query_page_size {
2359 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
2360 }
2361 if let Some(ref param_value) = p_query_search {
2362 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
2363 }
2364 if let Some(ref user_agent) = configuration.user_agent {
2365 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2366 }
2367 if let Some(ref token) = configuration.bearer_access_token {
2368 req_builder = req_builder.bearer_auth(token.to_owned());
2369 };
2370
2371 let req = req_builder.build()?;
2372 let resp = configuration.client.execute(req).await?;
2373
2374 let status = resp.status();
2375 let content_type = resp
2376 .headers()
2377 .get("content-type")
2378 .and_then(|v| v.to_str().ok())
2379 .unwrap_or("application/octet-stream");
2380 let content_type = super::ContentType::from(content_type);
2381
2382 if !status.is_client_error() && !status.is_server_error() {
2383 let content = resp.text().await?;
2384 match content_type {
2385 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2386 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorDuoStageList`"))),
2387 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorDuoStageList`")))),
2388 }
2389 } else {
2390 let content = resp.text().await?;
2391 let entity: Option<StagesAuthenticatorDuoListError> = serde_json::from_str(&content).ok();
2392 Err(Error::ResponseError(ResponseContent {
2393 status,
2394 content,
2395 entity,
2396 }))
2397 }
2398}
2399
2400pub async fn stages_authenticator_duo_partial_update(
2402 configuration: &configuration::Configuration,
2403 stage_uuid: &str,
2404 patched_authenticator_duo_stage_request: Option<models::PatchedAuthenticatorDuoStageRequest>,
2405) -> Result<models::AuthenticatorDuoStage, Error<StagesAuthenticatorDuoPartialUpdateError>> {
2406 let p_path_stage_uuid = stage_uuid;
2408 let p_body_patched_authenticator_duo_stage_request = patched_authenticator_duo_stage_request;
2409
2410 let uri_str = format!(
2411 "{}/stages/authenticator/duo/{stage_uuid}/",
2412 configuration.base_path,
2413 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2414 );
2415 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2416
2417 if let Some(ref user_agent) = configuration.user_agent {
2418 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2419 }
2420 if let Some(ref token) = configuration.bearer_access_token {
2421 req_builder = req_builder.bearer_auth(token.to_owned());
2422 };
2423 req_builder = req_builder.json(&p_body_patched_authenticator_duo_stage_request);
2424
2425 let req = req_builder.build()?;
2426 let resp = configuration.client.execute(req).await?;
2427
2428 let status = resp.status();
2429 let content_type = resp
2430 .headers()
2431 .get("content-type")
2432 .and_then(|v| v.to_str().ok())
2433 .unwrap_or("application/octet-stream");
2434 let content_type = super::ContentType::from(content_type);
2435
2436 if !status.is_client_error() && !status.is_server_error() {
2437 let content = resp.text().await?;
2438 match content_type {
2439 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2440 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorDuoStage`"))),
2441 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorDuoStage`")))),
2442 }
2443 } else {
2444 let content = resp.text().await?;
2445 let entity: Option<StagesAuthenticatorDuoPartialUpdateError> = serde_json::from_str(&content).ok();
2446 Err(Error::ResponseError(ResponseContent {
2447 status,
2448 content,
2449 entity,
2450 }))
2451 }
2452}
2453
2454pub async fn stages_authenticator_duo_retrieve(
2456 configuration: &configuration::Configuration,
2457 stage_uuid: &str,
2458) -> Result<models::AuthenticatorDuoStage, Error<StagesAuthenticatorDuoRetrieveError>> {
2459 let p_path_stage_uuid = stage_uuid;
2461
2462 let uri_str = format!(
2463 "{}/stages/authenticator/duo/{stage_uuid}/",
2464 configuration.base_path,
2465 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2466 );
2467 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2468
2469 if let Some(ref user_agent) = configuration.user_agent {
2470 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2471 }
2472 if let Some(ref token) = configuration.bearer_access_token {
2473 req_builder = req_builder.bearer_auth(token.to_owned());
2474 };
2475
2476 let req = req_builder.build()?;
2477 let resp = configuration.client.execute(req).await?;
2478
2479 let status = resp.status();
2480 let content_type = resp
2481 .headers()
2482 .get("content-type")
2483 .and_then(|v| v.to_str().ok())
2484 .unwrap_or("application/octet-stream");
2485 let content_type = super::ContentType::from(content_type);
2486
2487 if !status.is_client_error() && !status.is_server_error() {
2488 let content = resp.text().await?;
2489 match content_type {
2490 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2491 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorDuoStage`"))),
2492 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorDuoStage`")))),
2493 }
2494 } else {
2495 let content = resp.text().await?;
2496 let entity: Option<StagesAuthenticatorDuoRetrieveError> = serde_json::from_str(&content).ok();
2497 Err(Error::ResponseError(ResponseContent {
2498 status,
2499 content,
2500 entity,
2501 }))
2502 }
2503}
2504
2505pub async fn stages_authenticator_duo_update(
2507 configuration: &configuration::Configuration,
2508 stage_uuid: &str,
2509 authenticator_duo_stage_request: models::AuthenticatorDuoStageRequest,
2510) -> Result<models::AuthenticatorDuoStage, Error<StagesAuthenticatorDuoUpdateError>> {
2511 let p_path_stage_uuid = stage_uuid;
2513 let p_body_authenticator_duo_stage_request = authenticator_duo_stage_request;
2514
2515 let uri_str = format!(
2516 "{}/stages/authenticator/duo/{stage_uuid}/",
2517 configuration.base_path,
2518 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2519 );
2520 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
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 req_builder = req_builder.json(&p_body_authenticator_duo_stage_request);
2529
2530 let req = req_builder.build()?;
2531 let resp = configuration.client.execute(req).await?;
2532
2533 let status = resp.status();
2534 let content_type = resp
2535 .headers()
2536 .get("content-type")
2537 .and_then(|v| v.to_str().ok())
2538 .unwrap_or("application/octet-stream");
2539 let content_type = super::ContentType::from(content_type);
2540
2541 if !status.is_client_error() && !status.is_server_error() {
2542 let content = resp.text().await?;
2543 match content_type {
2544 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2545 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorDuoStage`"))),
2546 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorDuoStage`")))),
2547 }
2548 } else {
2549 let content = resp.text().await?;
2550 let entity: Option<StagesAuthenticatorDuoUpdateError> = serde_json::from_str(&content).ok();
2551 Err(Error::ResponseError(ResponseContent {
2552 status,
2553 content,
2554 entity,
2555 }))
2556 }
2557}
2558
2559pub async fn stages_authenticator_duo_used_by_list(
2561 configuration: &configuration::Configuration,
2562 stage_uuid: &str,
2563) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorDuoUsedByListError>> {
2564 let p_path_stage_uuid = stage_uuid;
2566
2567 let uri_str = format!(
2568 "{}/stages/authenticator/duo/{stage_uuid}/used_by/",
2569 configuration.base_path,
2570 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2571 );
2572 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2573
2574 if let Some(ref user_agent) = configuration.user_agent {
2575 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2576 }
2577 if let Some(ref token) = configuration.bearer_access_token {
2578 req_builder = req_builder.bearer_auth(token.to_owned());
2579 };
2580
2581 let req = req_builder.build()?;
2582 let resp = configuration.client.execute(req).await?;
2583
2584 let status = resp.status();
2585 let content_type = resp
2586 .headers()
2587 .get("content-type")
2588 .and_then(|v| v.to_str().ok())
2589 .unwrap_or("application/octet-stream");
2590 let content_type = super::ContentType::from(content_type);
2591
2592 if !status.is_client_error() && !status.is_server_error() {
2593 let content = resp.text().await?;
2594 match content_type {
2595 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2596 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
2597 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>`")))),
2598 }
2599 } else {
2600 let content = resp.text().await?;
2601 let entity: Option<StagesAuthenticatorDuoUsedByListError> = serde_json::from_str(&content).ok();
2602 Err(Error::ResponseError(ResponseContent {
2603 status,
2604 content,
2605 entity,
2606 }))
2607 }
2608}
2609
2610pub async fn stages_authenticator_email_create(
2612 configuration: &configuration::Configuration,
2613 authenticator_email_stage_request: models::AuthenticatorEmailStageRequest,
2614) -> Result<models::AuthenticatorEmailStage, Error<StagesAuthenticatorEmailCreateError>> {
2615 let p_body_authenticator_email_stage_request = authenticator_email_stage_request;
2617
2618 let uri_str = format!("{}/stages/authenticator/email/", configuration.base_path);
2619 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2620
2621 if let Some(ref user_agent) = configuration.user_agent {
2622 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2623 }
2624 if let Some(ref token) = configuration.bearer_access_token {
2625 req_builder = req_builder.bearer_auth(token.to_owned());
2626 };
2627 req_builder = req_builder.json(&p_body_authenticator_email_stage_request);
2628
2629 let req = req_builder.build()?;
2630 let resp = configuration.client.execute(req).await?;
2631
2632 let status = resp.status();
2633 let content_type = resp
2634 .headers()
2635 .get("content-type")
2636 .and_then(|v| v.to_str().ok())
2637 .unwrap_or("application/octet-stream");
2638 let content_type = super::ContentType::from(content_type);
2639
2640 if !status.is_client_error() && !status.is_server_error() {
2641 let content = resp.text().await?;
2642 match content_type {
2643 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2644 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEmailStage`"))),
2645 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEmailStage`")))),
2646 }
2647 } else {
2648 let content = resp.text().await?;
2649 let entity: Option<StagesAuthenticatorEmailCreateError> = serde_json::from_str(&content).ok();
2650 Err(Error::ResponseError(ResponseContent {
2651 status,
2652 content,
2653 entity,
2654 }))
2655 }
2656}
2657
2658pub async fn stages_authenticator_email_destroy(
2660 configuration: &configuration::Configuration,
2661 stage_uuid: &str,
2662) -> Result<(), Error<StagesAuthenticatorEmailDestroyError>> {
2663 let p_path_stage_uuid = stage_uuid;
2665
2666 let uri_str = format!(
2667 "{}/stages/authenticator/email/{stage_uuid}/",
2668 configuration.base_path,
2669 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2670 );
2671 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2672
2673 if let Some(ref user_agent) = configuration.user_agent {
2674 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2675 }
2676 if let Some(ref token) = configuration.bearer_access_token {
2677 req_builder = req_builder.bearer_auth(token.to_owned());
2678 };
2679
2680 let req = req_builder.build()?;
2681 let resp = configuration.client.execute(req).await?;
2682
2683 let status = resp.status();
2684
2685 if !status.is_client_error() && !status.is_server_error() {
2686 Ok(())
2687 } else {
2688 let content = resp.text().await?;
2689 let entity: Option<StagesAuthenticatorEmailDestroyError> = serde_json::from_str(&content).ok();
2690 Err(Error::ResponseError(ResponseContent {
2691 status,
2692 content,
2693 entity,
2694 }))
2695 }
2696}
2697
2698pub async fn stages_authenticator_email_list(
2700 configuration: &configuration::Configuration,
2701 configure_flow: Option<&str>,
2702 friendly_name: Option<&str>,
2703 from_address: Option<&str>,
2704 host: Option<&str>,
2705 name: Option<&str>,
2706 ordering: Option<&str>,
2707 page: Option<i32>,
2708 page_size: Option<i32>,
2709 password: Option<&str>,
2710 port: Option<i32>,
2711 search: Option<&str>,
2712 stage_uuid: Option<&str>,
2713 subject: Option<&str>,
2714 template: Option<&str>,
2715 timeout: Option<i32>,
2716 token_expiry: Option<&str>,
2717 use_global_settings: Option<bool>,
2718 use_ssl: Option<bool>,
2719 use_tls: Option<bool>,
2720 username: Option<&str>,
2721) -> Result<models::PaginatedAuthenticatorEmailStageList, Error<StagesAuthenticatorEmailListError>> {
2722 let p_query_configure_flow = configure_flow;
2724 let p_query_friendly_name = friendly_name;
2725 let p_query_from_address = from_address;
2726 let p_query_host = host;
2727 let p_query_name = name;
2728 let p_query_ordering = ordering;
2729 let p_query_page = page;
2730 let p_query_page_size = page_size;
2731 let p_query_password = password;
2732 let p_query_port = port;
2733 let p_query_search = search;
2734 let p_query_stage_uuid = stage_uuid;
2735 let p_query_subject = subject;
2736 let p_query_template = template;
2737 let p_query_timeout = timeout;
2738 let p_query_token_expiry = token_expiry;
2739 let p_query_use_global_settings = use_global_settings;
2740 let p_query_use_ssl = use_ssl;
2741 let p_query_use_tls = use_tls;
2742 let p_query_username = username;
2743
2744 let uri_str = format!("{}/stages/authenticator/email/", configuration.base_path);
2745 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2746
2747 if let Some(ref param_value) = p_query_configure_flow {
2748 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
2749 }
2750 if let Some(ref param_value) = p_query_friendly_name {
2751 req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]);
2752 }
2753 if let Some(ref param_value) = p_query_from_address {
2754 req_builder = req_builder.query(&[("from_address", ¶m_value.to_string())]);
2755 }
2756 if let Some(ref param_value) = p_query_host {
2757 req_builder = req_builder.query(&[("host", ¶m_value.to_string())]);
2758 }
2759 if let Some(ref param_value) = p_query_name {
2760 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
2761 }
2762 if let Some(ref param_value) = p_query_ordering {
2763 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
2764 }
2765 if let Some(ref param_value) = p_query_page {
2766 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2767 }
2768 if let Some(ref param_value) = p_query_page_size {
2769 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
2770 }
2771 if let Some(ref param_value) = p_query_password {
2772 req_builder = req_builder.query(&[("password", ¶m_value.to_string())]);
2773 }
2774 if let Some(ref param_value) = p_query_port {
2775 req_builder = req_builder.query(&[("port", ¶m_value.to_string())]);
2776 }
2777 if let Some(ref param_value) = p_query_search {
2778 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
2779 }
2780 if let Some(ref param_value) = p_query_stage_uuid {
2781 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
2782 }
2783 if let Some(ref param_value) = p_query_subject {
2784 req_builder = req_builder.query(&[("subject", ¶m_value.to_string())]);
2785 }
2786 if let Some(ref param_value) = p_query_template {
2787 req_builder = req_builder.query(&[("template", ¶m_value.to_string())]);
2788 }
2789 if let Some(ref param_value) = p_query_timeout {
2790 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2791 }
2792 if let Some(ref param_value) = p_query_token_expiry {
2793 req_builder = req_builder.query(&[("token_expiry", ¶m_value.to_string())]);
2794 }
2795 if let Some(ref param_value) = p_query_use_global_settings {
2796 req_builder = req_builder.query(&[("use_global_settings", ¶m_value.to_string())]);
2797 }
2798 if let Some(ref param_value) = p_query_use_ssl {
2799 req_builder = req_builder.query(&[("use_ssl", ¶m_value.to_string())]);
2800 }
2801 if let Some(ref param_value) = p_query_use_tls {
2802 req_builder = req_builder.query(&[("use_tls", ¶m_value.to_string())]);
2803 }
2804 if let Some(ref param_value) = p_query_username {
2805 req_builder = req_builder.query(&[("username", ¶m_value.to_string())]);
2806 }
2807 if let Some(ref user_agent) = configuration.user_agent {
2808 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2809 }
2810 if let Some(ref token) = configuration.bearer_access_token {
2811 req_builder = req_builder.bearer_auth(token.to_owned());
2812 };
2813
2814 let req = req_builder.build()?;
2815 let resp = configuration.client.execute(req).await?;
2816
2817 let status = resp.status();
2818 let content_type = resp
2819 .headers()
2820 .get("content-type")
2821 .and_then(|v| v.to_str().ok())
2822 .unwrap_or("application/octet-stream");
2823 let content_type = super::ContentType::from(content_type);
2824
2825 if !status.is_client_error() && !status.is_server_error() {
2826 let content = resp.text().await?;
2827 match content_type {
2828 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2829 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorEmailStageList`"))),
2830 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorEmailStageList`")))),
2831 }
2832 } else {
2833 let content = resp.text().await?;
2834 let entity: Option<StagesAuthenticatorEmailListError> = serde_json::from_str(&content).ok();
2835 Err(Error::ResponseError(ResponseContent {
2836 status,
2837 content,
2838 entity,
2839 }))
2840 }
2841}
2842
2843pub async fn stages_authenticator_email_partial_update(
2845 configuration: &configuration::Configuration,
2846 stage_uuid: &str,
2847 patched_authenticator_email_stage_request: Option<models::PatchedAuthenticatorEmailStageRequest>,
2848) -> Result<models::AuthenticatorEmailStage, Error<StagesAuthenticatorEmailPartialUpdateError>> {
2849 let p_path_stage_uuid = stage_uuid;
2851 let p_body_patched_authenticator_email_stage_request = patched_authenticator_email_stage_request;
2852
2853 let uri_str = format!(
2854 "{}/stages/authenticator/email/{stage_uuid}/",
2855 configuration.base_path,
2856 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2857 );
2858 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2859
2860 if let Some(ref user_agent) = configuration.user_agent {
2861 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2862 }
2863 if let Some(ref token) = configuration.bearer_access_token {
2864 req_builder = req_builder.bearer_auth(token.to_owned());
2865 };
2866 req_builder = req_builder.json(&p_body_patched_authenticator_email_stage_request);
2867
2868 let req = req_builder.build()?;
2869 let resp = configuration.client.execute(req).await?;
2870
2871 let status = resp.status();
2872 let content_type = resp
2873 .headers()
2874 .get("content-type")
2875 .and_then(|v| v.to_str().ok())
2876 .unwrap_or("application/octet-stream");
2877 let content_type = super::ContentType::from(content_type);
2878
2879 if !status.is_client_error() && !status.is_server_error() {
2880 let content = resp.text().await?;
2881 match content_type {
2882 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2883 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEmailStage`"))),
2884 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEmailStage`")))),
2885 }
2886 } else {
2887 let content = resp.text().await?;
2888 let entity: Option<StagesAuthenticatorEmailPartialUpdateError> = serde_json::from_str(&content).ok();
2889 Err(Error::ResponseError(ResponseContent {
2890 status,
2891 content,
2892 entity,
2893 }))
2894 }
2895}
2896
2897pub async fn stages_authenticator_email_retrieve(
2899 configuration: &configuration::Configuration,
2900 stage_uuid: &str,
2901) -> Result<models::AuthenticatorEmailStage, Error<StagesAuthenticatorEmailRetrieveError>> {
2902 let p_path_stage_uuid = stage_uuid;
2904
2905 let uri_str = format!(
2906 "{}/stages/authenticator/email/{stage_uuid}/",
2907 configuration.base_path,
2908 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2909 );
2910 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2911
2912 if let Some(ref user_agent) = configuration.user_agent {
2913 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2914 }
2915 if let Some(ref token) = configuration.bearer_access_token {
2916 req_builder = req_builder.bearer_auth(token.to_owned());
2917 };
2918
2919 let req = req_builder.build()?;
2920 let resp = configuration.client.execute(req).await?;
2921
2922 let status = resp.status();
2923 let content_type = resp
2924 .headers()
2925 .get("content-type")
2926 .and_then(|v| v.to_str().ok())
2927 .unwrap_or("application/octet-stream");
2928 let content_type = super::ContentType::from(content_type);
2929
2930 if !status.is_client_error() && !status.is_server_error() {
2931 let content = resp.text().await?;
2932 match content_type {
2933 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2934 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEmailStage`"))),
2935 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEmailStage`")))),
2936 }
2937 } else {
2938 let content = resp.text().await?;
2939 let entity: Option<StagesAuthenticatorEmailRetrieveError> = serde_json::from_str(&content).ok();
2940 Err(Error::ResponseError(ResponseContent {
2941 status,
2942 content,
2943 entity,
2944 }))
2945 }
2946}
2947
2948pub async fn stages_authenticator_email_update(
2950 configuration: &configuration::Configuration,
2951 stage_uuid: &str,
2952 authenticator_email_stage_request: models::AuthenticatorEmailStageRequest,
2953) -> Result<models::AuthenticatorEmailStage, Error<StagesAuthenticatorEmailUpdateError>> {
2954 let p_path_stage_uuid = stage_uuid;
2956 let p_body_authenticator_email_stage_request = authenticator_email_stage_request;
2957
2958 let uri_str = format!(
2959 "{}/stages/authenticator/email/{stage_uuid}/",
2960 configuration.base_path,
2961 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
2962 );
2963 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2964
2965 if let Some(ref user_agent) = configuration.user_agent {
2966 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2967 }
2968 if let Some(ref token) = configuration.bearer_access_token {
2969 req_builder = req_builder.bearer_auth(token.to_owned());
2970 };
2971 req_builder = req_builder.json(&p_body_authenticator_email_stage_request);
2972
2973 let req = req_builder.build()?;
2974 let resp = configuration.client.execute(req).await?;
2975
2976 let status = resp.status();
2977 let content_type = resp
2978 .headers()
2979 .get("content-type")
2980 .and_then(|v| v.to_str().ok())
2981 .unwrap_or("application/octet-stream");
2982 let content_type = super::ContentType::from(content_type);
2983
2984 if !status.is_client_error() && !status.is_server_error() {
2985 let content = resp.text().await?;
2986 match content_type {
2987 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2988 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEmailStage`"))),
2989 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEmailStage`")))),
2990 }
2991 } else {
2992 let content = resp.text().await?;
2993 let entity: Option<StagesAuthenticatorEmailUpdateError> = serde_json::from_str(&content).ok();
2994 Err(Error::ResponseError(ResponseContent {
2995 status,
2996 content,
2997 entity,
2998 }))
2999 }
3000}
3001
3002pub async fn stages_authenticator_email_used_by_list(
3004 configuration: &configuration::Configuration,
3005 stage_uuid: &str,
3006) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorEmailUsedByListError>> {
3007 let p_path_stage_uuid = stage_uuid;
3009
3010 let uri_str = format!(
3011 "{}/stages/authenticator/email/{stage_uuid}/used_by/",
3012 configuration.base_path,
3013 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3014 );
3015 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3016
3017 if let Some(ref user_agent) = configuration.user_agent {
3018 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3019 }
3020 if let Some(ref token) = configuration.bearer_access_token {
3021 req_builder = req_builder.bearer_auth(token.to_owned());
3022 };
3023
3024 let req = req_builder.build()?;
3025 let resp = configuration.client.execute(req).await?;
3026
3027 let status = resp.status();
3028 let content_type = resp
3029 .headers()
3030 .get("content-type")
3031 .and_then(|v| v.to_str().ok())
3032 .unwrap_or("application/octet-stream");
3033 let content_type = super::ContentType::from(content_type);
3034
3035 if !status.is_client_error() && !status.is_server_error() {
3036 let content = resp.text().await?;
3037 match content_type {
3038 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3039 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
3040 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>`")))),
3041 }
3042 } else {
3043 let content = resp.text().await?;
3044 let entity: Option<StagesAuthenticatorEmailUsedByListError> = serde_json::from_str(&content).ok();
3045 Err(Error::ResponseError(ResponseContent {
3046 status,
3047 content,
3048 entity,
3049 }))
3050 }
3051}
3052
3053pub async fn stages_authenticator_endpoint_gdtc_create(
3055 configuration: &configuration::Configuration,
3056 authenticator_endpoint_gdtc_stage_request: models::AuthenticatorEndpointGdtcStageRequest,
3057) -> Result<models::AuthenticatorEndpointGdtcStage, Error<StagesAuthenticatorEndpointGdtcCreateError>> {
3058 let p_body_authenticator_endpoint_gdtc_stage_request = authenticator_endpoint_gdtc_stage_request;
3060
3061 let uri_str = format!("{}/stages/authenticator/endpoint_gdtc/", configuration.base_path);
3062 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3063
3064 if let Some(ref user_agent) = configuration.user_agent {
3065 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3066 }
3067 if let Some(ref token) = configuration.bearer_access_token {
3068 req_builder = req_builder.bearer_auth(token.to_owned());
3069 };
3070 req_builder = req_builder.json(&p_body_authenticator_endpoint_gdtc_stage_request);
3071
3072 let req = req_builder.build()?;
3073 let resp = configuration.client.execute(req).await?;
3074
3075 let status = resp.status();
3076 let content_type = resp
3077 .headers()
3078 .get("content-type")
3079 .and_then(|v| v.to_str().ok())
3080 .unwrap_or("application/octet-stream");
3081 let content_type = super::ContentType::from(content_type);
3082
3083 if !status.is_client_error() && !status.is_server_error() {
3084 let content = resp.text().await?;
3085 match content_type {
3086 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3087 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`"))),
3088 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`")))),
3089 }
3090 } else {
3091 let content = resp.text().await?;
3092 let entity: Option<StagesAuthenticatorEndpointGdtcCreateError> = serde_json::from_str(&content).ok();
3093 Err(Error::ResponseError(ResponseContent {
3094 status,
3095 content,
3096 entity,
3097 }))
3098 }
3099}
3100
3101pub async fn stages_authenticator_endpoint_gdtc_destroy(
3103 configuration: &configuration::Configuration,
3104 stage_uuid: &str,
3105) -> Result<(), Error<StagesAuthenticatorEndpointGdtcDestroyError>> {
3106 let p_path_stage_uuid = stage_uuid;
3108
3109 let uri_str = format!(
3110 "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/",
3111 configuration.base_path,
3112 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3113 );
3114 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3115
3116 if let Some(ref user_agent) = configuration.user_agent {
3117 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3118 }
3119 if let Some(ref token) = configuration.bearer_access_token {
3120 req_builder = req_builder.bearer_auth(token.to_owned());
3121 };
3122
3123 let req = req_builder.build()?;
3124 let resp = configuration.client.execute(req).await?;
3125
3126 let status = resp.status();
3127
3128 if !status.is_client_error() && !status.is_server_error() {
3129 Ok(())
3130 } else {
3131 let content = resp.text().await?;
3132 let entity: Option<StagesAuthenticatorEndpointGdtcDestroyError> = serde_json::from_str(&content).ok();
3133 Err(Error::ResponseError(ResponseContent {
3134 status,
3135 content,
3136 entity,
3137 }))
3138 }
3139}
3140
3141pub async fn stages_authenticator_endpoint_gdtc_list(
3143 configuration: &configuration::Configuration,
3144 configure_flow: Option<&str>,
3145 name: Option<&str>,
3146 ordering: Option<&str>,
3147 page: Option<i32>,
3148 page_size: Option<i32>,
3149 search: Option<&str>,
3150) -> Result<models::PaginatedAuthenticatorEndpointGdtcStageList, Error<StagesAuthenticatorEndpointGdtcListError>> {
3151 let p_query_configure_flow = configure_flow;
3153 let p_query_name = name;
3154 let p_query_ordering = ordering;
3155 let p_query_page = page;
3156 let p_query_page_size = page_size;
3157 let p_query_search = search;
3158
3159 let uri_str = format!("{}/stages/authenticator/endpoint_gdtc/", configuration.base_path);
3160 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3161
3162 if let Some(ref param_value) = p_query_configure_flow {
3163 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
3164 }
3165 if let Some(ref param_value) = p_query_name {
3166 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
3167 }
3168 if let Some(ref param_value) = p_query_ordering {
3169 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
3170 }
3171 if let Some(ref param_value) = p_query_page {
3172 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3173 }
3174 if let Some(ref param_value) = p_query_page_size {
3175 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
3176 }
3177 if let Some(ref param_value) = p_query_search {
3178 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
3179 }
3180 if let Some(ref user_agent) = configuration.user_agent {
3181 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3182 }
3183 if let Some(ref token) = configuration.bearer_access_token {
3184 req_builder = req_builder.bearer_auth(token.to_owned());
3185 };
3186
3187 let req = req_builder.build()?;
3188 let resp = configuration.client.execute(req).await?;
3189
3190 let status = resp.status();
3191 let content_type = resp
3192 .headers()
3193 .get("content-type")
3194 .and_then(|v| v.to_str().ok())
3195 .unwrap_or("application/octet-stream");
3196 let content_type = super::ContentType::from(content_type);
3197
3198 if !status.is_client_error() && !status.is_server_error() {
3199 let content = resp.text().await?;
3200 match content_type {
3201 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3202 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorEndpointGdtcStageList`"))),
3203 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorEndpointGdtcStageList`")))),
3204 }
3205 } else {
3206 let content = resp.text().await?;
3207 let entity: Option<StagesAuthenticatorEndpointGdtcListError> = serde_json::from_str(&content).ok();
3208 Err(Error::ResponseError(ResponseContent {
3209 status,
3210 content,
3211 entity,
3212 }))
3213 }
3214}
3215
3216pub async fn stages_authenticator_endpoint_gdtc_partial_update(
3218 configuration: &configuration::Configuration,
3219 stage_uuid: &str,
3220 patched_authenticator_endpoint_gdtc_stage_request: Option<models::PatchedAuthenticatorEndpointGdtcStageRequest>,
3221) -> Result<models::AuthenticatorEndpointGdtcStage, Error<StagesAuthenticatorEndpointGdtcPartialUpdateError>> {
3222 let p_path_stage_uuid = stage_uuid;
3224 let p_body_patched_authenticator_endpoint_gdtc_stage_request = patched_authenticator_endpoint_gdtc_stage_request;
3225
3226 let uri_str = format!(
3227 "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/",
3228 configuration.base_path,
3229 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3230 );
3231 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3232
3233 if let Some(ref user_agent) = configuration.user_agent {
3234 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3235 }
3236 if let Some(ref token) = configuration.bearer_access_token {
3237 req_builder = req_builder.bearer_auth(token.to_owned());
3238 };
3239 req_builder = req_builder.json(&p_body_patched_authenticator_endpoint_gdtc_stage_request);
3240
3241 let req = req_builder.build()?;
3242 let resp = configuration.client.execute(req).await?;
3243
3244 let status = resp.status();
3245 let content_type = resp
3246 .headers()
3247 .get("content-type")
3248 .and_then(|v| v.to_str().ok())
3249 .unwrap_or("application/octet-stream");
3250 let content_type = super::ContentType::from(content_type);
3251
3252 if !status.is_client_error() && !status.is_server_error() {
3253 let content = resp.text().await?;
3254 match content_type {
3255 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3256 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`"))),
3257 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`")))),
3258 }
3259 } else {
3260 let content = resp.text().await?;
3261 let entity: Option<StagesAuthenticatorEndpointGdtcPartialUpdateError> = serde_json::from_str(&content).ok();
3262 Err(Error::ResponseError(ResponseContent {
3263 status,
3264 content,
3265 entity,
3266 }))
3267 }
3268}
3269
3270pub async fn stages_authenticator_endpoint_gdtc_retrieve(
3272 configuration: &configuration::Configuration,
3273 stage_uuid: &str,
3274) -> Result<models::AuthenticatorEndpointGdtcStage, Error<StagesAuthenticatorEndpointGdtcRetrieveError>> {
3275 let p_path_stage_uuid = stage_uuid;
3277
3278 let uri_str = format!(
3279 "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/",
3280 configuration.base_path,
3281 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3282 );
3283 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3284
3285 if let Some(ref user_agent) = configuration.user_agent {
3286 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3287 }
3288 if let Some(ref token) = configuration.bearer_access_token {
3289 req_builder = req_builder.bearer_auth(token.to_owned());
3290 };
3291
3292 let req = req_builder.build()?;
3293 let resp = configuration.client.execute(req).await?;
3294
3295 let status = resp.status();
3296 let content_type = resp
3297 .headers()
3298 .get("content-type")
3299 .and_then(|v| v.to_str().ok())
3300 .unwrap_or("application/octet-stream");
3301 let content_type = super::ContentType::from(content_type);
3302
3303 if !status.is_client_error() && !status.is_server_error() {
3304 let content = resp.text().await?;
3305 match content_type {
3306 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3307 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`"))),
3308 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`")))),
3309 }
3310 } else {
3311 let content = resp.text().await?;
3312 let entity: Option<StagesAuthenticatorEndpointGdtcRetrieveError> = serde_json::from_str(&content).ok();
3313 Err(Error::ResponseError(ResponseContent {
3314 status,
3315 content,
3316 entity,
3317 }))
3318 }
3319}
3320
3321pub async fn stages_authenticator_endpoint_gdtc_update(
3323 configuration: &configuration::Configuration,
3324 stage_uuid: &str,
3325 authenticator_endpoint_gdtc_stage_request: models::AuthenticatorEndpointGdtcStageRequest,
3326) -> Result<models::AuthenticatorEndpointGdtcStage, Error<StagesAuthenticatorEndpointGdtcUpdateError>> {
3327 let p_path_stage_uuid = stage_uuid;
3329 let p_body_authenticator_endpoint_gdtc_stage_request = authenticator_endpoint_gdtc_stage_request;
3330
3331 let uri_str = format!(
3332 "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/",
3333 configuration.base_path,
3334 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3335 );
3336 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3337
3338 if let Some(ref user_agent) = configuration.user_agent {
3339 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3340 }
3341 if let Some(ref token) = configuration.bearer_access_token {
3342 req_builder = req_builder.bearer_auth(token.to_owned());
3343 };
3344 req_builder = req_builder.json(&p_body_authenticator_endpoint_gdtc_stage_request);
3345
3346 let req = req_builder.build()?;
3347 let resp = configuration.client.execute(req).await?;
3348
3349 let status = resp.status();
3350 let content_type = resp
3351 .headers()
3352 .get("content-type")
3353 .and_then(|v| v.to_str().ok())
3354 .unwrap_or("application/octet-stream");
3355 let content_type = super::ContentType::from(content_type);
3356
3357 if !status.is_client_error() && !status.is_server_error() {
3358 let content = resp.text().await?;
3359 match content_type {
3360 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3361 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`"))),
3362 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorEndpointGdtcStage`")))),
3363 }
3364 } else {
3365 let content = resp.text().await?;
3366 let entity: Option<StagesAuthenticatorEndpointGdtcUpdateError> = serde_json::from_str(&content).ok();
3367 Err(Error::ResponseError(ResponseContent {
3368 status,
3369 content,
3370 entity,
3371 }))
3372 }
3373}
3374
3375pub async fn stages_authenticator_endpoint_gdtc_used_by_list(
3377 configuration: &configuration::Configuration,
3378 stage_uuid: &str,
3379) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorEndpointGdtcUsedByListError>> {
3380 let p_path_stage_uuid = stage_uuid;
3382
3383 let uri_str = format!(
3384 "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/used_by/",
3385 configuration.base_path,
3386 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3387 );
3388 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3389
3390 if let Some(ref user_agent) = configuration.user_agent {
3391 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3392 }
3393 if let Some(ref token) = configuration.bearer_access_token {
3394 req_builder = req_builder.bearer_auth(token.to_owned());
3395 };
3396
3397 let req = req_builder.build()?;
3398 let resp = configuration.client.execute(req).await?;
3399
3400 let status = resp.status();
3401 let content_type = resp
3402 .headers()
3403 .get("content-type")
3404 .and_then(|v| v.to_str().ok())
3405 .unwrap_or("application/octet-stream");
3406 let content_type = super::ContentType::from(content_type);
3407
3408 if !status.is_client_error() && !status.is_server_error() {
3409 let content = resp.text().await?;
3410 match content_type {
3411 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3412 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
3413 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>`")))),
3414 }
3415 } else {
3416 let content = resp.text().await?;
3417 let entity: Option<StagesAuthenticatorEndpointGdtcUsedByListError> = serde_json::from_str(&content).ok();
3418 Err(Error::ResponseError(ResponseContent {
3419 status,
3420 content,
3421 entity,
3422 }))
3423 }
3424}
3425
3426pub async fn stages_authenticator_sms_create(
3428 configuration: &configuration::Configuration,
3429 authenticator_sms_stage_request: models::AuthenticatorSmsStageRequest,
3430) -> Result<models::AuthenticatorSmsStage, Error<StagesAuthenticatorSmsCreateError>> {
3431 let p_body_authenticator_sms_stage_request = authenticator_sms_stage_request;
3433
3434 let uri_str = format!("{}/stages/authenticator/sms/", configuration.base_path);
3435 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3436
3437 if let Some(ref user_agent) = configuration.user_agent {
3438 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3439 }
3440 if let Some(ref token) = configuration.bearer_access_token {
3441 req_builder = req_builder.bearer_auth(token.to_owned());
3442 };
3443 req_builder = req_builder.json(&p_body_authenticator_sms_stage_request);
3444
3445 let req = req_builder.build()?;
3446 let resp = configuration.client.execute(req).await?;
3447
3448 let status = resp.status();
3449 let content_type = resp
3450 .headers()
3451 .get("content-type")
3452 .and_then(|v| v.to_str().ok())
3453 .unwrap_or("application/octet-stream");
3454 let content_type = super::ContentType::from(content_type);
3455
3456 if !status.is_client_error() && !status.is_server_error() {
3457 let content = resp.text().await?;
3458 match content_type {
3459 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3460 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorSmsStage`"))),
3461 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorSmsStage`")))),
3462 }
3463 } else {
3464 let content = resp.text().await?;
3465 let entity: Option<StagesAuthenticatorSmsCreateError> = serde_json::from_str(&content).ok();
3466 Err(Error::ResponseError(ResponseContent {
3467 status,
3468 content,
3469 entity,
3470 }))
3471 }
3472}
3473
3474pub async fn stages_authenticator_sms_destroy(
3476 configuration: &configuration::Configuration,
3477 stage_uuid: &str,
3478) -> Result<(), Error<StagesAuthenticatorSmsDestroyError>> {
3479 let p_path_stage_uuid = stage_uuid;
3481
3482 let uri_str = format!(
3483 "{}/stages/authenticator/sms/{stage_uuid}/",
3484 configuration.base_path,
3485 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3486 );
3487 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3488
3489 if let Some(ref user_agent) = configuration.user_agent {
3490 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3491 }
3492 if let Some(ref token) = configuration.bearer_access_token {
3493 req_builder = req_builder.bearer_auth(token.to_owned());
3494 };
3495
3496 let req = req_builder.build()?;
3497 let resp = configuration.client.execute(req).await?;
3498
3499 let status = resp.status();
3500
3501 if !status.is_client_error() && !status.is_server_error() {
3502 Ok(())
3503 } else {
3504 let content = resp.text().await?;
3505 let entity: Option<StagesAuthenticatorSmsDestroyError> = serde_json::from_str(&content).ok();
3506 Err(Error::ResponseError(ResponseContent {
3507 status,
3508 content,
3509 entity,
3510 }))
3511 }
3512}
3513
3514pub async fn stages_authenticator_sms_list(
3516 configuration: &configuration::Configuration,
3517 account_sid: Option<&str>,
3518 auth: Option<&str>,
3519 auth_password: Option<&str>,
3520 auth_type: Option<&str>,
3521 configure_flow: Option<&str>,
3522 friendly_name: Option<&str>,
3523 from_number: Option<&str>,
3524 mapping: Option<&str>,
3525 name: Option<&str>,
3526 ordering: Option<&str>,
3527 page: Option<i32>,
3528 page_size: Option<i32>,
3529 provider: Option<&str>,
3530 search: Option<&str>,
3531 stage_uuid: Option<&str>,
3532 verify_only: Option<bool>,
3533) -> Result<models::PaginatedAuthenticatorSmsStageList, Error<StagesAuthenticatorSmsListError>> {
3534 let p_query_account_sid = account_sid;
3536 let p_query_auth = auth;
3537 let p_query_auth_password = auth_password;
3538 let p_query_auth_type = auth_type;
3539 let p_query_configure_flow = configure_flow;
3540 let p_query_friendly_name = friendly_name;
3541 let p_query_from_number = from_number;
3542 let p_query_mapping = mapping;
3543 let p_query_name = name;
3544 let p_query_ordering = ordering;
3545 let p_query_page = page;
3546 let p_query_page_size = page_size;
3547 let p_query_provider = provider;
3548 let p_query_search = search;
3549 let p_query_stage_uuid = stage_uuid;
3550 let p_query_verify_only = verify_only;
3551
3552 let uri_str = format!("{}/stages/authenticator/sms/", configuration.base_path);
3553 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3554
3555 if let Some(ref param_value) = p_query_account_sid {
3556 req_builder = req_builder.query(&[("account_sid", ¶m_value.to_string())]);
3557 }
3558 if let Some(ref param_value) = p_query_auth {
3559 req_builder = req_builder.query(&[("auth", ¶m_value.to_string())]);
3560 }
3561 if let Some(ref param_value) = p_query_auth_password {
3562 req_builder = req_builder.query(&[("auth_password", ¶m_value.to_string())]);
3563 }
3564 if let Some(ref param_value) = p_query_auth_type {
3565 req_builder = req_builder.query(&[("auth_type", ¶m_value.to_string())]);
3566 }
3567 if let Some(ref param_value) = p_query_configure_flow {
3568 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
3569 }
3570 if let Some(ref param_value) = p_query_friendly_name {
3571 req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]);
3572 }
3573 if let Some(ref param_value) = p_query_from_number {
3574 req_builder = req_builder.query(&[("from_number", ¶m_value.to_string())]);
3575 }
3576 if let Some(ref param_value) = p_query_mapping {
3577 req_builder = req_builder.query(&[("mapping", ¶m_value.to_string())]);
3578 }
3579 if let Some(ref param_value) = p_query_name {
3580 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
3581 }
3582 if let Some(ref param_value) = p_query_ordering {
3583 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
3584 }
3585 if let Some(ref param_value) = p_query_page {
3586 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3587 }
3588 if let Some(ref param_value) = p_query_page_size {
3589 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
3590 }
3591 if let Some(ref param_value) = p_query_provider {
3592 req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]);
3593 }
3594 if let Some(ref param_value) = p_query_search {
3595 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
3596 }
3597 if let Some(ref param_value) = p_query_stage_uuid {
3598 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
3599 }
3600 if let Some(ref param_value) = p_query_verify_only {
3601 req_builder = req_builder.query(&[("verify_only", ¶m_value.to_string())]);
3602 }
3603 if let Some(ref user_agent) = configuration.user_agent {
3604 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3605 }
3606 if let Some(ref token) = configuration.bearer_access_token {
3607 req_builder = req_builder.bearer_auth(token.to_owned());
3608 };
3609
3610 let req = req_builder.build()?;
3611 let resp = configuration.client.execute(req).await?;
3612
3613 let status = resp.status();
3614 let content_type = resp
3615 .headers()
3616 .get("content-type")
3617 .and_then(|v| v.to_str().ok())
3618 .unwrap_or("application/octet-stream");
3619 let content_type = super::ContentType::from(content_type);
3620
3621 if !status.is_client_error() && !status.is_server_error() {
3622 let content = resp.text().await?;
3623 match content_type {
3624 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3625 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorSmsStageList`"))),
3626 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorSmsStageList`")))),
3627 }
3628 } else {
3629 let content = resp.text().await?;
3630 let entity: Option<StagesAuthenticatorSmsListError> = serde_json::from_str(&content).ok();
3631 Err(Error::ResponseError(ResponseContent {
3632 status,
3633 content,
3634 entity,
3635 }))
3636 }
3637}
3638
3639pub async fn stages_authenticator_sms_partial_update(
3641 configuration: &configuration::Configuration,
3642 stage_uuid: &str,
3643 patched_authenticator_sms_stage_request: Option<models::PatchedAuthenticatorSmsStageRequest>,
3644) -> Result<models::AuthenticatorSmsStage, Error<StagesAuthenticatorSmsPartialUpdateError>> {
3645 let p_path_stage_uuid = stage_uuid;
3647 let p_body_patched_authenticator_sms_stage_request = patched_authenticator_sms_stage_request;
3648
3649 let uri_str = format!(
3650 "{}/stages/authenticator/sms/{stage_uuid}/",
3651 configuration.base_path,
3652 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3653 );
3654 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3655
3656 if let Some(ref user_agent) = configuration.user_agent {
3657 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3658 }
3659 if let Some(ref token) = configuration.bearer_access_token {
3660 req_builder = req_builder.bearer_auth(token.to_owned());
3661 };
3662 req_builder = req_builder.json(&p_body_patched_authenticator_sms_stage_request);
3663
3664 let req = req_builder.build()?;
3665 let resp = configuration.client.execute(req).await?;
3666
3667 let status = resp.status();
3668 let content_type = resp
3669 .headers()
3670 .get("content-type")
3671 .and_then(|v| v.to_str().ok())
3672 .unwrap_or("application/octet-stream");
3673 let content_type = super::ContentType::from(content_type);
3674
3675 if !status.is_client_error() && !status.is_server_error() {
3676 let content = resp.text().await?;
3677 match content_type {
3678 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3679 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorSmsStage`"))),
3680 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorSmsStage`")))),
3681 }
3682 } else {
3683 let content = resp.text().await?;
3684 let entity: Option<StagesAuthenticatorSmsPartialUpdateError> = serde_json::from_str(&content).ok();
3685 Err(Error::ResponseError(ResponseContent {
3686 status,
3687 content,
3688 entity,
3689 }))
3690 }
3691}
3692
3693pub async fn stages_authenticator_sms_retrieve(
3695 configuration: &configuration::Configuration,
3696 stage_uuid: &str,
3697) -> Result<models::AuthenticatorSmsStage, Error<StagesAuthenticatorSmsRetrieveError>> {
3698 let p_path_stage_uuid = stage_uuid;
3700
3701 let uri_str = format!(
3702 "{}/stages/authenticator/sms/{stage_uuid}/",
3703 configuration.base_path,
3704 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3705 );
3706 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3707
3708 if let Some(ref user_agent) = configuration.user_agent {
3709 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3710 }
3711 if let Some(ref token) = configuration.bearer_access_token {
3712 req_builder = req_builder.bearer_auth(token.to_owned());
3713 };
3714
3715 let req = req_builder.build()?;
3716 let resp = configuration.client.execute(req).await?;
3717
3718 let status = resp.status();
3719 let content_type = resp
3720 .headers()
3721 .get("content-type")
3722 .and_then(|v| v.to_str().ok())
3723 .unwrap_or("application/octet-stream");
3724 let content_type = super::ContentType::from(content_type);
3725
3726 if !status.is_client_error() && !status.is_server_error() {
3727 let content = resp.text().await?;
3728 match content_type {
3729 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3730 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorSmsStage`"))),
3731 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorSmsStage`")))),
3732 }
3733 } else {
3734 let content = resp.text().await?;
3735 let entity: Option<StagesAuthenticatorSmsRetrieveError> = serde_json::from_str(&content).ok();
3736 Err(Error::ResponseError(ResponseContent {
3737 status,
3738 content,
3739 entity,
3740 }))
3741 }
3742}
3743
3744pub async fn stages_authenticator_sms_update(
3746 configuration: &configuration::Configuration,
3747 stage_uuid: &str,
3748 authenticator_sms_stage_request: models::AuthenticatorSmsStageRequest,
3749) -> Result<models::AuthenticatorSmsStage, Error<StagesAuthenticatorSmsUpdateError>> {
3750 let p_path_stage_uuid = stage_uuid;
3752 let p_body_authenticator_sms_stage_request = authenticator_sms_stage_request;
3753
3754 let uri_str = format!(
3755 "{}/stages/authenticator/sms/{stage_uuid}/",
3756 configuration.base_path,
3757 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3758 );
3759 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3760
3761 if let Some(ref user_agent) = configuration.user_agent {
3762 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3763 }
3764 if let Some(ref token) = configuration.bearer_access_token {
3765 req_builder = req_builder.bearer_auth(token.to_owned());
3766 };
3767 req_builder = req_builder.json(&p_body_authenticator_sms_stage_request);
3768
3769 let req = req_builder.build()?;
3770 let resp = configuration.client.execute(req).await?;
3771
3772 let status = resp.status();
3773 let content_type = resp
3774 .headers()
3775 .get("content-type")
3776 .and_then(|v| v.to_str().ok())
3777 .unwrap_or("application/octet-stream");
3778 let content_type = super::ContentType::from(content_type);
3779
3780 if !status.is_client_error() && !status.is_server_error() {
3781 let content = resp.text().await?;
3782 match content_type {
3783 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3784 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorSmsStage`"))),
3785 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorSmsStage`")))),
3786 }
3787 } else {
3788 let content = resp.text().await?;
3789 let entity: Option<StagesAuthenticatorSmsUpdateError> = serde_json::from_str(&content).ok();
3790 Err(Error::ResponseError(ResponseContent {
3791 status,
3792 content,
3793 entity,
3794 }))
3795 }
3796}
3797
3798pub async fn stages_authenticator_sms_used_by_list(
3800 configuration: &configuration::Configuration,
3801 stage_uuid: &str,
3802) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorSmsUsedByListError>> {
3803 let p_path_stage_uuid = stage_uuid;
3805
3806 let uri_str = format!(
3807 "{}/stages/authenticator/sms/{stage_uuid}/used_by/",
3808 configuration.base_path,
3809 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3810 );
3811 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3812
3813 if let Some(ref user_agent) = configuration.user_agent {
3814 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3815 }
3816 if let Some(ref token) = configuration.bearer_access_token {
3817 req_builder = req_builder.bearer_auth(token.to_owned());
3818 };
3819
3820 let req = req_builder.build()?;
3821 let resp = configuration.client.execute(req).await?;
3822
3823 let status = resp.status();
3824 let content_type = resp
3825 .headers()
3826 .get("content-type")
3827 .and_then(|v| v.to_str().ok())
3828 .unwrap_or("application/octet-stream");
3829 let content_type = super::ContentType::from(content_type);
3830
3831 if !status.is_client_error() && !status.is_server_error() {
3832 let content = resp.text().await?;
3833 match content_type {
3834 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3835 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
3836 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>`")))),
3837 }
3838 } else {
3839 let content = resp.text().await?;
3840 let entity: Option<StagesAuthenticatorSmsUsedByListError> = serde_json::from_str(&content).ok();
3841 Err(Error::ResponseError(ResponseContent {
3842 status,
3843 content,
3844 entity,
3845 }))
3846 }
3847}
3848
3849pub async fn stages_authenticator_static_create(
3851 configuration: &configuration::Configuration,
3852 authenticator_static_stage_request: models::AuthenticatorStaticStageRequest,
3853) -> Result<models::AuthenticatorStaticStage, Error<StagesAuthenticatorStaticCreateError>> {
3854 let p_body_authenticator_static_stage_request = authenticator_static_stage_request;
3856
3857 let uri_str = format!("{}/stages/authenticator/static/", configuration.base_path);
3858 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3859
3860 if let Some(ref user_agent) = configuration.user_agent {
3861 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3862 }
3863 if let Some(ref token) = configuration.bearer_access_token {
3864 req_builder = req_builder.bearer_auth(token.to_owned());
3865 };
3866 req_builder = req_builder.json(&p_body_authenticator_static_stage_request);
3867
3868 let req = req_builder.build()?;
3869 let resp = configuration.client.execute(req).await?;
3870
3871 let status = resp.status();
3872 let content_type = resp
3873 .headers()
3874 .get("content-type")
3875 .and_then(|v| v.to_str().ok())
3876 .unwrap_or("application/octet-stream");
3877 let content_type = super::ContentType::from(content_type);
3878
3879 if !status.is_client_error() && !status.is_server_error() {
3880 let content = resp.text().await?;
3881 match content_type {
3882 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3883 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorStaticStage`"))),
3884 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorStaticStage`")))),
3885 }
3886 } else {
3887 let content = resp.text().await?;
3888 let entity: Option<StagesAuthenticatorStaticCreateError> = serde_json::from_str(&content).ok();
3889 Err(Error::ResponseError(ResponseContent {
3890 status,
3891 content,
3892 entity,
3893 }))
3894 }
3895}
3896
3897pub async fn stages_authenticator_static_destroy(
3899 configuration: &configuration::Configuration,
3900 stage_uuid: &str,
3901) -> Result<(), Error<StagesAuthenticatorStaticDestroyError>> {
3902 let p_path_stage_uuid = stage_uuid;
3904
3905 let uri_str = format!(
3906 "{}/stages/authenticator/static/{stage_uuid}/",
3907 configuration.base_path,
3908 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
3909 );
3910 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3911
3912 if let Some(ref user_agent) = configuration.user_agent {
3913 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3914 }
3915 if let Some(ref token) = configuration.bearer_access_token {
3916 req_builder = req_builder.bearer_auth(token.to_owned());
3917 };
3918
3919 let req = req_builder.build()?;
3920 let resp = configuration.client.execute(req).await?;
3921
3922 let status = resp.status();
3923
3924 if !status.is_client_error() && !status.is_server_error() {
3925 Ok(())
3926 } else {
3927 let content = resp.text().await?;
3928 let entity: Option<StagesAuthenticatorStaticDestroyError> = serde_json::from_str(&content).ok();
3929 Err(Error::ResponseError(ResponseContent {
3930 status,
3931 content,
3932 entity,
3933 }))
3934 }
3935}
3936
3937pub async fn stages_authenticator_static_list(
3939 configuration: &configuration::Configuration,
3940 configure_flow: Option<&str>,
3941 friendly_name: Option<&str>,
3942 name: Option<&str>,
3943 ordering: Option<&str>,
3944 page: Option<i32>,
3945 page_size: Option<i32>,
3946 search: Option<&str>,
3947 stage_uuid: Option<&str>,
3948 token_count: Option<i32>,
3949 token_length: Option<i32>,
3950) -> Result<models::PaginatedAuthenticatorStaticStageList, Error<StagesAuthenticatorStaticListError>> {
3951 let p_query_configure_flow = configure_flow;
3953 let p_query_friendly_name = friendly_name;
3954 let p_query_name = name;
3955 let p_query_ordering = ordering;
3956 let p_query_page = page;
3957 let p_query_page_size = page_size;
3958 let p_query_search = search;
3959 let p_query_stage_uuid = stage_uuid;
3960 let p_query_token_count = token_count;
3961 let p_query_token_length = token_length;
3962
3963 let uri_str = format!("{}/stages/authenticator/static/", configuration.base_path);
3964 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3965
3966 if let Some(ref param_value) = p_query_configure_flow {
3967 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
3968 }
3969 if let Some(ref param_value) = p_query_friendly_name {
3970 req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]);
3971 }
3972 if let Some(ref param_value) = p_query_name {
3973 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
3974 }
3975 if let Some(ref param_value) = p_query_ordering {
3976 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
3977 }
3978 if let Some(ref param_value) = p_query_page {
3979 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3980 }
3981 if let Some(ref param_value) = p_query_page_size {
3982 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
3983 }
3984 if let Some(ref param_value) = p_query_search {
3985 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
3986 }
3987 if let Some(ref param_value) = p_query_stage_uuid {
3988 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
3989 }
3990 if let Some(ref param_value) = p_query_token_count {
3991 req_builder = req_builder.query(&[("token_count", ¶m_value.to_string())]);
3992 }
3993 if let Some(ref param_value) = p_query_token_length {
3994 req_builder = req_builder.query(&[("token_length", ¶m_value.to_string())]);
3995 }
3996 if let Some(ref user_agent) = configuration.user_agent {
3997 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3998 }
3999 if let Some(ref token) = configuration.bearer_access_token {
4000 req_builder = req_builder.bearer_auth(token.to_owned());
4001 };
4002
4003 let req = req_builder.build()?;
4004 let resp = configuration.client.execute(req).await?;
4005
4006 let status = resp.status();
4007 let content_type = resp
4008 .headers()
4009 .get("content-type")
4010 .and_then(|v| v.to_str().ok())
4011 .unwrap_or("application/octet-stream");
4012 let content_type = super::ContentType::from(content_type);
4013
4014 if !status.is_client_error() && !status.is_server_error() {
4015 let content = resp.text().await?;
4016 match content_type {
4017 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4018 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorStaticStageList`"))),
4019 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorStaticStageList`")))),
4020 }
4021 } else {
4022 let content = resp.text().await?;
4023 let entity: Option<StagesAuthenticatorStaticListError> = serde_json::from_str(&content).ok();
4024 Err(Error::ResponseError(ResponseContent {
4025 status,
4026 content,
4027 entity,
4028 }))
4029 }
4030}
4031
4032pub async fn stages_authenticator_static_partial_update(
4034 configuration: &configuration::Configuration,
4035 stage_uuid: &str,
4036 patched_authenticator_static_stage_request: Option<models::PatchedAuthenticatorStaticStageRequest>,
4037) -> Result<models::AuthenticatorStaticStage, Error<StagesAuthenticatorStaticPartialUpdateError>> {
4038 let p_path_stage_uuid = stage_uuid;
4040 let p_body_patched_authenticator_static_stage_request = patched_authenticator_static_stage_request;
4041
4042 let uri_str = format!(
4043 "{}/stages/authenticator/static/{stage_uuid}/",
4044 configuration.base_path,
4045 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4046 );
4047 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4048
4049 if let Some(ref user_agent) = configuration.user_agent {
4050 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4051 }
4052 if let Some(ref token) = configuration.bearer_access_token {
4053 req_builder = req_builder.bearer_auth(token.to_owned());
4054 };
4055 req_builder = req_builder.json(&p_body_patched_authenticator_static_stage_request);
4056
4057 let req = req_builder.build()?;
4058 let resp = configuration.client.execute(req).await?;
4059
4060 let status = resp.status();
4061 let content_type = resp
4062 .headers()
4063 .get("content-type")
4064 .and_then(|v| v.to_str().ok())
4065 .unwrap_or("application/octet-stream");
4066 let content_type = super::ContentType::from(content_type);
4067
4068 if !status.is_client_error() && !status.is_server_error() {
4069 let content = resp.text().await?;
4070 match content_type {
4071 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4072 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorStaticStage`"))),
4073 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorStaticStage`")))),
4074 }
4075 } else {
4076 let content = resp.text().await?;
4077 let entity: Option<StagesAuthenticatorStaticPartialUpdateError> = serde_json::from_str(&content).ok();
4078 Err(Error::ResponseError(ResponseContent {
4079 status,
4080 content,
4081 entity,
4082 }))
4083 }
4084}
4085
4086pub async fn stages_authenticator_static_retrieve(
4088 configuration: &configuration::Configuration,
4089 stage_uuid: &str,
4090) -> Result<models::AuthenticatorStaticStage, Error<StagesAuthenticatorStaticRetrieveError>> {
4091 let p_path_stage_uuid = stage_uuid;
4093
4094 let uri_str = format!(
4095 "{}/stages/authenticator/static/{stage_uuid}/",
4096 configuration.base_path,
4097 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4098 );
4099 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4100
4101 if let Some(ref user_agent) = configuration.user_agent {
4102 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4103 }
4104 if let Some(ref token) = configuration.bearer_access_token {
4105 req_builder = req_builder.bearer_auth(token.to_owned());
4106 };
4107
4108 let req = req_builder.build()?;
4109 let resp = configuration.client.execute(req).await?;
4110
4111 let status = resp.status();
4112 let content_type = resp
4113 .headers()
4114 .get("content-type")
4115 .and_then(|v| v.to_str().ok())
4116 .unwrap_or("application/octet-stream");
4117 let content_type = super::ContentType::from(content_type);
4118
4119 if !status.is_client_error() && !status.is_server_error() {
4120 let content = resp.text().await?;
4121 match content_type {
4122 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4123 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorStaticStage`"))),
4124 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorStaticStage`")))),
4125 }
4126 } else {
4127 let content = resp.text().await?;
4128 let entity: Option<StagesAuthenticatorStaticRetrieveError> = serde_json::from_str(&content).ok();
4129 Err(Error::ResponseError(ResponseContent {
4130 status,
4131 content,
4132 entity,
4133 }))
4134 }
4135}
4136
4137pub async fn stages_authenticator_static_update(
4139 configuration: &configuration::Configuration,
4140 stage_uuid: &str,
4141 authenticator_static_stage_request: models::AuthenticatorStaticStageRequest,
4142) -> Result<models::AuthenticatorStaticStage, Error<StagesAuthenticatorStaticUpdateError>> {
4143 let p_path_stage_uuid = stage_uuid;
4145 let p_body_authenticator_static_stage_request = authenticator_static_stage_request;
4146
4147 let uri_str = format!(
4148 "{}/stages/authenticator/static/{stage_uuid}/",
4149 configuration.base_path,
4150 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4151 );
4152 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4153
4154 if let Some(ref user_agent) = configuration.user_agent {
4155 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4156 }
4157 if let Some(ref token) = configuration.bearer_access_token {
4158 req_builder = req_builder.bearer_auth(token.to_owned());
4159 };
4160 req_builder = req_builder.json(&p_body_authenticator_static_stage_request);
4161
4162 let req = req_builder.build()?;
4163 let resp = configuration.client.execute(req).await?;
4164
4165 let status = resp.status();
4166 let content_type = resp
4167 .headers()
4168 .get("content-type")
4169 .and_then(|v| v.to_str().ok())
4170 .unwrap_or("application/octet-stream");
4171 let content_type = super::ContentType::from(content_type);
4172
4173 if !status.is_client_error() && !status.is_server_error() {
4174 let content = resp.text().await?;
4175 match content_type {
4176 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4177 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorStaticStage`"))),
4178 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorStaticStage`")))),
4179 }
4180 } else {
4181 let content = resp.text().await?;
4182 let entity: Option<StagesAuthenticatorStaticUpdateError> = serde_json::from_str(&content).ok();
4183 Err(Error::ResponseError(ResponseContent {
4184 status,
4185 content,
4186 entity,
4187 }))
4188 }
4189}
4190
4191pub async fn stages_authenticator_static_used_by_list(
4193 configuration: &configuration::Configuration,
4194 stage_uuid: &str,
4195) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorStaticUsedByListError>> {
4196 let p_path_stage_uuid = stage_uuid;
4198
4199 let uri_str = format!(
4200 "{}/stages/authenticator/static/{stage_uuid}/used_by/",
4201 configuration.base_path,
4202 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4203 );
4204 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4205
4206 if let Some(ref user_agent) = configuration.user_agent {
4207 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4208 }
4209 if let Some(ref token) = configuration.bearer_access_token {
4210 req_builder = req_builder.bearer_auth(token.to_owned());
4211 };
4212
4213 let req = req_builder.build()?;
4214 let resp = configuration.client.execute(req).await?;
4215
4216 let status = resp.status();
4217 let content_type = resp
4218 .headers()
4219 .get("content-type")
4220 .and_then(|v| v.to_str().ok())
4221 .unwrap_or("application/octet-stream");
4222 let content_type = super::ContentType::from(content_type);
4223
4224 if !status.is_client_error() && !status.is_server_error() {
4225 let content = resp.text().await?;
4226 match content_type {
4227 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4228 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
4229 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>`")))),
4230 }
4231 } else {
4232 let content = resp.text().await?;
4233 let entity: Option<StagesAuthenticatorStaticUsedByListError> = serde_json::from_str(&content).ok();
4234 Err(Error::ResponseError(ResponseContent {
4235 status,
4236 content,
4237 entity,
4238 }))
4239 }
4240}
4241
4242pub async fn stages_authenticator_totp_create(
4244 configuration: &configuration::Configuration,
4245 authenticator_totp_stage_request: models::AuthenticatorTotpStageRequest,
4246) -> Result<models::AuthenticatorTotpStage, Error<StagesAuthenticatorTotpCreateError>> {
4247 let p_body_authenticator_totp_stage_request = authenticator_totp_stage_request;
4249
4250 let uri_str = format!("{}/stages/authenticator/totp/", configuration.base_path);
4251 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4252
4253 if let Some(ref user_agent) = configuration.user_agent {
4254 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4255 }
4256 if let Some(ref token) = configuration.bearer_access_token {
4257 req_builder = req_builder.bearer_auth(token.to_owned());
4258 };
4259 req_builder = req_builder.json(&p_body_authenticator_totp_stage_request);
4260
4261 let req = req_builder.build()?;
4262 let resp = configuration.client.execute(req).await?;
4263
4264 let status = resp.status();
4265 let content_type = resp
4266 .headers()
4267 .get("content-type")
4268 .and_then(|v| v.to_str().ok())
4269 .unwrap_or("application/octet-stream");
4270 let content_type = super::ContentType::from(content_type);
4271
4272 if !status.is_client_error() && !status.is_server_error() {
4273 let content = resp.text().await?;
4274 match content_type {
4275 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4276 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorTotpStage`"))),
4277 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorTotpStage`")))),
4278 }
4279 } else {
4280 let content = resp.text().await?;
4281 let entity: Option<StagesAuthenticatorTotpCreateError> = serde_json::from_str(&content).ok();
4282 Err(Error::ResponseError(ResponseContent {
4283 status,
4284 content,
4285 entity,
4286 }))
4287 }
4288}
4289
4290pub async fn stages_authenticator_totp_destroy(
4292 configuration: &configuration::Configuration,
4293 stage_uuid: &str,
4294) -> Result<(), Error<StagesAuthenticatorTotpDestroyError>> {
4295 let p_path_stage_uuid = stage_uuid;
4297
4298 let uri_str = format!(
4299 "{}/stages/authenticator/totp/{stage_uuid}/",
4300 configuration.base_path,
4301 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4302 );
4303 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4304
4305 if let Some(ref user_agent) = configuration.user_agent {
4306 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4307 }
4308 if let Some(ref token) = configuration.bearer_access_token {
4309 req_builder = req_builder.bearer_auth(token.to_owned());
4310 };
4311
4312 let req = req_builder.build()?;
4313 let resp = configuration.client.execute(req).await?;
4314
4315 let status = resp.status();
4316
4317 if !status.is_client_error() && !status.is_server_error() {
4318 Ok(())
4319 } else {
4320 let content = resp.text().await?;
4321 let entity: Option<StagesAuthenticatorTotpDestroyError> = serde_json::from_str(&content).ok();
4322 Err(Error::ResponseError(ResponseContent {
4323 status,
4324 content,
4325 entity,
4326 }))
4327 }
4328}
4329
4330pub async fn stages_authenticator_totp_list(
4332 configuration: &configuration::Configuration,
4333 configure_flow: Option<&str>,
4334 digits: Option<&str>,
4335 friendly_name: Option<&str>,
4336 name: Option<&str>,
4337 ordering: Option<&str>,
4338 page: Option<i32>,
4339 page_size: Option<i32>,
4340 search: Option<&str>,
4341 stage_uuid: Option<&str>,
4342) -> Result<models::PaginatedAuthenticatorTotpStageList, Error<StagesAuthenticatorTotpListError>> {
4343 let p_query_configure_flow = configure_flow;
4345 let p_query_digits = digits;
4346 let p_query_friendly_name = friendly_name;
4347 let p_query_name = name;
4348 let p_query_ordering = ordering;
4349 let p_query_page = page;
4350 let p_query_page_size = page_size;
4351 let p_query_search = search;
4352 let p_query_stage_uuid = stage_uuid;
4353
4354 let uri_str = format!("{}/stages/authenticator/totp/", configuration.base_path);
4355 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4356
4357 if let Some(ref param_value) = p_query_configure_flow {
4358 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
4359 }
4360 if let Some(ref param_value) = p_query_digits {
4361 req_builder = req_builder.query(&[("digits", ¶m_value.to_string())]);
4362 }
4363 if let Some(ref param_value) = p_query_friendly_name {
4364 req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]);
4365 }
4366 if let Some(ref param_value) = p_query_name {
4367 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
4368 }
4369 if let Some(ref param_value) = p_query_ordering {
4370 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
4371 }
4372 if let Some(ref param_value) = p_query_page {
4373 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
4374 }
4375 if let Some(ref param_value) = p_query_page_size {
4376 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
4377 }
4378 if let Some(ref param_value) = p_query_search {
4379 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
4380 }
4381 if let Some(ref param_value) = p_query_stage_uuid {
4382 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
4383 }
4384 if let Some(ref user_agent) = configuration.user_agent {
4385 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4386 }
4387 if let Some(ref token) = configuration.bearer_access_token {
4388 req_builder = req_builder.bearer_auth(token.to_owned());
4389 };
4390
4391 let req = req_builder.build()?;
4392 let resp = configuration.client.execute(req).await?;
4393
4394 let status = resp.status();
4395 let content_type = resp
4396 .headers()
4397 .get("content-type")
4398 .and_then(|v| v.to_str().ok())
4399 .unwrap_or("application/octet-stream");
4400 let content_type = super::ContentType::from(content_type);
4401
4402 if !status.is_client_error() && !status.is_server_error() {
4403 let content = resp.text().await?;
4404 match content_type {
4405 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4406 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorTotpStageList`"))),
4407 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorTotpStageList`")))),
4408 }
4409 } else {
4410 let content = resp.text().await?;
4411 let entity: Option<StagesAuthenticatorTotpListError> = serde_json::from_str(&content).ok();
4412 Err(Error::ResponseError(ResponseContent {
4413 status,
4414 content,
4415 entity,
4416 }))
4417 }
4418}
4419
4420pub async fn stages_authenticator_totp_partial_update(
4422 configuration: &configuration::Configuration,
4423 stage_uuid: &str,
4424 patched_authenticator_totp_stage_request: Option<models::PatchedAuthenticatorTotpStageRequest>,
4425) -> Result<models::AuthenticatorTotpStage, Error<StagesAuthenticatorTotpPartialUpdateError>> {
4426 let p_path_stage_uuid = stage_uuid;
4428 let p_body_patched_authenticator_totp_stage_request = patched_authenticator_totp_stage_request;
4429
4430 let uri_str = format!(
4431 "{}/stages/authenticator/totp/{stage_uuid}/",
4432 configuration.base_path,
4433 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4434 );
4435 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4436
4437 if let Some(ref user_agent) = configuration.user_agent {
4438 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4439 }
4440 if let Some(ref token) = configuration.bearer_access_token {
4441 req_builder = req_builder.bearer_auth(token.to_owned());
4442 };
4443 req_builder = req_builder.json(&p_body_patched_authenticator_totp_stage_request);
4444
4445 let req = req_builder.build()?;
4446 let resp = configuration.client.execute(req).await?;
4447
4448 let status = resp.status();
4449 let content_type = resp
4450 .headers()
4451 .get("content-type")
4452 .and_then(|v| v.to_str().ok())
4453 .unwrap_or("application/octet-stream");
4454 let content_type = super::ContentType::from(content_type);
4455
4456 if !status.is_client_error() && !status.is_server_error() {
4457 let content = resp.text().await?;
4458 match content_type {
4459 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4460 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorTotpStage`"))),
4461 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorTotpStage`")))),
4462 }
4463 } else {
4464 let content = resp.text().await?;
4465 let entity: Option<StagesAuthenticatorTotpPartialUpdateError> = serde_json::from_str(&content).ok();
4466 Err(Error::ResponseError(ResponseContent {
4467 status,
4468 content,
4469 entity,
4470 }))
4471 }
4472}
4473
4474pub async fn stages_authenticator_totp_retrieve(
4476 configuration: &configuration::Configuration,
4477 stage_uuid: &str,
4478) -> Result<models::AuthenticatorTotpStage, Error<StagesAuthenticatorTotpRetrieveError>> {
4479 let p_path_stage_uuid = stage_uuid;
4481
4482 let uri_str = format!(
4483 "{}/stages/authenticator/totp/{stage_uuid}/",
4484 configuration.base_path,
4485 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4486 );
4487 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4488
4489 if let Some(ref user_agent) = configuration.user_agent {
4490 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4491 }
4492 if let Some(ref token) = configuration.bearer_access_token {
4493 req_builder = req_builder.bearer_auth(token.to_owned());
4494 };
4495
4496 let req = req_builder.build()?;
4497 let resp = configuration.client.execute(req).await?;
4498
4499 let status = resp.status();
4500 let content_type = resp
4501 .headers()
4502 .get("content-type")
4503 .and_then(|v| v.to_str().ok())
4504 .unwrap_or("application/octet-stream");
4505 let content_type = super::ContentType::from(content_type);
4506
4507 if !status.is_client_error() && !status.is_server_error() {
4508 let content = resp.text().await?;
4509 match content_type {
4510 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4511 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorTotpStage`"))),
4512 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorTotpStage`")))),
4513 }
4514 } else {
4515 let content = resp.text().await?;
4516 let entity: Option<StagesAuthenticatorTotpRetrieveError> = serde_json::from_str(&content).ok();
4517 Err(Error::ResponseError(ResponseContent {
4518 status,
4519 content,
4520 entity,
4521 }))
4522 }
4523}
4524
4525pub async fn stages_authenticator_totp_update(
4527 configuration: &configuration::Configuration,
4528 stage_uuid: &str,
4529 authenticator_totp_stage_request: models::AuthenticatorTotpStageRequest,
4530) -> Result<models::AuthenticatorTotpStage, Error<StagesAuthenticatorTotpUpdateError>> {
4531 let p_path_stage_uuid = stage_uuid;
4533 let p_body_authenticator_totp_stage_request = authenticator_totp_stage_request;
4534
4535 let uri_str = format!(
4536 "{}/stages/authenticator/totp/{stage_uuid}/",
4537 configuration.base_path,
4538 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4539 );
4540 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4541
4542 if let Some(ref user_agent) = configuration.user_agent {
4543 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4544 }
4545 if let Some(ref token) = configuration.bearer_access_token {
4546 req_builder = req_builder.bearer_auth(token.to_owned());
4547 };
4548 req_builder = req_builder.json(&p_body_authenticator_totp_stage_request);
4549
4550 let req = req_builder.build()?;
4551 let resp = configuration.client.execute(req).await?;
4552
4553 let status = resp.status();
4554 let content_type = resp
4555 .headers()
4556 .get("content-type")
4557 .and_then(|v| v.to_str().ok())
4558 .unwrap_or("application/octet-stream");
4559 let content_type = super::ContentType::from(content_type);
4560
4561 if !status.is_client_error() && !status.is_server_error() {
4562 let content = resp.text().await?;
4563 match content_type {
4564 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4565 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorTotpStage`"))),
4566 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorTotpStage`")))),
4567 }
4568 } else {
4569 let content = resp.text().await?;
4570 let entity: Option<StagesAuthenticatorTotpUpdateError> = serde_json::from_str(&content).ok();
4571 Err(Error::ResponseError(ResponseContent {
4572 status,
4573 content,
4574 entity,
4575 }))
4576 }
4577}
4578
4579pub async fn stages_authenticator_totp_used_by_list(
4581 configuration: &configuration::Configuration,
4582 stage_uuid: &str,
4583) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorTotpUsedByListError>> {
4584 let p_path_stage_uuid = stage_uuid;
4586
4587 let uri_str = format!(
4588 "{}/stages/authenticator/totp/{stage_uuid}/used_by/",
4589 configuration.base_path,
4590 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4591 );
4592 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4593
4594 if let Some(ref user_agent) = configuration.user_agent {
4595 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4596 }
4597 if let Some(ref token) = configuration.bearer_access_token {
4598 req_builder = req_builder.bearer_auth(token.to_owned());
4599 };
4600
4601 let req = req_builder.build()?;
4602 let resp = configuration.client.execute(req).await?;
4603
4604 let status = resp.status();
4605 let content_type = resp
4606 .headers()
4607 .get("content-type")
4608 .and_then(|v| v.to_str().ok())
4609 .unwrap_or("application/octet-stream");
4610 let content_type = super::ContentType::from(content_type);
4611
4612 if !status.is_client_error() && !status.is_server_error() {
4613 let content = resp.text().await?;
4614 match content_type {
4615 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4616 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
4617 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>`")))),
4618 }
4619 } else {
4620 let content = resp.text().await?;
4621 let entity: Option<StagesAuthenticatorTotpUsedByListError> = serde_json::from_str(&content).ok();
4622 Err(Error::ResponseError(ResponseContent {
4623 status,
4624 content,
4625 entity,
4626 }))
4627 }
4628}
4629
4630pub async fn stages_authenticator_validate_create(
4632 configuration: &configuration::Configuration,
4633 authenticator_validate_stage_request: models::AuthenticatorValidateStageRequest,
4634) -> Result<models::AuthenticatorValidateStage, Error<StagesAuthenticatorValidateCreateError>> {
4635 let p_body_authenticator_validate_stage_request = authenticator_validate_stage_request;
4637
4638 let uri_str = format!("{}/stages/authenticator/validate/", configuration.base_path);
4639 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4640
4641 if let Some(ref user_agent) = configuration.user_agent {
4642 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4643 }
4644 if let Some(ref token) = configuration.bearer_access_token {
4645 req_builder = req_builder.bearer_auth(token.to_owned());
4646 };
4647 req_builder = req_builder.json(&p_body_authenticator_validate_stage_request);
4648
4649 let req = req_builder.build()?;
4650 let resp = configuration.client.execute(req).await?;
4651
4652 let status = resp.status();
4653 let content_type = resp
4654 .headers()
4655 .get("content-type")
4656 .and_then(|v| v.to_str().ok())
4657 .unwrap_or("application/octet-stream");
4658 let content_type = super::ContentType::from(content_type);
4659
4660 if !status.is_client_error() && !status.is_server_error() {
4661 let content = resp.text().await?;
4662 match content_type {
4663 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4664 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorValidateStage`"))),
4665 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorValidateStage`")))),
4666 }
4667 } else {
4668 let content = resp.text().await?;
4669 let entity: Option<StagesAuthenticatorValidateCreateError> = serde_json::from_str(&content).ok();
4670 Err(Error::ResponseError(ResponseContent {
4671 status,
4672 content,
4673 entity,
4674 }))
4675 }
4676}
4677
4678pub async fn stages_authenticator_validate_destroy(
4680 configuration: &configuration::Configuration,
4681 stage_uuid: &str,
4682) -> Result<(), Error<StagesAuthenticatorValidateDestroyError>> {
4683 let p_path_stage_uuid = stage_uuid;
4685
4686 let uri_str = format!(
4687 "{}/stages/authenticator/validate/{stage_uuid}/",
4688 configuration.base_path,
4689 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4690 );
4691 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4692
4693 if let Some(ref user_agent) = configuration.user_agent {
4694 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4695 }
4696 if let Some(ref token) = configuration.bearer_access_token {
4697 req_builder = req_builder.bearer_auth(token.to_owned());
4698 };
4699
4700 let req = req_builder.build()?;
4701 let resp = configuration.client.execute(req).await?;
4702
4703 let status = resp.status();
4704
4705 if !status.is_client_error() && !status.is_server_error() {
4706 Ok(())
4707 } else {
4708 let content = resp.text().await?;
4709 let entity: Option<StagesAuthenticatorValidateDestroyError> = serde_json::from_str(&content).ok();
4710 Err(Error::ResponseError(ResponseContent {
4711 status,
4712 content,
4713 entity,
4714 }))
4715 }
4716}
4717
4718pub async fn stages_authenticator_validate_list(
4720 configuration: &configuration::Configuration,
4721 configuration_stages: Option<Vec<uuid::Uuid>>,
4722 name: Option<&str>,
4723 not_configured_action: Option<&str>,
4724 ordering: Option<&str>,
4725 page: Option<i32>,
4726 page_size: Option<i32>,
4727 search: Option<&str>,
4728) -> Result<models::PaginatedAuthenticatorValidateStageList, Error<StagesAuthenticatorValidateListError>> {
4729 let p_query_configuration_stages = configuration_stages;
4731 let p_query_name = name;
4732 let p_query_not_configured_action = not_configured_action;
4733 let p_query_ordering = ordering;
4734 let p_query_page = page;
4735 let p_query_page_size = page_size;
4736 let p_query_search = search;
4737
4738 let uri_str = format!("{}/stages/authenticator/validate/", configuration.base_path);
4739 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4740
4741 if let Some(ref param_value) = p_query_configuration_stages {
4742 req_builder = match "multi" {
4743 "multi" => req_builder.query(
4744 ¶m_value
4745 .into_iter()
4746 .map(|p| ("configuration_stages".to_owned(), p.to_string()))
4747 .collect::<Vec<(std::string::String, std::string::String)>>(),
4748 ),
4749 _ => req_builder.query(&[(
4750 "configuration_stages",
4751 ¶m_value
4752 .into_iter()
4753 .map(|p| p.to_string())
4754 .collect::<Vec<String>>()
4755 .join(",")
4756 .to_string(),
4757 )]),
4758 };
4759 }
4760 if let Some(ref param_value) = p_query_name {
4761 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
4762 }
4763 if let Some(ref param_value) = p_query_not_configured_action {
4764 req_builder = req_builder.query(&[("not_configured_action", ¶m_value.to_string())]);
4765 }
4766 if let Some(ref param_value) = p_query_ordering {
4767 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
4768 }
4769 if let Some(ref param_value) = p_query_page {
4770 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
4771 }
4772 if let Some(ref param_value) = p_query_page_size {
4773 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
4774 }
4775 if let Some(ref param_value) = p_query_search {
4776 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
4777 }
4778 if let Some(ref user_agent) = configuration.user_agent {
4779 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4780 }
4781 if let Some(ref token) = configuration.bearer_access_token {
4782 req_builder = req_builder.bearer_auth(token.to_owned());
4783 };
4784
4785 let req = req_builder.build()?;
4786 let resp = configuration.client.execute(req).await?;
4787
4788 let status = resp.status();
4789 let content_type = resp
4790 .headers()
4791 .get("content-type")
4792 .and_then(|v| v.to_str().ok())
4793 .unwrap_or("application/octet-stream");
4794 let content_type = super::ContentType::from(content_type);
4795
4796 if !status.is_client_error() && !status.is_server_error() {
4797 let content = resp.text().await?;
4798 match content_type {
4799 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4800 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorValidateStageList`"))),
4801 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorValidateStageList`")))),
4802 }
4803 } else {
4804 let content = resp.text().await?;
4805 let entity: Option<StagesAuthenticatorValidateListError> = serde_json::from_str(&content).ok();
4806 Err(Error::ResponseError(ResponseContent {
4807 status,
4808 content,
4809 entity,
4810 }))
4811 }
4812}
4813
4814pub async fn stages_authenticator_validate_partial_update(
4816 configuration: &configuration::Configuration,
4817 stage_uuid: &str,
4818 patched_authenticator_validate_stage_request: Option<models::PatchedAuthenticatorValidateStageRequest>,
4819) -> Result<models::AuthenticatorValidateStage, Error<StagesAuthenticatorValidatePartialUpdateError>> {
4820 let p_path_stage_uuid = stage_uuid;
4822 let p_body_patched_authenticator_validate_stage_request = patched_authenticator_validate_stage_request;
4823
4824 let uri_str = format!(
4825 "{}/stages/authenticator/validate/{stage_uuid}/",
4826 configuration.base_path,
4827 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4828 );
4829 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4830
4831 if let Some(ref user_agent) = configuration.user_agent {
4832 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4833 }
4834 if let Some(ref token) = configuration.bearer_access_token {
4835 req_builder = req_builder.bearer_auth(token.to_owned());
4836 };
4837 req_builder = req_builder.json(&p_body_patched_authenticator_validate_stage_request);
4838
4839 let req = req_builder.build()?;
4840 let resp = configuration.client.execute(req).await?;
4841
4842 let status = resp.status();
4843 let content_type = resp
4844 .headers()
4845 .get("content-type")
4846 .and_then(|v| v.to_str().ok())
4847 .unwrap_or("application/octet-stream");
4848 let content_type = super::ContentType::from(content_type);
4849
4850 if !status.is_client_error() && !status.is_server_error() {
4851 let content = resp.text().await?;
4852 match content_type {
4853 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4854 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorValidateStage`"))),
4855 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorValidateStage`")))),
4856 }
4857 } else {
4858 let content = resp.text().await?;
4859 let entity: Option<StagesAuthenticatorValidatePartialUpdateError> = serde_json::from_str(&content).ok();
4860 Err(Error::ResponseError(ResponseContent {
4861 status,
4862 content,
4863 entity,
4864 }))
4865 }
4866}
4867
4868pub async fn stages_authenticator_validate_retrieve(
4870 configuration: &configuration::Configuration,
4871 stage_uuid: &str,
4872) -> Result<models::AuthenticatorValidateStage, Error<StagesAuthenticatorValidateRetrieveError>> {
4873 let p_path_stage_uuid = stage_uuid;
4875
4876 let uri_str = format!(
4877 "{}/stages/authenticator/validate/{stage_uuid}/",
4878 configuration.base_path,
4879 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4880 );
4881 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4882
4883 if let Some(ref user_agent) = configuration.user_agent {
4884 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4885 }
4886 if let Some(ref token) = configuration.bearer_access_token {
4887 req_builder = req_builder.bearer_auth(token.to_owned());
4888 };
4889
4890 let req = req_builder.build()?;
4891 let resp = configuration.client.execute(req).await?;
4892
4893 let status = resp.status();
4894 let content_type = resp
4895 .headers()
4896 .get("content-type")
4897 .and_then(|v| v.to_str().ok())
4898 .unwrap_or("application/octet-stream");
4899 let content_type = super::ContentType::from(content_type);
4900
4901 if !status.is_client_error() && !status.is_server_error() {
4902 let content = resp.text().await?;
4903 match content_type {
4904 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4905 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorValidateStage`"))),
4906 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorValidateStage`")))),
4907 }
4908 } else {
4909 let content = resp.text().await?;
4910 let entity: Option<StagesAuthenticatorValidateRetrieveError> = serde_json::from_str(&content).ok();
4911 Err(Error::ResponseError(ResponseContent {
4912 status,
4913 content,
4914 entity,
4915 }))
4916 }
4917}
4918
4919pub async fn stages_authenticator_validate_update(
4921 configuration: &configuration::Configuration,
4922 stage_uuid: &str,
4923 authenticator_validate_stage_request: models::AuthenticatorValidateStageRequest,
4924) -> Result<models::AuthenticatorValidateStage, Error<StagesAuthenticatorValidateUpdateError>> {
4925 let p_path_stage_uuid = stage_uuid;
4927 let p_body_authenticator_validate_stage_request = authenticator_validate_stage_request;
4928
4929 let uri_str = format!(
4930 "{}/stages/authenticator/validate/{stage_uuid}/",
4931 configuration.base_path,
4932 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4933 );
4934 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4935
4936 if let Some(ref user_agent) = configuration.user_agent {
4937 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4938 }
4939 if let Some(ref token) = configuration.bearer_access_token {
4940 req_builder = req_builder.bearer_auth(token.to_owned());
4941 };
4942 req_builder = req_builder.json(&p_body_authenticator_validate_stage_request);
4943
4944 let req = req_builder.build()?;
4945 let resp = configuration.client.execute(req).await?;
4946
4947 let status = resp.status();
4948 let content_type = resp
4949 .headers()
4950 .get("content-type")
4951 .and_then(|v| v.to_str().ok())
4952 .unwrap_or("application/octet-stream");
4953 let content_type = super::ContentType::from(content_type);
4954
4955 if !status.is_client_error() && !status.is_server_error() {
4956 let content = resp.text().await?;
4957 match content_type {
4958 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4959 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorValidateStage`"))),
4960 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorValidateStage`")))),
4961 }
4962 } else {
4963 let content = resp.text().await?;
4964 let entity: Option<StagesAuthenticatorValidateUpdateError> = serde_json::from_str(&content).ok();
4965 Err(Error::ResponseError(ResponseContent {
4966 status,
4967 content,
4968 entity,
4969 }))
4970 }
4971}
4972
4973pub async fn stages_authenticator_validate_used_by_list(
4975 configuration: &configuration::Configuration,
4976 stage_uuid: &str,
4977) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorValidateUsedByListError>> {
4978 let p_path_stage_uuid = stage_uuid;
4980
4981 let uri_str = format!(
4982 "{}/stages/authenticator/validate/{stage_uuid}/used_by/",
4983 configuration.base_path,
4984 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
4985 );
4986 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4987
4988 if let Some(ref user_agent) = configuration.user_agent {
4989 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4990 }
4991 if let Some(ref token) = configuration.bearer_access_token {
4992 req_builder = req_builder.bearer_auth(token.to_owned());
4993 };
4994
4995 let req = req_builder.build()?;
4996 let resp = configuration.client.execute(req).await?;
4997
4998 let status = resp.status();
4999 let content_type = resp
5000 .headers()
5001 .get("content-type")
5002 .and_then(|v| v.to_str().ok())
5003 .unwrap_or("application/octet-stream");
5004 let content_type = super::ContentType::from(content_type);
5005
5006 if !status.is_client_error() && !status.is_server_error() {
5007 let content = resp.text().await?;
5008 match content_type {
5009 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5010 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
5011 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>`")))),
5012 }
5013 } else {
5014 let content = resp.text().await?;
5015 let entity: Option<StagesAuthenticatorValidateUsedByListError> = serde_json::from_str(&content).ok();
5016 Err(Error::ResponseError(ResponseContent {
5017 status,
5018 content,
5019 entity,
5020 }))
5021 }
5022}
5023
5024pub async fn stages_authenticator_webauthn_create(
5026 configuration: &configuration::Configuration,
5027 authenticator_web_authn_stage_request: models::AuthenticatorWebAuthnStageRequest,
5028) -> Result<models::AuthenticatorWebAuthnStage, Error<StagesAuthenticatorWebauthnCreateError>> {
5029 let p_body_authenticator_web_authn_stage_request = authenticator_web_authn_stage_request;
5031
5032 let uri_str = format!("{}/stages/authenticator/webauthn/", configuration.base_path);
5033 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5034
5035 if let Some(ref user_agent) = configuration.user_agent {
5036 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5037 }
5038 if let Some(ref token) = configuration.bearer_access_token {
5039 req_builder = req_builder.bearer_auth(token.to_owned());
5040 };
5041 req_builder = req_builder.json(&p_body_authenticator_web_authn_stage_request);
5042
5043 let req = req_builder.build()?;
5044 let resp = configuration.client.execute(req).await?;
5045
5046 let status = resp.status();
5047 let content_type = resp
5048 .headers()
5049 .get("content-type")
5050 .and_then(|v| v.to_str().ok())
5051 .unwrap_or("application/octet-stream");
5052 let content_type = super::ContentType::from(content_type);
5053
5054 if !status.is_client_error() && !status.is_server_error() {
5055 let content = resp.text().await?;
5056 match content_type {
5057 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5058 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`"))),
5059 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`")))),
5060 }
5061 } else {
5062 let content = resp.text().await?;
5063 let entity: Option<StagesAuthenticatorWebauthnCreateError> = serde_json::from_str(&content).ok();
5064 Err(Error::ResponseError(ResponseContent {
5065 status,
5066 content,
5067 entity,
5068 }))
5069 }
5070}
5071
5072pub async fn stages_authenticator_webauthn_destroy(
5074 configuration: &configuration::Configuration,
5075 stage_uuid: &str,
5076) -> Result<(), Error<StagesAuthenticatorWebauthnDestroyError>> {
5077 let p_path_stage_uuid = stage_uuid;
5079
5080 let uri_str = format!(
5081 "{}/stages/authenticator/webauthn/{stage_uuid}/",
5082 configuration.base_path,
5083 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5084 );
5085 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5086
5087 if let Some(ref user_agent) = configuration.user_agent {
5088 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5089 }
5090 if let Some(ref token) = configuration.bearer_access_token {
5091 req_builder = req_builder.bearer_auth(token.to_owned());
5092 };
5093
5094 let req = req_builder.build()?;
5095 let resp = configuration.client.execute(req).await?;
5096
5097 let status = resp.status();
5098
5099 if !status.is_client_error() && !status.is_server_error() {
5100 Ok(())
5101 } else {
5102 let content = resp.text().await?;
5103 let entity: Option<StagesAuthenticatorWebauthnDestroyError> = serde_json::from_str(&content).ok();
5104 Err(Error::ResponseError(ResponseContent {
5105 status,
5106 content,
5107 entity,
5108 }))
5109 }
5110}
5111
5112pub async fn stages_authenticator_webauthn_device_types_list(
5114 configuration: &configuration::Configuration,
5115 aaguid: Option<&str>,
5116 description: Option<&str>,
5117 icon: Option<&str>,
5118 ordering: Option<&str>,
5119 page: Option<i32>,
5120 page_size: Option<i32>,
5121 search: Option<&str>,
5122) -> Result<models::PaginatedWebAuthnDeviceTypeList, Error<StagesAuthenticatorWebauthnDeviceTypesListError>> {
5123 let p_query_aaguid = aaguid;
5125 let p_query_description = description;
5126 let p_query_icon = icon;
5127 let p_query_ordering = ordering;
5128 let p_query_page = page;
5129 let p_query_page_size = page_size;
5130 let p_query_search = search;
5131
5132 let uri_str = format!(
5133 "{}/stages/authenticator/webauthn_device_types/",
5134 configuration.base_path
5135 );
5136 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5137
5138 if let Some(ref param_value) = p_query_aaguid {
5139 req_builder = req_builder.query(&[("aaguid", ¶m_value.to_string())]);
5140 }
5141 if let Some(ref param_value) = p_query_description {
5142 req_builder = req_builder.query(&[("description", ¶m_value.to_string())]);
5143 }
5144 if let Some(ref param_value) = p_query_icon {
5145 req_builder = req_builder.query(&[("icon", ¶m_value.to_string())]);
5146 }
5147 if let Some(ref param_value) = p_query_ordering {
5148 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
5149 }
5150 if let Some(ref param_value) = p_query_page {
5151 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
5152 }
5153 if let Some(ref param_value) = p_query_page_size {
5154 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
5155 }
5156 if let Some(ref param_value) = p_query_search {
5157 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
5158 }
5159 if let Some(ref user_agent) = configuration.user_agent {
5160 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5161 }
5162 if let Some(ref token) = configuration.bearer_access_token {
5163 req_builder = req_builder.bearer_auth(token.to_owned());
5164 };
5165
5166 let req = req_builder.build()?;
5167 let resp = configuration.client.execute(req).await?;
5168
5169 let status = resp.status();
5170 let content_type = resp
5171 .headers()
5172 .get("content-type")
5173 .and_then(|v| v.to_str().ok())
5174 .unwrap_or("application/octet-stream");
5175 let content_type = super::ContentType::from(content_type);
5176
5177 if !status.is_client_error() && !status.is_server_error() {
5178 let content = resp.text().await?;
5179 match content_type {
5180 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5181 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedWebAuthnDeviceTypeList`"))),
5182 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedWebAuthnDeviceTypeList`")))),
5183 }
5184 } else {
5185 let content = resp.text().await?;
5186 let entity: Option<StagesAuthenticatorWebauthnDeviceTypesListError> = serde_json::from_str(&content).ok();
5187 Err(Error::ResponseError(ResponseContent {
5188 status,
5189 content,
5190 entity,
5191 }))
5192 }
5193}
5194
5195pub async fn stages_authenticator_webauthn_device_types_retrieve(
5197 configuration: &configuration::Configuration,
5198 aaguid: &str,
5199) -> Result<models::WebAuthnDeviceType, Error<StagesAuthenticatorWebauthnDeviceTypesRetrieveError>> {
5200 let p_path_aaguid = aaguid;
5202
5203 let uri_str = format!(
5204 "{}/stages/authenticator/webauthn_device_types/{aaguid}/",
5205 configuration.base_path,
5206 aaguid = crate::apis::urlencode(p_path_aaguid)
5207 );
5208 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5209
5210 if let Some(ref user_agent) = configuration.user_agent {
5211 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5212 }
5213 if let Some(ref token) = configuration.bearer_access_token {
5214 req_builder = req_builder.bearer_auth(token.to_owned());
5215 };
5216
5217 let req = req_builder.build()?;
5218 let resp = configuration.client.execute(req).await?;
5219
5220 let status = resp.status();
5221 let content_type = resp
5222 .headers()
5223 .get("content-type")
5224 .and_then(|v| v.to_str().ok())
5225 .unwrap_or("application/octet-stream");
5226 let content_type = super::ContentType::from(content_type);
5227
5228 if !status.is_client_error() && !status.is_server_error() {
5229 let content = resp.text().await?;
5230 match content_type {
5231 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5232 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WebAuthnDeviceType`"))),
5233 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WebAuthnDeviceType`")))),
5234 }
5235 } else {
5236 let content = resp.text().await?;
5237 let entity: Option<StagesAuthenticatorWebauthnDeviceTypesRetrieveError> = serde_json::from_str(&content).ok();
5238 Err(Error::ResponseError(ResponseContent {
5239 status,
5240 content,
5241 entity,
5242 }))
5243 }
5244}
5245
5246pub async fn stages_authenticator_webauthn_list(
5248 configuration: &configuration::Configuration,
5249 authenticator_attachment: Option<&str>,
5250 configure_flow: Option<&str>,
5251 device_type_restrictions: Option<Vec<uuid::Uuid>>,
5252 friendly_name: Option<&str>,
5253 max_attempts: Option<i32>,
5254 name: Option<&str>,
5255 ordering: Option<&str>,
5256 page: Option<i32>,
5257 page_size: Option<i32>,
5258 resident_key_requirement: Option<&str>,
5259 search: Option<&str>,
5260 stage_uuid: Option<&str>,
5261 user_verification: Option<&str>,
5262) -> Result<models::PaginatedAuthenticatorWebAuthnStageList, Error<StagesAuthenticatorWebauthnListError>> {
5263 let p_query_authenticator_attachment = authenticator_attachment;
5265 let p_query_configure_flow = configure_flow;
5266 let p_query_device_type_restrictions = device_type_restrictions;
5267 let p_query_friendly_name = friendly_name;
5268 let p_query_max_attempts = max_attempts;
5269 let p_query_name = name;
5270 let p_query_ordering = ordering;
5271 let p_query_page = page;
5272 let p_query_page_size = page_size;
5273 let p_query_resident_key_requirement = resident_key_requirement;
5274 let p_query_search = search;
5275 let p_query_stage_uuid = stage_uuid;
5276 let p_query_user_verification = user_verification;
5277
5278 let uri_str = format!("{}/stages/authenticator/webauthn/", configuration.base_path);
5279 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5280
5281 if let Some(ref param_value) = p_query_authenticator_attachment {
5282 req_builder = req_builder.query(&[("authenticator_attachment", ¶m_value.to_string())]);
5283 }
5284 if let Some(ref param_value) = p_query_configure_flow {
5285 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
5286 }
5287 if let Some(ref param_value) = p_query_device_type_restrictions {
5288 req_builder = match "multi" {
5289 "multi" => req_builder.query(
5290 ¶m_value
5291 .into_iter()
5292 .map(|p| ("device_type_restrictions".to_owned(), p.to_string()))
5293 .collect::<Vec<(std::string::String, std::string::String)>>(),
5294 ),
5295 _ => req_builder.query(&[(
5296 "device_type_restrictions",
5297 ¶m_value
5298 .into_iter()
5299 .map(|p| p.to_string())
5300 .collect::<Vec<String>>()
5301 .join(",")
5302 .to_string(),
5303 )]),
5304 };
5305 }
5306 if let Some(ref param_value) = p_query_friendly_name {
5307 req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]);
5308 }
5309 if let Some(ref param_value) = p_query_max_attempts {
5310 req_builder = req_builder.query(&[("max_attempts", ¶m_value.to_string())]);
5311 }
5312 if let Some(ref param_value) = p_query_name {
5313 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
5314 }
5315 if let Some(ref param_value) = p_query_ordering {
5316 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
5317 }
5318 if let Some(ref param_value) = p_query_page {
5319 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
5320 }
5321 if let Some(ref param_value) = p_query_page_size {
5322 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
5323 }
5324 if let Some(ref param_value) = p_query_resident_key_requirement {
5325 req_builder = req_builder.query(&[("resident_key_requirement", ¶m_value.to_string())]);
5326 }
5327 if let Some(ref param_value) = p_query_search {
5328 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
5329 }
5330 if let Some(ref param_value) = p_query_stage_uuid {
5331 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
5332 }
5333 if let Some(ref param_value) = p_query_user_verification {
5334 req_builder = req_builder.query(&[("user_verification", ¶m_value.to_string())]);
5335 }
5336 if let Some(ref user_agent) = configuration.user_agent {
5337 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5338 }
5339 if let Some(ref token) = configuration.bearer_access_token {
5340 req_builder = req_builder.bearer_auth(token.to_owned());
5341 };
5342
5343 let req = req_builder.build()?;
5344 let resp = configuration.client.execute(req).await?;
5345
5346 let status = resp.status();
5347 let content_type = resp
5348 .headers()
5349 .get("content-type")
5350 .and_then(|v| v.to_str().ok())
5351 .unwrap_or("application/octet-stream");
5352 let content_type = super::ContentType::from(content_type);
5353
5354 if !status.is_client_error() && !status.is_server_error() {
5355 let content = resp.text().await?;
5356 match content_type {
5357 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5358 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedAuthenticatorWebAuthnStageList`"))),
5359 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedAuthenticatorWebAuthnStageList`")))),
5360 }
5361 } else {
5362 let content = resp.text().await?;
5363 let entity: Option<StagesAuthenticatorWebauthnListError> = serde_json::from_str(&content).ok();
5364 Err(Error::ResponseError(ResponseContent {
5365 status,
5366 content,
5367 entity,
5368 }))
5369 }
5370}
5371
5372pub async fn stages_authenticator_webauthn_partial_update(
5374 configuration: &configuration::Configuration,
5375 stage_uuid: &str,
5376 patched_authenticator_web_authn_stage_request: Option<models::PatchedAuthenticatorWebAuthnStageRequest>,
5377) -> Result<models::AuthenticatorWebAuthnStage, Error<StagesAuthenticatorWebauthnPartialUpdateError>> {
5378 let p_path_stage_uuid = stage_uuid;
5380 let p_body_patched_authenticator_web_authn_stage_request = patched_authenticator_web_authn_stage_request;
5381
5382 let uri_str = format!(
5383 "{}/stages/authenticator/webauthn/{stage_uuid}/",
5384 configuration.base_path,
5385 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5386 );
5387 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5388
5389 if let Some(ref user_agent) = configuration.user_agent {
5390 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5391 }
5392 if let Some(ref token) = configuration.bearer_access_token {
5393 req_builder = req_builder.bearer_auth(token.to_owned());
5394 };
5395 req_builder = req_builder.json(&p_body_patched_authenticator_web_authn_stage_request);
5396
5397 let req = req_builder.build()?;
5398 let resp = configuration.client.execute(req).await?;
5399
5400 let status = resp.status();
5401 let content_type = resp
5402 .headers()
5403 .get("content-type")
5404 .and_then(|v| v.to_str().ok())
5405 .unwrap_or("application/octet-stream");
5406 let content_type = super::ContentType::from(content_type);
5407
5408 if !status.is_client_error() && !status.is_server_error() {
5409 let content = resp.text().await?;
5410 match content_type {
5411 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5412 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`"))),
5413 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`")))),
5414 }
5415 } else {
5416 let content = resp.text().await?;
5417 let entity: Option<StagesAuthenticatorWebauthnPartialUpdateError> = serde_json::from_str(&content).ok();
5418 Err(Error::ResponseError(ResponseContent {
5419 status,
5420 content,
5421 entity,
5422 }))
5423 }
5424}
5425
5426pub async fn stages_authenticator_webauthn_retrieve(
5428 configuration: &configuration::Configuration,
5429 stage_uuid: &str,
5430) -> Result<models::AuthenticatorWebAuthnStage, Error<StagesAuthenticatorWebauthnRetrieveError>> {
5431 let p_path_stage_uuid = stage_uuid;
5433
5434 let uri_str = format!(
5435 "{}/stages/authenticator/webauthn/{stage_uuid}/",
5436 configuration.base_path,
5437 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5438 );
5439 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5440
5441 if let Some(ref user_agent) = configuration.user_agent {
5442 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5443 }
5444 if let Some(ref token) = configuration.bearer_access_token {
5445 req_builder = req_builder.bearer_auth(token.to_owned());
5446 };
5447
5448 let req = req_builder.build()?;
5449 let resp = configuration.client.execute(req).await?;
5450
5451 let status = resp.status();
5452 let content_type = resp
5453 .headers()
5454 .get("content-type")
5455 .and_then(|v| v.to_str().ok())
5456 .unwrap_or("application/octet-stream");
5457 let content_type = super::ContentType::from(content_type);
5458
5459 if !status.is_client_error() && !status.is_server_error() {
5460 let content = resp.text().await?;
5461 match content_type {
5462 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5463 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`"))),
5464 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`")))),
5465 }
5466 } else {
5467 let content = resp.text().await?;
5468 let entity: Option<StagesAuthenticatorWebauthnRetrieveError> = serde_json::from_str(&content).ok();
5469 Err(Error::ResponseError(ResponseContent {
5470 status,
5471 content,
5472 entity,
5473 }))
5474 }
5475}
5476
5477pub async fn stages_authenticator_webauthn_update(
5479 configuration: &configuration::Configuration,
5480 stage_uuid: &str,
5481 authenticator_web_authn_stage_request: models::AuthenticatorWebAuthnStageRequest,
5482) -> Result<models::AuthenticatorWebAuthnStage, Error<StagesAuthenticatorWebauthnUpdateError>> {
5483 let p_path_stage_uuid = stage_uuid;
5485 let p_body_authenticator_web_authn_stage_request = authenticator_web_authn_stage_request;
5486
5487 let uri_str = format!(
5488 "{}/stages/authenticator/webauthn/{stage_uuid}/",
5489 configuration.base_path,
5490 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5491 );
5492 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5493
5494 if let Some(ref user_agent) = configuration.user_agent {
5495 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5496 }
5497 if let Some(ref token) = configuration.bearer_access_token {
5498 req_builder = req_builder.bearer_auth(token.to_owned());
5499 };
5500 req_builder = req_builder.json(&p_body_authenticator_web_authn_stage_request);
5501
5502 let req = req_builder.build()?;
5503 let resp = configuration.client.execute(req).await?;
5504
5505 let status = resp.status();
5506 let content_type = resp
5507 .headers()
5508 .get("content-type")
5509 .and_then(|v| v.to_str().ok())
5510 .unwrap_or("application/octet-stream");
5511 let content_type = super::ContentType::from(content_type);
5512
5513 if !status.is_client_error() && !status.is_server_error() {
5514 let content = resp.text().await?;
5515 match content_type {
5516 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5517 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`"))),
5518 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthenticatorWebAuthnStage`")))),
5519 }
5520 } else {
5521 let content = resp.text().await?;
5522 let entity: Option<StagesAuthenticatorWebauthnUpdateError> = serde_json::from_str(&content).ok();
5523 Err(Error::ResponseError(ResponseContent {
5524 status,
5525 content,
5526 entity,
5527 }))
5528 }
5529}
5530
5531pub async fn stages_authenticator_webauthn_used_by_list(
5533 configuration: &configuration::Configuration,
5534 stage_uuid: &str,
5535) -> Result<Vec<models::UsedBy>, Error<StagesAuthenticatorWebauthnUsedByListError>> {
5536 let p_path_stage_uuid = stage_uuid;
5538
5539 let uri_str = format!(
5540 "{}/stages/authenticator/webauthn/{stage_uuid}/used_by/",
5541 configuration.base_path,
5542 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5543 );
5544 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5545
5546 if let Some(ref user_agent) = configuration.user_agent {
5547 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5548 }
5549 if let Some(ref token) = configuration.bearer_access_token {
5550 req_builder = req_builder.bearer_auth(token.to_owned());
5551 };
5552
5553 let req = req_builder.build()?;
5554 let resp = configuration.client.execute(req).await?;
5555
5556 let status = resp.status();
5557 let content_type = resp
5558 .headers()
5559 .get("content-type")
5560 .and_then(|v| v.to_str().ok())
5561 .unwrap_or("application/octet-stream");
5562 let content_type = super::ContentType::from(content_type);
5563
5564 if !status.is_client_error() && !status.is_server_error() {
5565 let content = resp.text().await?;
5566 match content_type {
5567 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5568 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
5569 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>`")))),
5570 }
5571 } else {
5572 let content = resp.text().await?;
5573 let entity: Option<StagesAuthenticatorWebauthnUsedByListError> = serde_json::from_str(&content).ok();
5574 Err(Error::ResponseError(ResponseContent {
5575 status,
5576 content,
5577 entity,
5578 }))
5579 }
5580}
5581
5582pub async fn stages_captcha_create(
5584 configuration: &configuration::Configuration,
5585 captcha_stage_request: models::CaptchaStageRequest,
5586) -> Result<models::CaptchaStage, Error<StagesCaptchaCreateError>> {
5587 let p_body_captcha_stage_request = captcha_stage_request;
5589
5590 let uri_str = format!("{}/stages/captcha/", configuration.base_path);
5591 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5592
5593 if let Some(ref user_agent) = configuration.user_agent {
5594 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5595 }
5596 if let Some(ref token) = configuration.bearer_access_token {
5597 req_builder = req_builder.bearer_auth(token.to_owned());
5598 };
5599 req_builder = req_builder.json(&p_body_captcha_stage_request);
5600
5601 let req = req_builder.build()?;
5602 let resp = configuration.client.execute(req).await?;
5603
5604 let status = resp.status();
5605 let content_type = resp
5606 .headers()
5607 .get("content-type")
5608 .and_then(|v| v.to_str().ok())
5609 .unwrap_or("application/octet-stream");
5610 let content_type = super::ContentType::from(content_type);
5611
5612 if !status.is_client_error() && !status.is_server_error() {
5613 let content = resp.text().await?;
5614 match content_type {
5615 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5616 ContentType::Text => {
5617 return Err(Error::from(serde_json::Error::custom(
5618 "Received `text/plain` content type response that cannot be converted to `models::CaptchaStage`",
5619 )))
5620 }
5621 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5622 "Received `{unknown_type}` content type response that cannot be converted to `models::CaptchaStage`"
5623 )))),
5624 }
5625 } else {
5626 let content = resp.text().await?;
5627 let entity: Option<StagesCaptchaCreateError> = serde_json::from_str(&content).ok();
5628 Err(Error::ResponseError(ResponseContent {
5629 status,
5630 content,
5631 entity,
5632 }))
5633 }
5634}
5635
5636pub async fn stages_captcha_destroy(
5638 configuration: &configuration::Configuration,
5639 stage_uuid: &str,
5640) -> Result<(), Error<StagesCaptchaDestroyError>> {
5641 let p_path_stage_uuid = stage_uuid;
5643
5644 let uri_str = format!(
5645 "{}/stages/captcha/{stage_uuid}/",
5646 configuration.base_path,
5647 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5648 );
5649 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5650
5651 if let Some(ref user_agent) = configuration.user_agent {
5652 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5653 }
5654 if let Some(ref token) = configuration.bearer_access_token {
5655 req_builder = req_builder.bearer_auth(token.to_owned());
5656 };
5657
5658 let req = req_builder.build()?;
5659 let resp = configuration.client.execute(req).await?;
5660
5661 let status = resp.status();
5662
5663 if !status.is_client_error() && !status.is_server_error() {
5664 Ok(())
5665 } else {
5666 let content = resp.text().await?;
5667 let entity: Option<StagesCaptchaDestroyError> = serde_json::from_str(&content).ok();
5668 Err(Error::ResponseError(ResponseContent {
5669 status,
5670 content,
5671 entity,
5672 }))
5673 }
5674}
5675
5676pub async fn stages_captcha_list(
5678 configuration: &configuration::Configuration,
5679 name: Option<&str>,
5680 ordering: Option<&str>,
5681 page: Option<i32>,
5682 page_size: Option<i32>,
5683 public_key: Option<&str>,
5684 search: Option<&str>,
5685) -> Result<models::PaginatedCaptchaStageList, Error<StagesCaptchaListError>> {
5686 let p_query_name = name;
5688 let p_query_ordering = ordering;
5689 let p_query_page = page;
5690 let p_query_page_size = page_size;
5691 let p_query_public_key = public_key;
5692 let p_query_search = search;
5693
5694 let uri_str = format!("{}/stages/captcha/", configuration.base_path);
5695 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5696
5697 if let Some(ref param_value) = p_query_name {
5698 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
5699 }
5700 if let Some(ref param_value) = p_query_ordering {
5701 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
5702 }
5703 if let Some(ref param_value) = p_query_page {
5704 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
5705 }
5706 if let Some(ref param_value) = p_query_page_size {
5707 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
5708 }
5709 if let Some(ref param_value) = p_query_public_key {
5710 req_builder = req_builder.query(&[("public_key", ¶m_value.to_string())]);
5711 }
5712 if let Some(ref param_value) = p_query_search {
5713 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
5714 }
5715 if let Some(ref user_agent) = configuration.user_agent {
5716 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5717 }
5718 if let Some(ref token) = configuration.bearer_access_token {
5719 req_builder = req_builder.bearer_auth(token.to_owned());
5720 };
5721
5722 let req = req_builder.build()?;
5723 let resp = configuration.client.execute(req).await?;
5724
5725 let status = resp.status();
5726 let content_type = resp
5727 .headers()
5728 .get("content-type")
5729 .and_then(|v| v.to_str().ok())
5730 .unwrap_or("application/octet-stream");
5731 let content_type = super::ContentType::from(content_type);
5732
5733 if !status.is_client_error() && !status.is_server_error() {
5734 let content = resp.text().await?;
5735 match content_type {
5736 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5737 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedCaptchaStageList`"))),
5738 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedCaptchaStageList`")))),
5739 }
5740 } else {
5741 let content = resp.text().await?;
5742 let entity: Option<StagesCaptchaListError> = serde_json::from_str(&content).ok();
5743 Err(Error::ResponseError(ResponseContent {
5744 status,
5745 content,
5746 entity,
5747 }))
5748 }
5749}
5750
5751pub async fn stages_captcha_partial_update(
5753 configuration: &configuration::Configuration,
5754 stage_uuid: &str,
5755 patched_captcha_stage_request: Option<models::PatchedCaptchaStageRequest>,
5756) -> Result<models::CaptchaStage, Error<StagesCaptchaPartialUpdateError>> {
5757 let p_path_stage_uuid = stage_uuid;
5759 let p_body_patched_captcha_stage_request = patched_captcha_stage_request;
5760
5761 let uri_str = format!(
5762 "{}/stages/captcha/{stage_uuid}/",
5763 configuration.base_path,
5764 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5765 );
5766 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5767
5768 if let Some(ref user_agent) = configuration.user_agent {
5769 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5770 }
5771 if let Some(ref token) = configuration.bearer_access_token {
5772 req_builder = req_builder.bearer_auth(token.to_owned());
5773 };
5774 req_builder = req_builder.json(&p_body_patched_captcha_stage_request);
5775
5776 let req = req_builder.build()?;
5777 let resp = configuration.client.execute(req).await?;
5778
5779 let status = resp.status();
5780 let content_type = resp
5781 .headers()
5782 .get("content-type")
5783 .and_then(|v| v.to_str().ok())
5784 .unwrap_or("application/octet-stream");
5785 let content_type = super::ContentType::from(content_type);
5786
5787 if !status.is_client_error() && !status.is_server_error() {
5788 let content = resp.text().await?;
5789 match content_type {
5790 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5791 ContentType::Text => {
5792 return Err(Error::from(serde_json::Error::custom(
5793 "Received `text/plain` content type response that cannot be converted to `models::CaptchaStage`",
5794 )))
5795 }
5796 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5797 "Received `{unknown_type}` content type response that cannot be converted to `models::CaptchaStage`"
5798 )))),
5799 }
5800 } else {
5801 let content = resp.text().await?;
5802 let entity: Option<StagesCaptchaPartialUpdateError> = serde_json::from_str(&content).ok();
5803 Err(Error::ResponseError(ResponseContent {
5804 status,
5805 content,
5806 entity,
5807 }))
5808 }
5809}
5810
5811pub async fn stages_captcha_retrieve(
5813 configuration: &configuration::Configuration,
5814 stage_uuid: &str,
5815) -> Result<models::CaptchaStage, Error<StagesCaptchaRetrieveError>> {
5816 let p_path_stage_uuid = stage_uuid;
5818
5819 let uri_str = format!(
5820 "{}/stages/captcha/{stage_uuid}/",
5821 configuration.base_path,
5822 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5823 );
5824 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5825
5826 if let Some(ref user_agent) = configuration.user_agent {
5827 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5828 }
5829 if let Some(ref token) = configuration.bearer_access_token {
5830 req_builder = req_builder.bearer_auth(token.to_owned());
5831 };
5832
5833 let req = req_builder.build()?;
5834 let resp = configuration.client.execute(req).await?;
5835
5836 let status = resp.status();
5837 let content_type = resp
5838 .headers()
5839 .get("content-type")
5840 .and_then(|v| v.to_str().ok())
5841 .unwrap_or("application/octet-stream");
5842 let content_type = super::ContentType::from(content_type);
5843
5844 if !status.is_client_error() && !status.is_server_error() {
5845 let content = resp.text().await?;
5846 match content_type {
5847 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5848 ContentType::Text => {
5849 return Err(Error::from(serde_json::Error::custom(
5850 "Received `text/plain` content type response that cannot be converted to `models::CaptchaStage`",
5851 )))
5852 }
5853 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5854 "Received `{unknown_type}` content type response that cannot be converted to `models::CaptchaStage`"
5855 )))),
5856 }
5857 } else {
5858 let content = resp.text().await?;
5859 let entity: Option<StagesCaptchaRetrieveError> = serde_json::from_str(&content).ok();
5860 Err(Error::ResponseError(ResponseContent {
5861 status,
5862 content,
5863 entity,
5864 }))
5865 }
5866}
5867
5868pub async fn stages_captcha_update(
5870 configuration: &configuration::Configuration,
5871 stage_uuid: &str,
5872 captcha_stage_request: models::CaptchaStageRequest,
5873) -> Result<models::CaptchaStage, Error<StagesCaptchaUpdateError>> {
5874 let p_path_stage_uuid = stage_uuid;
5876 let p_body_captcha_stage_request = captcha_stage_request;
5877
5878 let uri_str = format!(
5879 "{}/stages/captcha/{stage_uuid}/",
5880 configuration.base_path,
5881 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5882 );
5883 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5884
5885 if let Some(ref user_agent) = configuration.user_agent {
5886 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5887 }
5888 if let Some(ref token) = configuration.bearer_access_token {
5889 req_builder = req_builder.bearer_auth(token.to_owned());
5890 };
5891 req_builder = req_builder.json(&p_body_captcha_stage_request);
5892
5893 let req = req_builder.build()?;
5894 let resp = configuration.client.execute(req).await?;
5895
5896 let status = resp.status();
5897 let content_type = resp
5898 .headers()
5899 .get("content-type")
5900 .and_then(|v| v.to_str().ok())
5901 .unwrap_or("application/octet-stream");
5902 let content_type = super::ContentType::from(content_type);
5903
5904 if !status.is_client_error() && !status.is_server_error() {
5905 let content = resp.text().await?;
5906 match content_type {
5907 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5908 ContentType::Text => {
5909 return Err(Error::from(serde_json::Error::custom(
5910 "Received `text/plain` content type response that cannot be converted to `models::CaptchaStage`",
5911 )))
5912 }
5913 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
5914 "Received `{unknown_type}` content type response that cannot be converted to `models::CaptchaStage`"
5915 )))),
5916 }
5917 } else {
5918 let content = resp.text().await?;
5919 let entity: Option<StagesCaptchaUpdateError> = serde_json::from_str(&content).ok();
5920 Err(Error::ResponseError(ResponseContent {
5921 status,
5922 content,
5923 entity,
5924 }))
5925 }
5926}
5927
5928pub async fn stages_captcha_used_by_list(
5930 configuration: &configuration::Configuration,
5931 stage_uuid: &str,
5932) -> Result<Vec<models::UsedBy>, Error<StagesCaptchaUsedByListError>> {
5933 let p_path_stage_uuid = stage_uuid;
5935
5936 let uri_str = format!(
5937 "{}/stages/captcha/{stage_uuid}/used_by/",
5938 configuration.base_path,
5939 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
5940 );
5941 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5942
5943 if let Some(ref user_agent) = configuration.user_agent {
5944 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5945 }
5946 if let Some(ref token) = configuration.bearer_access_token {
5947 req_builder = req_builder.bearer_auth(token.to_owned());
5948 };
5949
5950 let req = req_builder.build()?;
5951 let resp = configuration.client.execute(req).await?;
5952
5953 let status = resp.status();
5954 let content_type = resp
5955 .headers()
5956 .get("content-type")
5957 .and_then(|v| v.to_str().ok())
5958 .unwrap_or("application/octet-stream");
5959 let content_type = super::ContentType::from(content_type);
5960
5961 if !status.is_client_error() && !status.is_server_error() {
5962 let content = resp.text().await?;
5963 match content_type {
5964 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5965 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
5966 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>`")))),
5967 }
5968 } else {
5969 let content = resp.text().await?;
5970 let entity: Option<StagesCaptchaUsedByListError> = serde_json::from_str(&content).ok();
5971 Err(Error::ResponseError(ResponseContent {
5972 status,
5973 content,
5974 entity,
5975 }))
5976 }
5977}
5978
5979pub async fn stages_consent_create(
5981 configuration: &configuration::Configuration,
5982 consent_stage_request: models::ConsentStageRequest,
5983) -> Result<models::ConsentStage, Error<StagesConsentCreateError>> {
5984 let p_body_consent_stage_request = consent_stage_request;
5986
5987 let uri_str = format!("{}/stages/consent/", configuration.base_path);
5988 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5989
5990 if let Some(ref user_agent) = configuration.user_agent {
5991 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5992 }
5993 if let Some(ref token) = configuration.bearer_access_token {
5994 req_builder = req_builder.bearer_auth(token.to_owned());
5995 };
5996 req_builder = req_builder.json(&p_body_consent_stage_request);
5997
5998 let req = req_builder.build()?;
5999 let resp = configuration.client.execute(req).await?;
6000
6001 let status = resp.status();
6002 let content_type = resp
6003 .headers()
6004 .get("content-type")
6005 .and_then(|v| v.to_str().ok())
6006 .unwrap_or("application/octet-stream");
6007 let content_type = super::ContentType::from(content_type);
6008
6009 if !status.is_client_error() && !status.is_server_error() {
6010 let content = resp.text().await?;
6011 match content_type {
6012 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6013 ContentType::Text => {
6014 return Err(Error::from(serde_json::Error::custom(
6015 "Received `text/plain` content type response that cannot be converted to `models::ConsentStage`",
6016 )))
6017 }
6018 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6019 "Received `{unknown_type}` content type response that cannot be converted to `models::ConsentStage`"
6020 )))),
6021 }
6022 } else {
6023 let content = resp.text().await?;
6024 let entity: Option<StagesConsentCreateError> = serde_json::from_str(&content).ok();
6025 Err(Error::ResponseError(ResponseContent {
6026 status,
6027 content,
6028 entity,
6029 }))
6030 }
6031}
6032
6033pub async fn stages_consent_destroy(
6035 configuration: &configuration::Configuration,
6036 stage_uuid: &str,
6037) -> Result<(), Error<StagesConsentDestroyError>> {
6038 let p_path_stage_uuid = stage_uuid;
6040
6041 let uri_str = format!(
6042 "{}/stages/consent/{stage_uuid}/",
6043 configuration.base_path,
6044 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6045 );
6046 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6047
6048 if let Some(ref user_agent) = configuration.user_agent {
6049 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6050 }
6051 if let Some(ref token) = configuration.bearer_access_token {
6052 req_builder = req_builder.bearer_auth(token.to_owned());
6053 };
6054
6055 let req = req_builder.build()?;
6056 let resp = configuration.client.execute(req).await?;
6057
6058 let status = resp.status();
6059
6060 if !status.is_client_error() && !status.is_server_error() {
6061 Ok(())
6062 } else {
6063 let content = resp.text().await?;
6064 let entity: Option<StagesConsentDestroyError> = serde_json::from_str(&content).ok();
6065 Err(Error::ResponseError(ResponseContent {
6066 status,
6067 content,
6068 entity,
6069 }))
6070 }
6071}
6072
6073pub async fn stages_consent_list(
6075 configuration: &configuration::Configuration,
6076 consent_expire_in: Option<&str>,
6077 mode: Option<&str>,
6078 name: Option<&str>,
6079 ordering: Option<&str>,
6080 page: Option<i32>,
6081 page_size: Option<i32>,
6082 search: Option<&str>,
6083 stage_uuid: Option<&str>,
6084) -> Result<models::PaginatedConsentStageList, Error<StagesConsentListError>> {
6085 let p_query_consent_expire_in = consent_expire_in;
6087 let p_query_mode = mode;
6088 let p_query_name = name;
6089 let p_query_ordering = ordering;
6090 let p_query_page = page;
6091 let p_query_page_size = page_size;
6092 let p_query_search = search;
6093 let p_query_stage_uuid = stage_uuid;
6094
6095 let uri_str = format!("{}/stages/consent/", configuration.base_path);
6096 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6097
6098 if let Some(ref param_value) = p_query_consent_expire_in {
6099 req_builder = req_builder.query(&[("consent_expire_in", ¶m_value.to_string())]);
6100 }
6101 if let Some(ref param_value) = p_query_mode {
6102 req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]);
6103 }
6104 if let Some(ref param_value) = p_query_name {
6105 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
6106 }
6107 if let Some(ref param_value) = p_query_ordering {
6108 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
6109 }
6110 if let Some(ref param_value) = p_query_page {
6111 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
6112 }
6113 if let Some(ref param_value) = p_query_page_size {
6114 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
6115 }
6116 if let Some(ref param_value) = p_query_search {
6117 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
6118 }
6119 if let Some(ref param_value) = p_query_stage_uuid {
6120 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
6121 }
6122 if let Some(ref user_agent) = configuration.user_agent {
6123 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6124 }
6125 if let Some(ref token) = configuration.bearer_access_token {
6126 req_builder = req_builder.bearer_auth(token.to_owned());
6127 };
6128
6129 let req = req_builder.build()?;
6130 let resp = configuration.client.execute(req).await?;
6131
6132 let status = resp.status();
6133 let content_type = resp
6134 .headers()
6135 .get("content-type")
6136 .and_then(|v| v.to_str().ok())
6137 .unwrap_or("application/octet-stream");
6138 let content_type = super::ContentType::from(content_type);
6139
6140 if !status.is_client_error() && !status.is_server_error() {
6141 let content = resp.text().await?;
6142 match content_type {
6143 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6144 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedConsentStageList`"))),
6145 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedConsentStageList`")))),
6146 }
6147 } else {
6148 let content = resp.text().await?;
6149 let entity: Option<StagesConsentListError> = serde_json::from_str(&content).ok();
6150 Err(Error::ResponseError(ResponseContent {
6151 status,
6152 content,
6153 entity,
6154 }))
6155 }
6156}
6157
6158pub async fn stages_consent_partial_update(
6160 configuration: &configuration::Configuration,
6161 stage_uuid: &str,
6162 patched_consent_stage_request: Option<models::PatchedConsentStageRequest>,
6163) -> Result<models::ConsentStage, Error<StagesConsentPartialUpdateError>> {
6164 let p_path_stage_uuid = stage_uuid;
6166 let p_body_patched_consent_stage_request = patched_consent_stage_request;
6167
6168 let uri_str = format!(
6169 "{}/stages/consent/{stage_uuid}/",
6170 configuration.base_path,
6171 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6172 );
6173 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6174
6175 if let Some(ref user_agent) = configuration.user_agent {
6176 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6177 }
6178 if let Some(ref token) = configuration.bearer_access_token {
6179 req_builder = req_builder.bearer_auth(token.to_owned());
6180 };
6181 req_builder = req_builder.json(&p_body_patched_consent_stage_request);
6182
6183 let req = req_builder.build()?;
6184 let resp = configuration.client.execute(req).await?;
6185
6186 let status = resp.status();
6187 let content_type = resp
6188 .headers()
6189 .get("content-type")
6190 .and_then(|v| v.to_str().ok())
6191 .unwrap_or("application/octet-stream");
6192 let content_type = super::ContentType::from(content_type);
6193
6194 if !status.is_client_error() && !status.is_server_error() {
6195 let content = resp.text().await?;
6196 match content_type {
6197 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6198 ContentType::Text => {
6199 return Err(Error::from(serde_json::Error::custom(
6200 "Received `text/plain` content type response that cannot be converted to `models::ConsentStage`",
6201 )))
6202 }
6203 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6204 "Received `{unknown_type}` content type response that cannot be converted to `models::ConsentStage`"
6205 )))),
6206 }
6207 } else {
6208 let content = resp.text().await?;
6209 let entity: Option<StagesConsentPartialUpdateError> = serde_json::from_str(&content).ok();
6210 Err(Error::ResponseError(ResponseContent {
6211 status,
6212 content,
6213 entity,
6214 }))
6215 }
6216}
6217
6218pub async fn stages_consent_retrieve(
6220 configuration: &configuration::Configuration,
6221 stage_uuid: &str,
6222) -> Result<models::ConsentStage, Error<StagesConsentRetrieveError>> {
6223 let p_path_stage_uuid = stage_uuid;
6225
6226 let uri_str = format!(
6227 "{}/stages/consent/{stage_uuid}/",
6228 configuration.base_path,
6229 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6230 );
6231 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6232
6233 if let Some(ref user_agent) = configuration.user_agent {
6234 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6235 }
6236 if let Some(ref token) = configuration.bearer_access_token {
6237 req_builder = req_builder.bearer_auth(token.to_owned());
6238 };
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::ConsentStage`",
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::ConsentStage`"
6262 )))),
6263 }
6264 } else {
6265 let content = resp.text().await?;
6266 let entity: Option<StagesConsentRetrieveError> = serde_json::from_str(&content).ok();
6267 Err(Error::ResponseError(ResponseContent {
6268 status,
6269 content,
6270 entity,
6271 }))
6272 }
6273}
6274
6275pub async fn stages_consent_update(
6277 configuration: &configuration::Configuration,
6278 stage_uuid: &str,
6279 consent_stage_request: models::ConsentStageRequest,
6280) -> Result<models::ConsentStage, Error<StagesConsentUpdateError>> {
6281 let p_path_stage_uuid = stage_uuid;
6283 let p_body_consent_stage_request = consent_stage_request;
6284
6285 let uri_str = format!(
6286 "{}/stages/consent/{stage_uuid}/",
6287 configuration.base_path,
6288 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6289 );
6290 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6291
6292 if let Some(ref user_agent) = configuration.user_agent {
6293 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6294 }
6295 if let Some(ref token) = configuration.bearer_access_token {
6296 req_builder = req_builder.bearer_auth(token.to_owned());
6297 };
6298 req_builder = req_builder.json(&p_body_consent_stage_request);
6299
6300 let req = req_builder.build()?;
6301 let resp = configuration.client.execute(req).await?;
6302
6303 let status = resp.status();
6304 let content_type = resp
6305 .headers()
6306 .get("content-type")
6307 .and_then(|v| v.to_str().ok())
6308 .unwrap_or("application/octet-stream");
6309 let content_type = super::ContentType::from(content_type);
6310
6311 if !status.is_client_error() && !status.is_server_error() {
6312 let content = resp.text().await?;
6313 match content_type {
6314 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6315 ContentType::Text => {
6316 return Err(Error::from(serde_json::Error::custom(
6317 "Received `text/plain` content type response that cannot be converted to `models::ConsentStage`",
6318 )))
6319 }
6320 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
6321 "Received `{unknown_type}` content type response that cannot be converted to `models::ConsentStage`"
6322 )))),
6323 }
6324 } else {
6325 let content = resp.text().await?;
6326 let entity: Option<StagesConsentUpdateError> = serde_json::from_str(&content).ok();
6327 Err(Error::ResponseError(ResponseContent {
6328 status,
6329 content,
6330 entity,
6331 }))
6332 }
6333}
6334
6335pub async fn stages_consent_used_by_list(
6337 configuration: &configuration::Configuration,
6338 stage_uuid: &str,
6339) -> Result<Vec<models::UsedBy>, Error<StagesConsentUsedByListError>> {
6340 let p_path_stage_uuid = stage_uuid;
6342
6343 let uri_str = format!(
6344 "{}/stages/consent/{stage_uuid}/used_by/",
6345 configuration.base_path,
6346 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6347 );
6348 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6349
6350 if let Some(ref user_agent) = configuration.user_agent {
6351 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6352 }
6353 if let Some(ref token) = configuration.bearer_access_token {
6354 req_builder = req_builder.bearer_auth(token.to_owned());
6355 };
6356
6357 let req = req_builder.build()?;
6358 let resp = configuration.client.execute(req).await?;
6359
6360 let status = resp.status();
6361 let content_type = resp
6362 .headers()
6363 .get("content-type")
6364 .and_then(|v| v.to_str().ok())
6365 .unwrap_or("application/octet-stream");
6366 let content_type = super::ContentType::from(content_type);
6367
6368 if !status.is_client_error() && !status.is_server_error() {
6369 let content = resp.text().await?;
6370 match content_type {
6371 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6372 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
6373 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>`")))),
6374 }
6375 } else {
6376 let content = resp.text().await?;
6377 let entity: Option<StagesConsentUsedByListError> = serde_json::from_str(&content).ok();
6378 Err(Error::ResponseError(ResponseContent {
6379 status,
6380 content,
6381 entity,
6382 }))
6383 }
6384}
6385
6386pub async fn stages_deny_create(
6388 configuration: &configuration::Configuration,
6389 deny_stage_request: models::DenyStageRequest,
6390) -> Result<models::DenyStage, Error<StagesDenyCreateError>> {
6391 let p_body_deny_stage_request = deny_stage_request;
6393
6394 let uri_str = format!("{}/stages/deny/", configuration.base_path);
6395 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6396
6397 if let Some(ref user_agent) = configuration.user_agent {
6398 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6399 }
6400 if let Some(ref token) = configuration.bearer_access_token {
6401 req_builder = req_builder.bearer_auth(token.to_owned());
6402 };
6403 req_builder = req_builder.json(&p_body_deny_stage_request);
6404
6405 let req = req_builder.build()?;
6406 let resp = configuration.client.execute(req).await?;
6407
6408 let status = resp.status();
6409 let content_type = resp
6410 .headers()
6411 .get("content-type")
6412 .and_then(|v| v.to_str().ok())
6413 .unwrap_or("application/octet-stream");
6414 let content_type = super::ContentType::from(content_type);
6415
6416 if !status.is_client_error() && !status.is_server_error() {
6417 let content = resp.text().await?;
6418 match content_type {
6419 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6420 ContentType::Text => {
6421 return Err(Error::from(serde_json::Error::custom(
6422 "Received `text/plain` content type response that cannot be converted to `models::DenyStage`",
6423 )))
6424 }
6425 ContentType::Unsupported(unknown_type) => {
6426 return Err(Error::from(serde_json::Error::custom(format!(
6427 "Received `{unknown_type}` content type response that cannot be converted to `models::DenyStage`"
6428 ))))
6429 }
6430 }
6431 } else {
6432 let content = resp.text().await?;
6433 let entity: Option<StagesDenyCreateError> = serde_json::from_str(&content).ok();
6434 Err(Error::ResponseError(ResponseContent {
6435 status,
6436 content,
6437 entity,
6438 }))
6439 }
6440}
6441
6442pub async fn stages_deny_destroy(
6444 configuration: &configuration::Configuration,
6445 stage_uuid: &str,
6446) -> Result<(), Error<StagesDenyDestroyError>> {
6447 let p_path_stage_uuid = stage_uuid;
6449
6450 let uri_str = format!(
6451 "{}/stages/deny/{stage_uuid}/",
6452 configuration.base_path,
6453 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6454 );
6455 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6456
6457 if let Some(ref user_agent) = configuration.user_agent {
6458 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6459 }
6460 if let Some(ref token) = configuration.bearer_access_token {
6461 req_builder = req_builder.bearer_auth(token.to_owned());
6462 };
6463
6464 let req = req_builder.build()?;
6465 let resp = configuration.client.execute(req).await?;
6466
6467 let status = resp.status();
6468
6469 if !status.is_client_error() && !status.is_server_error() {
6470 Ok(())
6471 } else {
6472 let content = resp.text().await?;
6473 let entity: Option<StagesDenyDestroyError> = serde_json::from_str(&content).ok();
6474 Err(Error::ResponseError(ResponseContent {
6475 status,
6476 content,
6477 entity,
6478 }))
6479 }
6480}
6481
6482pub async fn stages_deny_list(
6484 configuration: &configuration::Configuration,
6485 deny_message: Option<&str>,
6486 name: Option<&str>,
6487 ordering: Option<&str>,
6488 page: Option<i32>,
6489 page_size: Option<i32>,
6490 search: Option<&str>,
6491 stage_uuid: Option<&str>,
6492) -> Result<models::PaginatedDenyStageList, Error<StagesDenyListError>> {
6493 let p_query_deny_message = deny_message;
6495 let p_query_name = name;
6496 let p_query_ordering = ordering;
6497 let p_query_page = page;
6498 let p_query_page_size = page_size;
6499 let p_query_search = search;
6500 let p_query_stage_uuid = stage_uuid;
6501
6502 let uri_str = format!("{}/stages/deny/", configuration.base_path);
6503 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6504
6505 if let Some(ref param_value) = p_query_deny_message {
6506 req_builder = req_builder.query(&[("deny_message", ¶m_value.to_string())]);
6507 }
6508 if let Some(ref param_value) = p_query_name {
6509 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
6510 }
6511 if let Some(ref param_value) = p_query_ordering {
6512 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
6513 }
6514 if let Some(ref param_value) = p_query_page {
6515 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
6516 }
6517 if let Some(ref param_value) = p_query_page_size {
6518 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
6519 }
6520 if let Some(ref param_value) = p_query_search {
6521 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
6522 }
6523 if let Some(ref param_value) = p_query_stage_uuid {
6524 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
6525 }
6526 if let Some(ref user_agent) = configuration.user_agent {
6527 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6528 }
6529 if let Some(ref token) = configuration.bearer_access_token {
6530 req_builder = req_builder.bearer_auth(token.to_owned());
6531 };
6532
6533 let req = req_builder.build()?;
6534 let resp = configuration.client.execute(req).await?;
6535
6536 let status = resp.status();
6537 let content_type = resp
6538 .headers()
6539 .get("content-type")
6540 .and_then(|v| v.to_str().ok())
6541 .unwrap_or("application/octet-stream");
6542 let content_type = super::ContentType::from(content_type);
6543
6544 if !status.is_client_error() && !status.is_server_error() {
6545 let content = resp.text().await?;
6546 match content_type {
6547 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6548 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedDenyStageList`"))),
6549 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedDenyStageList`")))),
6550 }
6551 } else {
6552 let content = resp.text().await?;
6553 let entity: Option<StagesDenyListError> = serde_json::from_str(&content).ok();
6554 Err(Error::ResponseError(ResponseContent {
6555 status,
6556 content,
6557 entity,
6558 }))
6559 }
6560}
6561
6562pub async fn stages_deny_partial_update(
6564 configuration: &configuration::Configuration,
6565 stage_uuid: &str,
6566 patched_deny_stage_request: Option<models::PatchedDenyStageRequest>,
6567) -> Result<models::DenyStage, Error<StagesDenyPartialUpdateError>> {
6568 let p_path_stage_uuid = stage_uuid;
6570 let p_body_patched_deny_stage_request = patched_deny_stage_request;
6571
6572 let uri_str = format!(
6573 "{}/stages/deny/{stage_uuid}/",
6574 configuration.base_path,
6575 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6576 );
6577 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6578
6579 if let Some(ref user_agent) = configuration.user_agent {
6580 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6581 }
6582 if let Some(ref token) = configuration.bearer_access_token {
6583 req_builder = req_builder.bearer_auth(token.to_owned());
6584 };
6585 req_builder = req_builder.json(&p_body_patched_deny_stage_request);
6586
6587 let req = req_builder.build()?;
6588 let resp = configuration.client.execute(req).await?;
6589
6590 let status = resp.status();
6591 let content_type = resp
6592 .headers()
6593 .get("content-type")
6594 .and_then(|v| v.to_str().ok())
6595 .unwrap_or("application/octet-stream");
6596 let content_type = super::ContentType::from(content_type);
6597
6598 if !status.is_client_error() && !status.is_server_error() {
6599 let content = resp.text().await?;
6600 match content_type {
6601 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6602 ContentType::Text => {
6603 return Err(Error::from(serde_json::Error::custom(
6604 "Received `text/plain` content type response that cannot be converted to `models::DenyStage`",
6605 )))
6606 }
6607 ContentType::Unsupported(unknown_type) => {
6608 return Err(Error::from(serde_json::Error::custom(format!(
6609 "Received `{unknown_type}` content type response that cannot be converted to `models::DenyStage`"
6610 ))))
6611 }
6612 }
6613 } else {
6614 let content = resp.text().await?;
6615 let entity: Option<StagesDenyPartialUpdateError> = serde_json::from_str(&content).ok();
6616 Err(Error::ResponseError(ResponseContent {
6617 status,
6618 content,
6619 entity,
6620 }))
6621 }
6622}
6623
6624pub async fn stages_deny_retrieve(
6626 configuration: &configuration::Configuration,
6627 stage_uuid: &str,
6628) -> Result<models::DenyStage, Error<StagesDenyRetrieveError>> {
6629 let p_path_stage_uuid = stage_uuid;
6631
6632 let uri_str = format!(
6633 "{}/stages/deny/{stage_uuid}/",
6634 configuration.base_path,
6635 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6636 );
6637 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6638
6639 if let Some(ref user_agent) = configuration.user_agent {
6640 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6641 }
6642 if let Some(ref token) = configuration.bearer_access_token {
6643 req_builder = req_builder.bearer_auth(token.to_owned());
6644 };
6645
6646 let req = req_builder.build()?;
6647 let resp = configuration.client.execute(req).await?;
6648
6649 let status = resp.status();
6650 let content_type = resp
6651 .headers()
6652 .get("content-type")
6653 .and_then(|v| v.to_str().ok())
6654 .unwrap_or("application/octet-stream");
6655 let content_type = super::ContentType::from(content_type);
6656
6657 if !status.is_client_error() && !status.is_server_error() {
6658 let content = resp.text().await?;
6659 match content_type {
6660 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6661 ContentType::Text => {
6662 return Err(Error::from(serde_json::Error::custom(
6663 "Received `text/plain` content type response that cannot be converted to `models::DenyStage`",
6664 )))
6665 }
6666 ContentType::Unsupported(unknown_type) => {
6667 return Err(Error::from(serde_json::Error::custom(format!(
6668 "Received `{unknown_type}` content type response that cannot be converted to `models::DenyStage`"
6669 ))))
6670 }
6671 }
6672 } else {
6673 let content = resp.text().await?;
6674 let entity: Option<StagesDenyRetrieveError> = serde_json::from_str(&content).ok();
6675 Err(Error::ResponseError(ResponseContent {
6676 status,
6677 content,
6678 entity,
6679 }))
6680 }
6681}
6682
6683pub async fn stages_deny_update(
6685 configuration: &configuration::Configuration,
6686 stage_uuid: &str,
6687 deny_stage_request: models::DenyStageRequest,
6688) -> Result<models::DenyStage, Error<StagesDenyUpdateError>> {
6689 let p_path_stage_uuid = stage_uuid;
6691 let p_body_deny_stage_request = deny_stage_request;
6692
6693 let uri_str = format!(
6694 "{}/stages/deny/{stage_uuid}/",
6695 configuration.base_path,
6696 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6697 );
6698 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6699
6700 if let Some(ref user_agent) = configuration.user_agent {
6701 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6702 }
6703 if let Some(ref token) = configuration.bearer_access_token {
6704 req_builder = req_builder.bearer_auth(token.to_owned());
6705 };
6706 req_builder = req_builder.json(&p_body_deny_stage_request);
6707
6708 let req = req_builder.build()?;
6709 let resp = configuration.client.execute(req).await?;
6710
6711 let status = resp.status();
6712 let content_type = resp
6713 .headers()
6714 .get("content-type")
6715 .and_then(|v| v.to_str().ok())
6716 .unwrap_or("application/octet-stream");
6717 let content_type = super::ContentType::from(content_type);
6718
6719 if !status.is_client_error() && !status.is_server_error() {
6720 let content = resp.text().await?;
6721 match content_type {
6722 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6723 ContentType::Text => {
6724 return Err(Error::from(serde_json::Error::custom(
6725 "Received `text/plain` content type response that cannot be converted to `models::DenyStage`",
6726 )))
6727 }
6728 ContentType::Unsupported(unknown_type) => {
6729 return Err(Error::from(serde_json::Error::custom(format!(
6730 "Received `{unknown_type}` content type response that cannot be converted to `models::DenyStage`"
6731 ))))
6732 }
6733 }
6734 } else {
6735 let content = resp.text().await?;
6736 let entity: Option<StagesDenyUpdateError> = serde_json::from_str(&content).ok();
6737 Err(Error::ResponseError(ResponseContent {
6738 status,
6739 content,
6740 entity,
6741 }))
6742 }
6743}
6744
6745pub async fn stages_deny_used_by_list(
6747 configuration: &configuration::Configuration,
6748 stage_uuid: &str,
6749) -> Result<Vec<models::UsedBy>, Error<StagesDenyUsedByListError>> {
6750 let p_path_stage_uuid = stage_uuid;
6752
6753 let uri_str = format!(
6754 "{}/stages/deny/{stage_uuid}/used_by/",
6755 configuration.base_path,
6756 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6757 );
6758 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6759
6760 if let Some(ref user_agent) = configuration.user_agent {
6761 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6762 }
6763 if let Some(ref token) = configuration.bearer_access_token {
6764 req_builder = req_builder.bearer_auth(token.to_owned());
6765 };
6766
6767 let req = req_builder.build()?;
6768 let resp = configuration.client.execute(req).await?;
6769
6770 let status = resp.status();
6771 let content_type = resp
6772 .headers()
6773 .get("content-type")
6774 .and_then(|v| v.to_str().ok())
6775 .unwrap_or("application/octet-stream");
6776 let content_type = super::ContentType::from(content_type);
6777
6778 if !status.is_client_error() && !status.is_server_error() {
6779 let content = resp.text().await?;
6780 match content_type {
6781 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6782 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
6783 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>`")))),
6784 }
6785 } else {
6786 let content = resp.text().await?;
6787 let entity: Option<StagesDenyUsedByListError> = serde_json::from_str(&content).ok();
6788 Err(Error::ResponseError(ResponseContent {
6789 status,
6790 content,
6791 entity,
6792 }))
6793 }
6794}
6795
6796pub async fn stages_dummy_create(
6798 configuration: &configuration::Configuration,
6799 dummy_stage_request: models::DummyStageRequest,
6800) -> Result<models::DummyStage, Error<StagesDummyCreateError>> {
6801 let p_body_dummy_stage_request = dummy_stage_request;
6803
6804 let uri_str = format!("{}/stages/dummy/", configuration.base_path);
6805 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6806
6807 if let Some(ref user_agent) = configuration.user_agent {
6808 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6809 }
6810 if let Some(ref token) = configuration.bearer_access_token {
6811 req_builder = req_builder.bearer_auth(token.to_owned());
6812 };
6813 req_builder = req_builder.json(&p_body_dummy_stage_request);
6814
6815 let req = req_builder.build()?;
6816 let resp = configuration.client.execute(req).await?;
6817
6818 let status = resp.status();
6819 let content_type = resp
6820 .headers()
6821 .get("content-type")
6822 .and_then(|v| v.to_str().ok())
6823 .unwrap_or("application/octet-stream");
6824 let content_type = super::ContentType::from(content_type);
6825
6826 if !status.is_client_error() && !status.is_server_error() {
6827 let content = resp.text().await?;
6828 match content_type {
6829 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6830 ContentType::Text => {
6831 return Err(Error::from(serde_json::Error::custom(
6832 "Received `text/plain` content type response that cannot be converted to `models::DummyStage`",
6833 )))
6834 }
6835 ContentType::Unsupported(unknown_type) => {
6836 return Err(Error::from(serde_json::Error::custom(format!(
6837 "Received `{unknown_type}` content type response that cannot be converted to `models::DummyStage`"
6838 ))))
6839 }
6840 }
6841 } else {
6842 let content = resp.text().await?;
6843 let entity: Option<StagesDummyCreateError> = serde_json::from_str(&content).ok();
6844 Err(Error::ResponseError(ResponseContent {
6845 status,
6846 content,
6847 entity,
6848 }))
6849 }
6850}
6851
6852pub async fn stages_dummy_destroy(
6854 configuration: &configuration::Configuration,
6855 stage_uuid: &str,
6856) -> Result<(), Error<StagesDummyDestroyError>> {
6857 let p_path_stage_uuid = stage_uuid;
6859
6860 let uri_str = format!(
6861 "{}/stages/dummy/{stage_uuid}/",
6862 configuration.base_path,
6863 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6864 );
6865 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6866
6867 if let Some(ref user_agent) = configuration.user_agent {
6868 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6869 }
6870 if let Some(ref token) = configuration.bearer_access_token {
6871 req_builder = req_builder.bearer_auth(token.to_owned());
6872 };
6873
6874 let req = req_builder.build()?;
6875 let resp = configuration.client.execute(req).await?;
6876
6877 let status = resp.status();
6878
6879 if !status.is_client_error() && !status.is_server_error() {
6880 Ok(())
6881 } else {
6882 let content = resp.text().await?;
6883 let entity: Option<StagesDummyDestroyError> = serde_json::from_str(&content).ok();
6884 Err(Error::ResponseError(ResponseContent {
6885 status,
6886 content,
6887 entity,
6888 }))
6889 }
6890}
6891
6892pub async fn stages_dummy_list(
6894 configuration: &configuration::Configuration,
6895 name: Option<&str>,
6896 ordering: Option<&str>,
6897 page: Option<i32>,
6898 page_size: Option<i32>,
6899 search: Option<&str>,
6900 stage_uuid: Option<&str>,
6901 throw_error: Option<bool>,
6902) -> Result<models::PaginatedDummyStageList, Error<StagesDummyListError>> {
6903 let p_query_name = name;
6905 let p_query_ordering = ordering;
6906 let p_query_page = page;
6907 let p_query_page_size = page_size;
6908 let p_query_search = search;
6909 let p_query_stage_uuid = stage_uuid;
6910 let p_query_throw_error = throw_error;
6911
6912 let uri_str = format!("{}/stages/dummy/", configuration.base_path);
6913 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6914
6915 if let Some(ref param_value) = p_query_name {
6916 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
6917 }
6918 if let Some(ref param_value) = p_query_ordering {
6919 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
6920 }
6921 if let Some(ref param_value) = p_query_page {
6922 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
6923 }
6924 if let Some(ref param_value) = p_query_page_size {
6925 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
6926 }
6927 if let Some(ref param_value) = p_query_search {
6928 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
6929 }
6930 if let Some(ref param_value) = p_query_stage_uuid {
6931 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
6932 }
6933 if let Some(ref param_value) = p_query_throw_error {
6934 req_builder = req_builder.query(&[("throw_error", ¶m_value.to_string())]);
6935 }
6936 if let Some(ref user_agent) = configuration.user_agent {
6937 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6938 }
6939 if let Some(ref token) = configuration.bearer_access_token {
6940 req_builder = req_builder.bearer_auth(token.to_owned());
6941 };
6942
6943 let req = req_builder.build()?;
6944 let resp = configuration.client.execute(req).await?;
6945
6946 let status = resp.status();
6947 let content_type = resp
6948 .headers()
6949 .get("content-type")
6950 .and_then(|v| v.to_str().ok())
6951 .unwrap_or("application/octet-stream");
6952 let content_type = super::ContentType::from(content_type);
6953
6954 if !status.is_client_error() && !status.is_server_error() {
6955 let content = resp.text().await?;
6956 match content_type {
6957 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6958 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedDummyStageList`"))),
6959 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedDummyStageList`")))),
6960 }
6961 } else {
6962 let content = resp.text().await?;
6963 let entity: Option<StagesDummyListError> = serde_json::from_str(&content).ok();
6964 Err(Error::ResponseError(ResponseContent {
6965 status,
6966 content,
6967 entity,
6968 }))
6969 }
6970}
6971
6972pub async fn stages_dummy_partial_update(
6974 configuration: &configuration::Configuration,
6975 stage_uuid: &str,
6976 patched_dummy_stage_request: Option<models::PatchedDummyStageRequest>,
6977) -> Result<models::DummyStage, Error<StagesDummyPartialUpdateError>> {
6978 let p_path_stage_uuid = stage_uuid;
6980 let p_body_patched_dummy_stage_request = patched_dummy_stage_request;
6981
6982 let uri_str = format!(
6983 "{}/stages/dummy/{stage_uuid}/",
6984 configuration.base_path,
6985 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
6986 );
6987 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6988
6989 if let Some(ref user_agent) = configuration.user_agent {
6990 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6991 }
6992 if let Some(ref token) = configuration.bearer_access_token {
6993 req_builder = req_builder.bearer_auth(token.to_owned());
6994 };
6995 req_builder = req_builder.json(&p_body_patched_dummy_stage_request);
6996
6997 let req = req_builder.build()?;
6998 let resp = configuration.client.execute(req).await?;
6999
7000 let status = resp.status();
7001 let content_type = resp
7002 .headers()
7003 .get("content-type")
7004 .and_then(|v| v.to_str().ok())
7005 .unwrap_or("application/octet-stream");
7006 let content_type = super::ContentType::from(content_type);
7007
7008 if !status.is_client_error() && !status.is_server_error() {
7009 let content = resp.text().await?;
7010 match content_type {
7011 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7012 ContentType::Text => {
7013 return Err(Error::from(serde_json::Error::custom(
7014 "Received `text/plain` content type response that cannot be converted to `models::DummyStage`",
7015 )))
7016 }
7017 ContentType::Unsupported(unknown_type) => {
7018 return Err(Error::from(serde_json::Error::custom(format!(
7019 "Received `{unknown_type}` content type response that cannot be converted to `models::DummyStage`"
7020 ))))
7021 }
7022 }
7023 } else {
7024 let content = resp.text().await?;
7025 let entity: Option<StagesDummyPartialUpdateError> = serde_json::from_str(&content).ok();
7026 Err(Error::ResponseError(ResponseContent {
7027 status,
7028 content,
7029 entity,
7030 }))
7031 }
7032}
7033
7034pub async fn stages_dummy_retrieve(
7036 configuration: &configuration::Configuration,
7037 stage_uuid: &str,
7038) -> Result<models::DummyStage, Error<StagesDummyRetrieveError>> {
7039 let p_path_stage_uuid = stage_uuid;
7041
7042 let uri_str = format!(
7043 "{}/stages/dummy/{stage_uuid}/",
7044 configuration.base_path,
7045 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7046 );
7047 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7048
7049 if let Some(ref user_agent) = configuration.user_agent {
7050 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7051 }
7052 if let Some(ref token) = configuration.bearer_access_token {
7053 req_builder = req_builder.bearer_auth(token.to_owned());
7054 };
7055
7056 let req = req_builder.build()?;
7057 let resp = configuration.client.execute(req).await?;
7058
7059 let status = resp.status();
7060 let content_type = resp
7061 .headers()
7062 .get("content-type")
7063 .and_then(|v| v.to_str().ok())
7064 .unwrap_or("application/octet-stream");
7065 let content_type = super::ContentType::from(content_type);
7066
7067 if !status.is_client_error() && !status.is_server_error() {
7068 let content = resp.text().await?;
7069 match content_type {
7070 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7071 ContentType::Text => {
7072 return Err(Error::from(serde_json::Error::custom(
7073 "Received `text/plain` content type response that cannot be converted to `models::DummyStage`",
7074 )))
7075 }
7076 ContentType::Unsupported(unknown_type) => {
7077 return Err(Error::from(serde_json::Error::custom(format!(
7078 "Received `{unknown_type}` content type response that cannot be converted to `models::DummyStage`"
7079 ))))
7080 }
7081 }
7082 } else {
7083 let content = resp.text().await?;
7084 let entity: Option<StagesDummyRetrieveError> = serde_json::from_str(&content).ok();
7085 Err(Error::ResponseError(ResponseContent {
7086 status,
7087 content,
7088 entity,
7089 }))
7090 }
7091}
7092
7093pub async fn stages_dummy_update(
7095 configuration: &configuration::Configuration,
7096 stage_uuid: &str,
7097 dummy_stage_request: models::DummyStageRequest,
7098) -> Result<models::DummyStage, Error<StagesDummyUpdateError>> {
7099 let p_path_stage_uuid = stage_uuid;
7101 let p_body_dummy_stage_request = dummy_stage_request;
7102
7103 let uri_str = format!(
7104 "{}/stages/dummy/{stage_uuid}/",
7105 configuration.base_path,
7106 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7107 );
7108 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7109
7110 if let Some(ref user_agent) = configuration.user_agent {
7111 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7112 }
7113 if let Some(ref token) = configuration.bearer_access_token {
7114 req_builder = req_builder.bearer_auth(token.to_owned());
7115 };
7116 req_builder = req_builder.json(&p_body_dummy_stage_request);
7117
7118 let req = req_builder.build()?;
7119 let resp = configuration.client.execute(req).await?;
7120
7121 let status = resp.status();
7122 let content_type = resp
7123 .headers()
7124 .get("content-type")
7125 .and_then(|v| v.to_str().ok())
7126 .unwrap_or("application/octet-stream");
7127 let content_type = super::ContentType::from(content_type);
7128
7129 if !status.is_client_error() && !status.is_server_error() {
7130 let content = resp.text().await?;
7131 match content_type {
7132 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7133 ContentType::Text => {
7134 return Err(Error::from(serde_json::Error::custom(
7135 "Received `text/plain` content type response that cannot be converted to `models::DummyStage`",
7136 )))
7137 }
7138 ContentType::Unsupported(unknown_type) => {
7139 return Err(Error::from(serde_json::Error::custom(format!(
7140 "Received `{unknown_type}` content type response that cannot be converted to `models::DummyStage`"
7141 ))))
7142 }
7143 }
7144 } else {
7145 let content = resp.text().await?;
7146 let entity: Option<StagesDummyUpdateError> = serde_json::from_str(&content).ok();
7147 Err(Error::ResponseError(ResponseContent {
7148 status,
7149 content,
7150 entity,
7151 }))
7152 }
7153}
7154
7155pub async fn stages_dummy_used_by_list(
7157 configuration: &configuration::Configuration,
7158 stage_uuid: &str,
7159) -> Result<Vec<models::UsedBy>, Error<StagesDummyUsedByListError>> {
7160 let p_path_stage_uuid = stage_uuid;
7162
7163 let uri_str = format!(
7164 "{}/stages/dummy/{stage_uuid}/used_by/",
7165 configuration.base_path,
7166 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7167 );
7168 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7169
7170 if let Some(ref user_agent) = configuration.user_agent {
7171 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7172 }
7173 if let Some(ref token) = configuration.bearer_access_token {
7174 req_builder = req_builder.bearer_auth(token.to_owned());
7175 };
7176
7177 let req = req_builder.build()?;
7178 let resp = configuration.client.execute(req).await?;
7179
7180 let status = resp.status();
7181 let content_type = resp
7182 .headers()
7183 .get("content-type")
7184 .and_then(|v| v.to_str().ok())
7185 .unwrap_or("application/octet-stream");
7186 let content_type = super::ContentType::from(content_type);
7187
7188 if !status.is_client_error() && !status.is_server_error() {
7189 let content = resp.text().await?;
7190 match content_type {
7191 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7192 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
7193 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>`")))),
7194 }
7195 } else {
7196 let content = resp.text().await?;
7197 let entity: Option<StagesDummyUsedByListError> = serde_json::from_str(&content).ok();
7198 Err(Error::ResponseError(ResponseContent {
7199 status,
7200 content,
7201 entity,
7202 }))
7203 }
7204}
7205
7206pub async fn stages_email_create(
7208 configuration: &configuration::Configuration,
7209 email_stage_request: models::EmailStageRequest,
7210) -> Result<models::EmailStage, Error<StagesEmailCreateError>> {
7211 let p_body_email_stage_request = email_stage_request;
7213
7214 let uri_str = format!("{}/stages/email/", configuration.base_path);
7215 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7216
7217 if let Some(ref user_agent) = configuration.user_agent {
7218 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7219 }
7220 if let Some(ref token) = configuration.bearer_access_token {
7221 req_builder = req_builder.bearer_auth(token.to_owned());
7222 };
7223 req_builder = req_builder.json(&p_body_email_stage_request);
7224
7225 let req = req_builder.build()?;
7226 let resp = configuration.client.execute(req).await?;
7227
7228 let status = resp.status();
7229 let content_type = resp
7230 .headers()
7231 .get("content-type")
7232 .and_then(|v| v.to_str().ok())
7233 .unwrap_or("application/octet-stream");
7234 let content_type = super::ContentType::from(content_type);
7235
7236 if !status.is_client_error() && !status.is_server_error() {
7237 let content = resp.text().await?;
7238 match content_type {
7239 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7240 ContentType::Text => {
7241 return Err(Error::from(serde_json::Error::custom(
7242 "Received `text/plain` content type response that cannot be converted to `models::EmailStage`",
7243 )))
7244 }
7245 ContentType::Unsupported(unknown_type) => {
7246 return Err(Error::from(serde_json::Error::custom(format!(
7247 "Received `{unknown_type}` content type response that cannot be converted to `models::EmailStage`"
7248 ))))
7249 }
7250 }
7251 } else {
7252 let content = resp.text().await?;
7253 let entity: Option<StagesEmailCreateError> = serde_json::from_str(&content).ok();
7254 Err(Error::ResponseError(ResponseContent {
7255 status,
7256 content,
7257 entity,
7258 }))
7259 }
7260}
7261
7262pub async fn stages_email_destroy(
7264 configuration: &configuration::Configuration,
7265 stage_uuid: &str,
7266) -> Result<(), Error<StagesEmailDestroyError>> {
7267 let p_path_stage_uuid = stage_uuid;
7269
7270 let uri_str = format!(
7271 "{}/stages/email/{stage_uuid}/",
7272 configuration.base_path,
7273 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7274 );
7275 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7276
7277 if let Some(ref user_agent) = configuration.user_agent {
7278 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7279 }
7280 if let Some(ref token) = configuration.bearer_access_token {
7281 req_builder = req_builder.bearer_auth(token.to_owned());
7282 };
7283
7284 let req = req_builder.build()?;
7285 let resp = configuration.client.execute(req).await?;
7286
7287 let status = resp.status();
7288
7289 if !status.is_client_error() && !status.is_server_error() {
7290 Ok(())
7291 } else {
7292 let content = resp.text().await?;
7293 let entity: Option<StagesEmailDestroyError> = serde_json::from_str(&content).ok();
7294 Err(Error::ResponseError(ResponseContent {
7295 status,
7296 content,
7297 entity,
7298 }))
7299 }
7300}
7301
7302pub async fn stages_email_list(
7304 configuration: &configuration::Configuration,
7305 activate_user_on_success: Option<bool>,
7306 from_address: Option<&str>,
7307 host: Option<&str>,
7308 name: Option<&str>,
7309 ordering: Option<&str>,
7310 page: Option<i32>,
7311 page_size: Option<i32>,
7312 port: Option<i32>,
7313 search: Option<&str>,
7314 subject: Option<&str>,
7315 template: Option<&str>,
7316 timeout: Option<i32>,
7317 token_expiry: Option<&str>,
7318 use_global_settings: Option<bool>,
7319 use_ssl: Option<bool>,
7320 use_tls: Option<bool>,
7321 username: Option<&str>,
7322) -> Result<models::PaginatedEmailStageList, Error<StagesEmailListError>> {
7323 let p_query_activate_user_on_success = activate_user_on_success;
7325 let p_query_from_address = from_address;
7326 let p_query_host = host;
7327 let p_query_name = name;
7328 let p_query_ordering = ordering;
7329 let p_query_page = page;
7330 let p_query_page_size = page_size;
7331 let p_query_port = port;
7332 let p_query_search = search;
7333 let p_query_subject = subject;
7334 let p_query_template = template;
7335 let p_query_timeout = timeout;
7336 let p_query_token_expiry = token_expiry;
7337 let p_query_use_global_settings = use_global_settings;
7338 let p_query_use_ssl = use_ssl;
7339 let p_query_use_tls = use_tls;
7340 let p_query_username = username;
7341
7342 let uri_str = format!("{}/stages/email/", configuration.base_path);
7343 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7344
7345 if let Some(ref param_value) = p_query_activate_user_on_success {
7346 req_builder = req_builder.query(&[("activate_user_on_success", ¶m_value.to_string())]);
7347 }
7348 if let Some(ref param_value) = p_query_from_address {
7349 req_builder = req_builder.query(&[("from_address", ¶m_value.to_string())]);
7350 }
7351 if let Some(ref param_value) = p_query_host {
7352 req_builder = req_builder.query(&[("host", ¶m_value.to_string())]);
7353 }
7354 if let Some(ref param_value) = p_query_name {
7355 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
7356 }
7357 if let Some(ref param_value) = p_query_ordering {
7358 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
7359 }
7360 if let Some(ref param_value) = p_query_page {
7361 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
7362 }
7363 if let Some(ref param_value) = p_query_page_size {
7364 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
7365 }
7366 if let Some(ref param_value) = p_query_port {
7367 req_builder = req_builder.query(&[("port", ¶m_value.to_string())]);
7368 }
7369 if let Some(ref param_value) = p_query_search {
7370 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
7371 }
7372 if let Some(ref param_value) = p_query_subject {
7373 req_builder = req_builder.query(&[("subject", ¶m_value.to_string())]);
7374 }
7375 if let Some(ref param_value) = p_query_template {
7376 req_builder = req_builder.query(&[("template", ¶m_value.to_string())]);
7377 }
7378 if let Some(ref param_value) = p_query_timeout {
7379 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
7380 }
7381 if let Some(ref param_value) = p_query_token_expiry {
7382 req_builder = req_builder.query(&[("token_expiry", ¶m_value.to_string())]);
7383 }
7384 if let Some(ref param_value) = p_query_use_global_settings {
7385 req_builder = req_builder.query(&[("use_global_settings", ¶m_value.to_string())]);
7386 }
7387 if let Some(ref param_value) = p_query_use_ssl {
7388 req_builder = req_builder.query(&[("use_ssl", ¶m_value.to_string())]);
7389 }
7390 if let Some(ref param_value) = p_query_use_tls {
7391 req_builder = req_builder.query(&[("use_tls", ¶m_value.to_string())]);
7392 }
7393 if let Some(ref param_value) = p_query_username {
7394 req_builder = req_builder.query(&[("username", ¶m_value.to_string())]);
7395 }
7396 if let Some(ref user_agent) = configuration.user_agent {
7397 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7398 }
7399 if let Some(ref token) = configuration.bearer_access_token {
7400 req_builder = req_builder.bearer_auth(token.to_owned());
7401 };
7402
7403 let req = req_builder.build()?;
7404 let resp = configuration.client.execute(req).await?;
7405
7406 let status = resp.status();
7407 let content_type = resp
7408 .headers()
7409 .get("content-type")
7410 .and_then(|v| v.to_str().ok())
7411 .unwrap_or("application/octet-stream");
7412 let content_type = super::ContentType::from(content_type);
7413
7414 if !status.is_client_error() && !status.is_server_error() {
7415 let content = resp.text().await?;
7416 match content_type {
7417 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7418 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedEmailStageList`"))),
7419 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedEmailStageList`")))),
7420 }
7421 } else {
7422 let content = resp.text().await?;
7423 let entity: Option<StagesEmailListError> = serde_json::from_str(&content).ok();
7424 Err(Error::ResponseError(ResponseContent {
7425 status,
7426 content,
7427 entity,
7428 }))
7429 }
7430}
7431
7432pub async fn stages_email_partial_update(
7434 configuration: &configuration::Configuration,
7435 stage_uuid: &str,
7436 patched_email_stage_request: Option<models::PatchedEmailStageRequest>,
7437) -> Result<models::EmailStage, Error<StagesEmailPartialUpdateError>> {
7438 let p_path_stage_uuid = stage_uuid;
7440 let p_body_patched_email_stage_request = patched_email_stage_request;
7441
7442 let uri_str = format!(
7443 "{}/stages/email/{stage_uuid}/",
7444 configuration.base_path,
7445 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7446 );
7447 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7448
7449 if let Some(ref user_agent) = configuration.user_agent {
7450 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7451 }
7452 if let Some(ref token) = configuration.bearer_access_token {
7453 req_builder = req_builder.bearer_auth(token.to_owned());
7454 };
7455 req_builder = req_builder.json(&p_body_patched_email_stage_request);
7456
7457 let req = req_builder.build()?;
7458 let resp = configuration.client.execute(req).await?;
7459
7460 let status = resp.status();
7461 let content_type = resp
7462 .headers()
7463 .get("content-type")
7464 .and_then(|v| v.to_str().ok())
7465 .unwrap_or("application/octet-stream");
7466 let content_type = super::ContentType::from(content_type);
7467
7468 if !status.is_client_error() && !status.is_server_error() {
7469 let content = resp.text().await?;
7470 match content_type {
7471 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7472 ContentType::Text => {
7473 return Err(Error::from(serde_json::Error::custom(
7474 "Received `text/plain` content type response that cannot be converted to `models::EmailStage`",
7475 )))
7476 }
7477 ContentType::Unsupported(unknown_type) => {
7478 return Err(Error::from(serde_json::Error::custom(format!(
7479 "Received `{unknown_type}` content type response that cannot be converted to `models::EmailStage`"
7480 ))))
7481 }
7482 }
7483 } else {
7484 let content = resp.text().await?;
7485 let entity: Option<StagesEmailPartialUpdateError> = serde_json::from_str(&content).ok();
7486 Err(Error::ResponseError(ResponseContent {
7487 status,
7488 content,
7489 entity,
7490 }))
7491 }
7492}
7493
7494pub async fn stages_email_retrieve(
7496 configuration: &configuration::Configuration,
7497 stage_uuid: &str,
7498) -> Result<models::EmailStage, Error<StagesEmailRetrieveError>> {
7499 let p_path_stage_uuid = stage_uuid;
7501
7502 let uri_str = format!(
7503 "{}/stages/email/{stage_uuid}/",
7504 configuration.base_path,
7505 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7506 );
7507 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7508
7509 if let Some(ref user_agent) = configuration.user_agent {
7510 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7511 }
7512 if let Some(ref token) = configuration.bearer_access_token {
7513 req_builder = req_builder.bearer_auth(token.to_owned());
7514 };
7515
7516 let req = req_builder.build()?;
7517 let resp = configuration.client.execute(req).await?;
7518
7519 let status = resp.status();
7520 let content_type = resp
7521 .headers()
7522 .get("content-type")
7523 .and_then(|v| v.to_str().ok())
7524 .unwrap_or("application/octet-stream");
7525 let content_type = super::ContentType::from(content_type);
7526
7527 if !status.is_client_error() && !status.is_server_error() {
7528 let content = resp.text().await?;
7529 match content_type {
7530 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7531 ContentType::Text => {
7532 return Err(Error::from(serde_json::Error::custom(
7533 "Received `text/plain` content type response that cannot be converted to `models::EmailStage`",
7534 )))
7535 }
7536 ContentType::Unsupported(unknown_type) => {
7537 return Err(Error::from(serde_json::Error::custom(format!(
7538 "Received `{unknown_type}` content type response that cannot be converted to `models::EmailStage`"
7539 ))))
7540 }
7541 }
7542 } else {
7543 let content = resp.text().await?;
7544 let entity: Option<StagesEmailRetrieveError> = serde_json::from_str(&content).ok();
7545 Err(Error::ResponseError(ResponseContent {
7546 status,
7547 content,
7548 entity,
7549 }))
7550 }
7551}
7552
7553pub async fn stages_email_templates_list(
7555 configuration: &configuration::Configuration,
7556) -> Result<Vec<models::TypeCreate>, Error<StagesEmailTemplatesListError>> {
7557 let uri_str = format!("{}/stages/email/templates/", configuration.base_path);
7558 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7559
7560 if let Some(ref user_agent) = configuration.user_agent {
7561 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7562 }
7563 if let Some(ref token) = configuration.bearer_access_token {
7564 req_builder = req_builder.bearer_auth(token.to_owned());
7565 };
7566
7567 let req = req_builder.build()?;
7568 let resp = configuration.client.execute(req).await?;
7569
7570 let status = resp.status();
7571 let content_type = resp
7572 .headers()
7573 .get("content-type")
7574 .and_then(|v| v.to_str().ok())
7575 .unwrap_or("application/octet-stream");
7576 let content_type = super::ContentType::from(content_type);
7577
7578 if !status.is_client_error() && !status.is_server_error() {
7579 let content = resp.text().await?;
7580 match content_type {
7581 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7582 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TypeCreate>`"))),
7583 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>`")))),
7584 }
7585 } else {
7586 let content = resp.text().await?;
7587 let entity: Option<StagesEmailTemplatesListError> = serde_json::from_str(&content).ok();
7588 Err(Error::ResponseError(ResponseContent {
7589 status,
7590 content,
7591 entity,
7592 }))
7593 }
7594}
7595
7596pub async fn stages_email_update(
7598 configuration: &configuration::Configuration,
7599 stage_uuid: &str,
7600 email_stage_request: models::EmailStageRequest,
7601) -> Result<models::EmailStage, Error<StagesEmailUpdateError>> {
7602 let p_path_stage_uuid = stage_uuid;
7604 let p_body_email_stage_request = email_stage_request;
7605
7606 let uri_str = format!(
7607 "{}/stages/email/{stage_uuid}/",
7608 configuration.base_path,
7609 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7610 );
7611 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7612
7613 if let Some(ref user_agent) = configuration.user_agent {
7614 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7615 }
7616 if let Some(ref token) = configuration.bearer_access_token {
7617 req_builder = req_builder.bearer_auth(token.to_owned());
7618 };
7619 req_builder = req_builder.json(&p_body_email_stage_request);
7620
7621 let req = req_builder.build()?;
7622 let resp = configuration.client.execute(req).await?;
7623
7624 let status = resp.status();
7625 let content_type = resp
7626 .headers()
7627 .get("content-type")
7628 .and_then(|v| v.to_str().ok())
7629 .unwrap_or("application/octet-stream");
7630 let content_type = super::ContentType::from(content_type);
7631
7632 if !status.is_client_error() && !status.is_server_error() {
7633 let content = resp.text().await?;
7634 match content_type {
7635 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7636 ContentType::Text => {
7637 return Err(Error::from(serde_json::Error::custom(
7638 "Received `text/plain` content type response that cannot be converted to `models::EmailStage`",
7639 )))
7640 }
7641 ContentType::Unsupported(unknown_type) => {
7642 return Err(Error::from(serde_json::Error::custom(format!(
7643 "Received `{unknown_type}` content type response that cannot be converted to `models::EmailStage`"
7644 ))))
7645 }
7646 }
7647 } else {
7648 let content = resp.text().await?;
7649 let entity: Option<StagesEmailUpdateError> = serde_json::from_str(&content).ok();
7650 Err(Error::ResponseError(ResponseContent {
7651 status,
7652 content,
7653 entity,
7654 }))
7655 }
7656}
7657
7658pub async fn stages_email_used_by_list(
7660 configuration: &configuration::Configuration,
7661 stage_uuid: &str,
7662) -> Result<Vec<models::UsedBy>, Error<StagesEmailUsedByListError>> {
7663 let p_path_stage_uuid = stage_uuid;
7665
7666 let uri_str = format!(
7667 "{}/stages/email/{stage_uuid}/used_by/",
7668 configuration.base_path,
7669 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7670 );
7671 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7672
7673 if let Some(ref user_agent) = configuration.user_agent {
7674 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7675 }
7676 if let Some(ref token) = configuration.bearer_access_token {
7677 req_builder = req_builder.bearer_auth(token.to_owned());
7678 };
7679
7680 let req = req_builder.build()?;
7681 let resp = configuration.client.execute(req).await?;
7682
7683 let status = resp.status();
7684 let content_type = resp
7685 .headers()
7686 .get("content-type")
7687 .and_then(|v| v.to_str().ok())
7688 .unwrap_or("application/octet-stream");
7689 let content_type = super::ContentType::from(content_type);
7690
7691 if !status.is_client_error() && !status.is_server_error() {
7692 let content = resp.text().await?;
7693 match content_type {
7694 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7695 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
7696 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>`")))),
7697 }
7698 } else {
7699 let content = resp.text().await?;
7700 let entity: Option<StagesEmailUsedByListError> = serde_json::from_str(&content).ok();
7701 Err(Error::ResponseError(ResponseContent {
7702 status,
7703 content,
7704 entity,
7705 }))
7706 }
7707}
7708
7709pub async fn stages_identification_create(
7711 configuration: &configuration::Configuration,
7712 identification_stage_request: models::IdentificationStageRequest,
7713) -> Result<models::IdentificationStage, Error<StagesIdentificationCreateError>> {
7714 let p_body_identification_stage_request = identification_stage_request;
7716
7717 let uri_str = format!("{}/stages/identification/", configuration.base_path);
7718 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
7719
7720 if let Some(ref user_agent) = configuration.user_agent {
7721 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7722 }
7723 if let Some(ref token) = configuration.bearer_access_token {
7724 req_builder = req_builder.bearer_auth(token.to_owned());
7725 };
7726 req_builder = req_builder.json(&p_body_identification_stage_request);
7727
7728 let req = req_builder.build()?;
7729 let resp = configuration.client.execute(req).await?;
7730
7731 let status = resp.status();
7732 let content_type = resp
7733 .headers()
7734 .get("content-type")
7735 .and_then(|v| v.to_str().ok())
7736 .unwrap_or("application/octet-stream");
7737 let content_type = super::ContentType::from(content_type);
7738
7739 if !status.is_client_error() && !status.is_server_error() {
7740 let content = resp.text().await?;
7741 match content_type {
7742 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7743 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentificationStage`"))),
7744 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentificationStage`")))),
7745 }
7746 } else {
7747 let content = resp.text().await?;
7748 let entity: Option<StagesIdentificationCreateError> = serde_json::from_str(&content).ok();
7749 Err(Error::ResponseError(ResponseContent {
7750 status,
7751 content,
7752 entity,
7753 }))
7754 }
7755}
7756
7757pub async fn stages_identification_destroy(
7759 configuration: &configuration::Configuration,
7760 stage_uuid: &str,
7761) -> Result<(), Error<StagesIdentificationDestroyError>> {
7762 let p_path_stage_uuid = stage_uuid;
7764
7765 let uri_str = format!(
7766 "{}/stages/identification/{stage_uuid}/",
7767 configuration.base_path,
7768 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7769 );
7770 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7771
7772 if let Some(ref user_agent) = configuration.user_agent {
7773 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7774 }
7775 if let Some(ref token) = configuration.bearer_access_token {
7776 req_builder = req_builder.bearer_auth(token.to_owned());
7777 };
7778
7779 let req = req_builder.build()?;
7780 let resp = configuration.client.execute(req).await?;
7781
7782 let status = resp.status();
7783
7784 if !status.is_client_error() && !status.is_server_error() {
7785 Ok(())
7786 } else {
7787 let content = resp.text().await?;
7788 let entity: Option<StagesIdentificationDestroyError> = serde_json::from_str(&content).ok();
7789 Err(Error::ResponseError(ResponseContent {
7790 status,
7791 content,
7792 entity,
7793 }))
7794 }
7795}
7796
7797pub async fn stages_identification_list(
7799 configuration: &configuration::Configuration,
7800 captcha_stage: Option<&str>,
7801 case_insensitive_matching: Option<bool>,
7802 enrollment_flow: Option<&str>,
7803 name: Option<&str>,
7804 ordering: Option<&str>,
7805 page: Option<i32>,
7806 page_size: Option<i32>,
7807 password_stage: Option<&str>,
7808 passwordless_flow: Option<&str>,
7809 recovery_flow: Option<&str>,
7810 search: Option<&str>,
7811 show_matched_user: Option<bool>,
7812 show_source_labels: Option<bool>,
7813) -> Result<models::PaginatedIdentificationStageList, Error<StagesIdentificationListError>> {
7814 let p_query_captcha_stage = captcha_stage;
7816 let p_query_case_insensitive_matching = case_insensitive_matching;
7817 let p_query_enrollment_flow = enrollment_flow;
7818 let p_query_name = name;
7819 let p_query_ordering = ordering;
7820 let p_query_page = page;
7821 let p_query_page_size = page_size;
7822 let p_query_password_stage = password_stage;
7823 let p_query_passwordless_flow = passwordless_flow;
7824 let p_query_recovery_flow = recovery_flow;
7825 let p_query_search = search;
7826 let p_query_show_matched_user = show_matched_user;
7827 let p_query_show_source_labels = show_source_labels;
7828
7829 let uri_str = format!("{}/stages/identification/", configuration.base_path);
7830 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7831
7832 if let Some(ref param_value) = p_query_captcha_stage {
7833 req_builder = req_builder.query(&[("captcha_stage", ¶m_value.to_string())]);
7834 }
7835 if let Some(ref param_value) = p_query_case_insensitive_matching {
7836 req_builder = req_builder.query(&[("case_insensitive_matching", ¶m_value.to_string())]);
7837 }
7838 if let Some(ref param_value) = p_query_enrollment_flow {
7839 req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]);
7840 }
7841 if let Some(ref param_value) = p_query_name {
7842 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
7843 }
7844 if let Some(ref param_value) = p_query_ordering {
7845 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
7846 }
7847 if let Some(ref param_value) = p_query_page {
7848 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
7849 }
7850 if let Some(ref param_value) = p_query_page_size {
7851 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
7852 }
7853 if let Some(ref param_value) = p_query_password_stage {
7854 req_builder = req_builder.query(&[("password_stage", ¶m_value.to_string())]);
7855 }
7856 if let Some(ref param_value) = p_query_passwordless_flow {
7857 req_builder = req_builder.query(&[("passwordless_flow", ¶m_value.to_string())]);
7858 }
7859 if let Some(ref param_value) = p_query_recovery_flow {
7860 req_builder = req_builder.query(&[("recovery_flow", ¶m_value.to_string())]);
7861 }
7862 if let Some(ref param_value) = p_query_search {
7863 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
7864 }
7865 if let Some(ref param_value) = p_query_show_matched_user {
7866 req_builder = req_builder.query(&[("show_matched_user", ¶m_value.to_string())]);
7867 }
7868 if let Some(ref param_value) = p_query_show_source_labels {
7869 req_builder = req_builder.query(&[("show_source_labels", ¶m_value.to_string())]);
7870 }
7871 if let Some(ref user_agent) = configuration.user_agent {
7872 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7873 }
7874 if let Some(ref token) = configuration.bearer_access_token {
7875 req_builder = req_builder.bearer_auth(token.to_owned());
7876 };
7877
7878 let req = req_builder.build()?;
7879 let resp = configuration.client.execute(req).await?;
7880
7881 let status = resp.status();
7882 let content_type = resp
7883 .headers()
7884 .get("content-type")
7885 .and_then(|v| v.to_str().ok())
7886 .unwrap_or("application/octet-stream");
7887 let content_type = super::ContentType::from(content_type);
7888
7889 if !status.is_client_error() && !status.is_server_error() {
7890 let content = resp.text().await?;
7891 match content_type {
7892 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7893 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedIdentificationStageList`"))),
7894 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedIdentificationStageList`")))),
7895 }
7896 } else {
7897 let content = resp.text().await?;
7898 let entity: Option<StagesIdentificationListError> = serde_json::from_str(&content).ok();
7899 Err(Error::ResponseError(ResponseContent {
7900 status,
7901 content,
7902 entity,
7903 }))
7904 }
7905}
7906
7907pub async fn stages_identification_partial_update(
7909 configuration: &configuration::Configuration,
7910 stage_uuid: &str,
7911 patched_identification_stage_request: Option<models::PatchedIdentificationStageRequest>,
7912) -> Result<models::IdentificationStage, Error<StagesIdentificationPartialUpdateError>> {
7913 let p_path_stage_uuid = stage_uuid;
7915 let p_body_patched_identification_stage_request = patched_identification_stage_request;
7916
7917 let uri_str = format!(
7918 "{}/stages/identification/{stage_uuid}/",
7919 configuration.base_path,
7920 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7921 );
7922 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7923
7924 if let Some(ref user_agent) = configuration.user_agent {
7925 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7926 }
7927 if let Some(ref token) = configuration.bearer_access_token {
7928 req_builder = req_builder.bearer_auth(token.to_owned());
7929 };
7930 req_builder = req_builder.json(&p_body_patched_identification_stage_request);
7931
7932 let req = req_builder.build()?;
7933 let resp = configuration.client.execute(req).await?;
7934
7935 let status = resp.status();
7936 let content_type = resp
7937 .headers()
7938 .get("content-type")
7939 .and_then(|v| v.to_str().ok())
7940 .unwrap_or("application/octet-stream");
7941 let content_type = super::ContentType::from(content_type);
7942
7943 if !status.is_client_error() && !status.is_server_error() {
7944 let content = resp.text().await?;
7945 match content_type {
7946 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7947 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentificationStage`"))),
7948 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentificationStage`")))),
7949 }
7950 } else {
7951 let content = resp.text().await?;
7952 let entity: Option<StagesIdentificationPartialUpdateError> = serde_json::from_str(&content).ok();
7953 Err(Error::ResponseError(ResponseContent {
7954 status,
7955 content,
7956 entity,
7957 }))
7958 }
7959}
7960
7961pub async fn stages_identification_retrieve(
7963 configuration: &configuration::Configuration,
7964 stage_uuid: &str,
7965) -> Result<models::IdentificationStage, Error<StagesIdentificationRetrieveError>> {
7966 let p_path_stage_uuid = stage_uuid;
7968
7969 let uri_str = format!(
7970 "{}/stages/identification/{stage_uuid}/",
7971 configuration.base_path,
7972 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
7973 );
7974 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7975
7976 if let Some(ref user_agent) = configuration.user_agent {
7977 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7978 }
7979 if let Some(ref token) = configuration.bearer_access_token {
7980 req_builder = req_builder.bearer_auth(token.to_owned());
7981 };
7982
7983 let req = req_builder.build()?;
7984 let resp = configuration.client.execute(req).await?;
7985
7986 let status = resp.status();
7987 let content_type = resp
7988 .headers()
7989 .get("content-type")
7990 .and_then(|v| v.to_str().ok())
7991 .unwrap_or("application/octet-stream");
7992 let content_type = super::ContentType::from(content_type);
7993
7994 if !status.is_client_error() && !status.is_server_error() {
7995 let content = resp.text().await?;
7996 match content_type {
7997 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7998 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentificationStage`"))),
7999 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentificationStage`")))),
8000 }
8001 } else {
8002 let content = resp.text().await?;
8003 let entity: Option<StagesIdentificationRetrieveError> = serde_json::from_str(&content).ok();
8004 Err(Error::ResponseError(ResponseContent {
8005 status,
8006 content,
8007 entity,
8008 }))
8009 }
8010}
8011
8012pub async fn stages_identification_update(
8014 configuration: &configuration::Configuration,
8015 stage_uuid: &str,
8016 identification_stage_request: models::IdentificationStageRequest,
8017) -> Result<models::IdentificationStage, Error<StagesIdentificationUpdateError>> {
8018 let p_path_stage_uuid = stage_uuid;
8020 let p_body_identification_stage_request = identification_stage_request;
8021
8022 let uri_str = format!(
8023 "{}/stages/identification/{stage_uuid}/",
8024 configuration.base_path,
8025 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8026 );
8027 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8028
8029 if let Some(ref user_agent) = configuration.user_agent {
8030 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8031 }
8032 if let Some(ref token) = configuration.bearer_access_token {
8033 req_builder = req_builder.bearer_auth(token.to_owned());
8034 };
8035 req_builder = req_builder.json(&p_body_identification_stage_request);
8036
8037 let req = req_builder.build()?;
8038 let resp = configuration.client.execute(req).await?;
8039
8040 let status = resp.status();
8041 let content_type = resp
8042 .headers()
8043 .get("content-type")
8044 .and_then(|v| v.to_str().ok())
8045 .unwrap_or("application/octet-stream");
8046 let content_type = super::ContentType::from(content_type);
8047
8048 if !status.is_client_error() && !status.is_server_error() {
8049 let content = resp.text().await?;
8050 match content_type {
8051 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8052 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IdentificationStage`"))),
8053 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IdentificationStage`")))),
8054 }
8055 } else {
8056 let content = resp.text().await?;
8057 let entity: Option<StagesIdentificationUpdateError> = serde_json::from_str(&content).ok();
8058 Err(Error::ResponseError(ResponseContent {
8059 status,
8060 content,
8061 entity,
8062 }))
8063 }
8064}
8065
8066pub async fn stages_identification_used_by_list(
8068 configuration: &configuration::Configuration,
8069 stage_uuid: &str,
8070) -> Result<Vec<models::UsedBy>, Error<StagesIdentificationUsedByListError>> {
8071 let p_path_stage_uuid = stage_uuid;
8073
8074 let uri_str = format!(
8075 "{}/stages/identification/{stage_uuid}/used_by/",
8076 configuration.base_path,
8077 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8078 );
8079 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8080
8081 if let Some(ref user_agent) = configuration.user_agent {
8082 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8083 }
8084 if let Some(ref token) = configuration.bearer_access_token {
8085 req_builder = req_builder.bearer_auth(token.to_owned());
8086 };
8087
8088 let req = req_builder.build()?;
8089 let resp = configuration.client.execute(req).await?;
8090
8091 let status = resp.status();
8092 let content_type = resp
8093 .headers()
8094 .get("content-type")
8095 .and_then(|v| v.to_str().ok())
8096 .unwrap_or("application/octet-stream");
8097 let content_type = super::ContentType::from(content_type);
8098
8099 if !status.is_client_error() && !status.is_server_error() {
8100 let content = resp.text().await?;
8101 match content_type {
8102 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8103 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
8104 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>`")))),
8105 }
8106 } else {
8107 let content = resp.text().await?;
8108 let entity: Option<StagesIdentificationUsedByListError> = serde_json::from_str(&content).ok();
8109 Err(Error::ResponseError(ResponseContent {
8110 status,
8111 content,
8112 entity,
8113 }))
8114 }
8115}
8116
8117pub async fn stages_invitation_invitations_create(
8119 configuration: &configuration::Configuration,
8120 invitation_request: models::InvitationRequest,
8121) -> Result<models::Invitation, Error<StagesInvitationInvitationsCreateError>> {
8122 let p_body_invitation_request = invitation_request;
8124
8125 let uri_str = format!("{}/stages/invitation/invitations/", configuration.base_path);
8126 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8127
8128 if let Some(ref user_agent) = configuration.user_agent {
8129 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8130 }
8131 if let Some(ref token) = configuration.bearer_access_token {
8132 req_builder = req_builder.bearer_auth(token.to_owned());
8133 };
8134 req_builder = req_builder.json(&p_body_invitation_request);
8135
8136 let req = req_builder.build()?;
8137 let resp = configuration.client.execute(req).await?;
8138
8139 let status = resp.status();
8140 let content_type = resp
8141 .headers()
8142 .get("content-type")
8143 .and_then(|v| v.to_str().ok())
8144 .unwrap_or("application/octet-stream");
8145 let content_type = super::ContentType::from(content_type);
8146
8147 if !status.is_client_error() && !status.is_server_error() {
8148 let content = resp.text().await?;
8149 match content_type {
8150 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8151 ContentType::Text => {
8152 return Err(Error::from(serde_json::Error::custom(
8153 "Received `text/plain` content type response that cannot be converted to `models::Invitation`",
8154 )))
8155 }
8156 ContentType::Unsupported(unknown_type) => {
8157 return Err(Error::from(serde_json::Error::custom(format!(
8158 "Received `{unknown_type}` content type response that cannot be converted to `models::Invitation`"
8159 ))))
8160 }
8161 }
8162 } else {
8163 let content = resp.text().await?;
8164 let entity: Option<StagesInvitationInvitationsCreateError> = serde_json::from_str(&content).ok();
8165 Err(Error::ResponseError(ResponseContent {
8166 status,
8167 content,
8168 entity,
8169 }))
8170 }
8171}
8172
8173pub async fn stages_invitation_invitations_destroy(
8175 configuration: &configuration::Configuration,
8176 invite_uuid: &str,
8177) -> Result<(), Error<StagesInvitationInvitationsDestroyError>> {
8178 let p_path_invite_uuid = invite_uuid;
8180
8181 let uri_str = format!(
8182 "{}/stages/invitation/invitations/{invite_uuid}/",
8183 configuration.base_path,
8184 invite_uuid = crate::apis::urlencode(p_path_invite_uuid)
8185 );
8186 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8187
8188 if let Some(ref user_agent) = configuration.user_agent {
8189 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8190 }
8191 if let Some(ref token) = configuration.bearer_access_token {
8192 req_builder = req_builder.bearer_auth(token.to_owned());
8193 };
8194
8195 let req = req_builder.build()?;
8196 let resp = configuration.client.execute(req).await?;
8197
8198 let status = resp.status();
8199
8200 if !status.is_client_error() && !status.is_server_error() {
8201 Ok(())
8202 } else {
8203 let content = resp.text().await?;
8204 let entity: Option<StagesInvitationInvitationsDestroyError> = serde_json::from_str(&content).ok();
8205 Err(Error::ResponseError(ResponseContent {
8206 status,
8207 content,
8208 entity,
8209 }))
8210 }
8211}
8212
8213pub async fn stages_invitation_invitations_list(
8215 configuration: &configuration::Configuration,
8216 created_by__username: Option<&str>,
8217 expires: Option<String>,
8218 flow__slug: Option<&str>,
8219 name: Option<&str>,
8220 ordering: Option<&str>,
8221 page: Option<i32>,
8222 page_size: Option<i32>,
8223 search: Option<&str>,
8224) -> Result<models::PaginatedInvitationList, Error<StagesInvitationInvitationsListError>> {
8225 let p_query_created_by__username = created_by__username;
8227 let p_query_expires = expires;
8228 let p_query_flow__slug = flow__slug;
8229 let p_query_name = name;
8230 let p_query_ordering = ordering;
8231 let p_query_page = page;
8232 let p_query_page_size = page_size;
8233 let p_query_search = search;
8234
8235 let uri_str = format!("{}/stages/invitation/invitations/", configuration.base_path);
8236 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8237
8238 if let Some(ref param_value) = p_query_created_by__username {
8239 req_builder = req_builder.query(&[("created_by__username", ¶m_value.to_string())]);
8240 }
8241 if let Some(ref param_value) = p_query_expires {
8242 req_builder = req_builder.query(&[("expires", ¶m_value.to_string())]);
8243 }
8244 if let Some(ref param_value) = p_query_flow__slug {
8245 req_builder = req_builder.query(&[("flow__slug", ¶m_value.to_string())]);
8246 }
8247 if let Some(ref param_value) = p_query_name {
8248 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
8249 }
8250 if let Some(ref param_value) = p_query_ordering {
8251 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
8252 }
8253 if let Some(ref param_value) = p_query_page {
8254 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
8255 }
8256 if let Some(ref param_value) = p_query_page_size {
8257 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
8258 }
8259 if let Some(ref param_value) = p_query_search {
8260 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
8261 }
8262 if let Some(ref user_agent) = configuration.user_agent {
8263 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8264 }
8265 if let Some(ref token) = configuration.bearer_access_token {
8266 req_builder = req_builder.bearer_auth(token.to_owned());
8267 };
8268
8269 let req = req_builder.build()?;
8270 let resp = configuration.client.execute(req).await?;
8271
8272 let status = resp.status();
8273 let content_type = resp
8274 .headers()
8275 .get("content-type")
8276 .and_then(|v| v.to_str().ok())
8277 .unwrap_or("application/octet-stream");
8278 let content_type = super::ContentType::from(content_type);
8279
8280 if !status.is_client_error() && !status.is_server_error() {
8281 let content = resp.text().await?;
8282 match content_type {
8283 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8284 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedInvitationList`"))),
8285 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedInvitationList`")))),
8286 }
8287 } else {
8288 let content = resp.text().await?;
8289 let entity: Option<StagesInvitationInvitationsListError> = serde_json::from_str(&content).ok();
8290 Err(Error::ResponseError(ResponseContent {
8291 status,
8292 content,
8293 entity,
8294 }))
8295 }
8296}
8297
8298pub async fn stages_invitation_invitations_partial_update(
8300 configuration: &configuration::Configuration,
8301 invite_uuid: &str,
8302 patched_invitation_request: Option<models::PatchedInvitationRequest>,
8303) -> Result<models::Invitation, Error<StagesInvitationInvitationsPartialUpdateError>> {
8304 let p_path_invite_uuid = invite_uuid;
8306 let p_body_patched_invitation_request = patched_invitation_request;
8307
8308 let uri_str = format!(
8309 "{}/stages/invitation/invitations/{invite_uuid}/",
8310 configuration.base_path,
8311 invite_uuid = crate::apis::urlencode(p_path_invite_uuid)
8312 );
8313 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8314
8315 if let Some(ref user_agent) = configuration.user_agent {
8316 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8317 }
8318 if let Some(ref token) = configuration.bearer_access_token {
8319 req_builder = req_builder.bearer_auth(token.to_owned());
8320 };
8321 req_builder = req_builder.json(&p_body_patched_invitation_request);
8322
8323 let req = req_builder.build()?;
8324 let resp = configuration.client.execute(req).await?;
8325
8326 let status = resp.status();
8327 let content_type = resp
8328 .headers()
8329 .get("content-type")
8330 .and_then(|v| v.to_str().ok())
8331 .unwrap_or("application/octet-stream");
8332 let content_type = super::ContentType::from(content_type);
8333
8334 if !status.is_client_error() && !status.is_server_error() {
8335 let content = resp.text().await?;
8336 match content_type {
8337 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8338 ContentType::Text => {
8339 return Err(Error::from(serde_json::Error::custom(
8340 "Received `text/plain` content type response that cannot be converted to `models::Invitation`",
8341 )))
8342 }
8343 ContentType::Unsupported(unknown_type) => {
8344 return Err(Error::from(serde_json::Error::custom(format!(
8345 "Received `{unknown_type}` content type response that cannot be converted to `models::Invitation`"
8346 ))))
8347 }
8348 }
8349 } else {
8350 let content = resp.text().await?;
8351 let entity: Option<StagesInvitationInvitationsPartialUpdateError> = serde_json::from_str(&content).ok();
8352 Err(Error::ResponseError(ResponseContent {
8353 status,
8354 content,
8355 entity,
8356 }))
8357 }
8358}
8359
8360pub async fn stages_invitation_invitations_retrieve(
8362 configuration: &configuration::Configuration,
8363 invite_uuid: &str,
8364) -> Result<models::Invitation, Error<StagesInvitationInvitationsRetrieveError>> {
8365 let p_path_invite_uuid = invite_uuid;
8367
8368 let uri_str = format!(
8369 "{}/stages/invitation/invitations/{invite_uuid}/",
8370 configuration.base_path,
8371 invite_uuid = crate::apis::urlencode(p_path_invite_uuid)
8372 );
8373 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8374
8375 if let Some(ref user_agent) = configuration.user_agent {
8376 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8377 }
8378 if let Some(ref token) = configuration.bearer_access_token {
8379 req_builder = req_builder.bearer_auth(token.to_owned());
8380 };
8381
8382 let req = req_builder.build()?;
8383 let resp = configuration.client.execute(req).await?;
8384
8385 let status = resp.status();
8386 let content_type = resp
8387 .headers()
8388 .get("content-type")
8389 .and_then(|v| v.to_str().ok())
8390 .unwrap_or("application/octet-stream");
8391 let content_type = super::ContentType::from(content_type);
8392
8393 if !status.is_client_error() && !status.is_server_error() {
8394 let content = resp.text().await?;
8395 match content_type {
8396 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8397 ContentType::Text => {
8398 return Err(Error::from(serde_json::Error::custom(
8399 "Received `text/plain` content type response that cannot be converted to `models::Invitation`",
8400 )))
8401 }
8402 ContentType::Unsupported(unknown_type) => {
8403 return Err(Error::from(serde_json::Error::custom(format!(
8404 "Received `{unknown_type}` content type response that cannot be converted to `models::Invitation`"
8405 ))))
8406 }
8407 }
8408 } else {
8409 let content = resp.text().await?;
8410 let entity: Option<StagesInvitationInvitationsRetrieveError> = serde_json::from_str(&content).ok();
8411 Err(Error::ResponseError(ResponseContent {
8412 status,
8413 content,
8414 entity,
8415 }))
8416 }
8417}
8418
8419pub async fn stages_invitation_invitations_update(
8421 configuration: &configuration::Configuration,
8422 invite_uuid: &str,
8423 invitation_request: models::InvitationRequest,
8424) -> Result<models::Invitation, Error<StagesInvitationInvitationsUpdateError>> {
8425 let p_path_invite_uuid = invite_uuid;
8427 let p_body_invitation_request = invitation_request;
8428
8429 let uri_str = format!(
8430 "{}/stages/invitation/invitations/{invite_uuid}/",
8431 configuration.base_path,
8432 invite_uuid = crate::apis::urlencode(p_path_invite_uuid)
8433 );
8434 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8435
8436 if let Some(ref user_agent) = configuration.user_agent {
8437 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8438 }
8439 if let Some(ref token) = configuration.bearer_access_token {
8440 req_builder = req_builder.bearer_auth(token.to_owned());
8441 };
8442 req_builder = req_builder.json(&p_body_invitation_request);
8443
8444 let req = req_builder.build()?;
8445 let resp = configuration.client.execute(req).await?;
8446
8447 let status = resp.status();
8448 let content_type = resp
8449 .headers()
8450 .get("content-type")
8451 .and_then(|v| v.to_str().ok())
8452 .unwrap_or("application/octet-stream");
8453 let content_type = super::ContentType::from(content_type);
8454
8455 if !status.is_client_error() && !status.is_server_error() {
8456 let content = resp.text().await?;
8457 match content_type {
8458 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8459 ContentType::Text => {
8460 return Err(Error::from(serde_json::Error::custom(
8461 "Received `text/plain` content type response that cannot be converted to `models::Invitation`",
8462 )))
8463 }
8464 ContentType::Unsupported(unknown_type) => {
8465 return Err(Error::from(serde_json::Error::custom(format!(
8466 "Received `{unknown_type}` content type response that cannot be converted to `models::Invitation`"
8467 ))))
8468 }
8469 }
8470 } else {
8471 let content = resp.text().await?;
8472 let entity: Option<StagesInvitationInvitationsUpdateError> = serde_json::from_str(&content).ok();
8473 Err(Error::ResponseError(ResponseContent {
8474 status,
8475 content,
8476 entity,
8477 }))
8478 }
8479}
8480
8481pub async fn stages_invitation_invitations_used_by_list(
8483 configuration: &configuration::Configuration,
8484 invite_uuid: &str,
8485) -> Result<Vec<models::UsedBy>, Error<StagesInvitationInvitationsUsedByListError>> {
8486 let p_path_invite_uuid = invite_uuid;
8488
8489 let uri_str = format!(
8490 "{}/stages/invitation/invitations/{invite_uuid}/used_by/",
8491 configuration.base_path,
8492 invite_uuid = crate::apis::urlencode(p_path_invite_uuid)
8493 );
8494 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8495
8496 if let Some(ref user_agent) = configuration.user_agent {
8497 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8498 }
8499 if let Some(ref token) = configuration.bearer_access_token {
8500 req_builder = req_builder.bearer_auth(token.to_owned());
8501 };
8502
8503 let req = req_builder.build()?;
8504 let resp = configuration.client.execute(req).await?;
8505
8506 let status = resp.status();
8507 let content_type = resp
8508 .headers()
8509 .get("content-type")
8510 .and_then(|v| v.to_str().ok())
8511 .unwrap_or("application/octet-stream");
8512 let content_type = super::ContentType::from(content_type);
8513
8514 if !status.is_client_error() && !status.is_server_error() {
8515 let content = resp.text().await?;
8516 match content_type {
8517 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8518 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
8519 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>`")))),
8520 }
8521 } else {
8522 let content = resp.text().await?;
8523 let entity: Option<StagesInvitationInvitationsUsedByListError> = serde_json::from_str(&content).ok();
8524 Err(Error::ResponseError(ResponseContent {
8525 status,
8526 content,
8527 entity,
8528 }))
8529 }
8530}
8531
8532pub async fn stages_invitation_stages_create(
8534 configuration: &configuration::Configuration,
8535 invitation_stage_request: models::InvitationStageRequest,
8536) -> Result<models::InvitationStage, Error<StagesInvitationStagesCreateError>> {
8537 let p_body_invitation_stage_request = invitation_stage_request;
8539
8540 let uri_str = format!("{}/stages/invitation/stages/", configuration.base_path);
8541 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8542
8543 if let Some(ref user_agent) = configuration.user_agent {
8544 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8545 }
8546 if let Some(ref token) = configuration.bearer_access_token {
8547 req_builder = req_builder.bearer_auth(token.to_owned());
8548 };
8549 req_builder = req_builder.json(&p_body_invitation_stage_request);
8550
8551 let req = req_builder.build()?;
8552 let resp = configuration.client.execute(req).await?;
8553
8554 let status = resp.status();
8555 let content_type = resp
8556 .headers()
8557 .get("content-type")
8558 .and_then(|v| v.to_str().ok())
8559 .unwrap_or("application/octet-stream");
8560 let content_type = super::ContentType::from(content_type);
8561
8562 if !status.is_client_error() && !status.is_server_error() {
8563 let content = resp.text().await?;
8564 match content_type {
8565 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8566 ContentType::Text => {
8567 return Err(Error::from(serde_json::Error::custom(
8568 "Received `text/plain` content type response that cannot be converted to `models::InvitationStage`",
8569 )))
8570 }
8571 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8572 "Received `{unknown_type}` content type response that cannot be converted to `models::InvitationStage`"
8573 )))),
8574 }
8575 } else {
8576 let content = resp.text().await?;
8577 let entity: Option<StagesInvitationStagesCreateError> = serde_json::from_str(&content).ok();
8578 Err(Error::ResponseError(ResponseContent {
8579 status,
8580 content,
8581 entity,
8582 }))
8583 }
8584}
8585
8586pub async fn stages_invitation_stages_destroy(
8588 configuration: &configuration::Configuration,
8589 stage_uuid: &str,
8590) -> Result<(), Error<StagesInvitationStagesDestroyError>> {
8591 let p_path_stage_uuid = stage_uuid;
8593
8594 let uri_str = format!(
8595 "{}/stages/invitation/stages/{stage_uuid}/",
8596 configuration.base_path,
8597 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8598 );
8599 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
8600
8601 if let Some(ref user_agent) = configuration.user_agent {
8602 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8603 }
8604 if let Some(ref token) = configuration.bearer_access_token {
8605 req_builder = req_builder.bearer_auth(token.to_owned());
8606 };
8607
8608 let req = req_builder.build()?;
8609 let resp = configuration.client.execute(req).await?;
8610
8611 let status = resp.status();
8612
8613 if !status.is_client_error() && !status.is_server_error() {
8614 Ok(())
8615 } else {
8616 let content = resp.text().await?;
8617 let entity: Option<StagesInvitationStagesDestroyError> = serde_json::from_str(&content).ok();
8618 Err(Error::ResponseError(ResponseContent {
8619 status,
8620 content,
8621 entity,
8622 }))
8623 }
8624}
8625
8626pub async fn stages_invitation_stages_list(
8628 configuration: &configuration::Configuration,
8629 continue_flow_without_invitation: Option<bool>,
8630 name: Option<&str>,
8631 no_flows: Option<bool>,
8632 ordering: Option<&str>,
8633 page: Option<i32>,
8634 page_size: Option<i32>,
8635 search: Option<&str>,
8636 stage_uuid: Option<&str>,
8637) -> Result<models::PaginatedInvitationStageList, Error<StagesInvitationStagesListError>> {
8638 let p_query_continue_flow_without_invitation = continue_flow_without_invitation;
8640 let p_query_name = name;
8641 let p_query_no_flows = no_flows;
8642 let p_query_ordering = ordering;
8643 let p_query_page = page;
8644 let p_query_page_size = page_size;
8645 let p_query_search = search;
8646 let p_query_stage_uuid = stage_uuid;
8647
8648 let uri_str = format!("{}/stages/invitation/stages/", configuration.base_path);
8649 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8650
8651 if let Some(ref param_value) = p_query_continue_flow_without_invitation {
8652 req_builder = req_builder.query(&[("continue_flow_without_invitation", ¶m_value.to_string())]);
8653 }
8654 if let Some(ref param_value) = p_query_name {
8655 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
8656 }
8657 if let Some(ref param_value) = p_query_no_flows {
8658 req_builder = req_builder.query(&[("no_flows", ¶m_value.to_string())]);
8659 }
8660 if let Some(ref param_value) = p_query_ordering {
8661 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
8662 }
8663 if let Some(ref param_value) = p_query_page {
8664 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
8665 }
8666 if let Some(ref param_value) = p_query_page_size {
8667 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
8668 }
8669 if let Some(ref param_value) = p_query_search {
8670 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
8671 }
8672 if let Some(ref param_value) = p_query_stage_uuid {
8673 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
8674 }
8675 if let Some(ref user_agent) = configuration.user_agent {
8676 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8677 }
8678 if let Some(ref token) = configuration.bearer_access_token {
8679 req_builder = req_builder.bearer_auth(token.to_owned());
8680 };
8681
8682 let req = req_builder.build()?;
8683 let resp = configuration.client.execute(req).await?;
8684
8685 let status = resp.status();
8686 let content_type = resp
8687 .headers()
8688 .get("content-type")
8689 .and_then(|v| v.to_str().ok())
8690 .unwrap_or("application/octet-stream");
8691 let content_type = super::ContentType::from(content_type);
8692
8693 if !status.is_client_error() && !status.is_server_error() {
8694 let content = resp.text().await?;
8695 match content_type {
8696 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8697 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedInvitationStageList`"))),
8698 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedInvitationStageList`")))),
8699 }
8700 } else {
8701 let content = resp.text().await?;
8702 let entity: Option<StagesInvitationStagesListError> = serde_json::from_str(&content).ok();
8703 Err(Error::ResponseError(ResponseContent {
8704 status,
8705 content,
8706 entity,
8707 }))
8708 }
8709}
8710
8711pub async fn stages_invitation_stages_partial_update(
8713 configuration: &configuration::Configuration,
8714 stage_uuid: &str,
8715 patched_invitation_stage_request: Option<models::PatchedInvitationStageRequest>,
8716) -> Result<models::InvitationStage, Error<StagesInvitationStagesPartialUpdateError>> {
8717 let p_path_stage_uuid = stage_uuid;
8719 let p_body_patched_invitation_stage_request = patched_invitation_stage_request;
8720
8721 let uri_str = format!(
8722 "{}/stages/invitation/stages/{stage_uuid}/",
8723 configuration.base_path,
8724 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8725 );
8726 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
8727
8728 if let Some(ref user_agent) = configuration.user_agent {
8729 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8730 }
8731 if let Some(ref token) = configuration.bearer_access_token {
8732 req_builder = req_builder.bearer_auth(token.to_owned());
8733 };
8734 req_builder = req_builder.json(&p_body_patched_invitation_stage_request);
8735
8736 let req = req_builder.build()?;
8737 let resp = configuration.client.execute(req).await?;
8738
8739 let status = resp.status();
8740 let content_type = resp
8741 .headers()
8742 .get("content-type")
8743 .and_then(|v| v.to_str().ok())
8744 .unwrap_or("application/octet-stream");
8745 let content_type = super::ContentType::from(content_type);
8746
8747 if !status.is_client_error() && !status.is_server_error() {
8748 let content = resp.text().await?;
8749 match content_type {
8750 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8751 ContentType::Text => {
8752 return Err(Error::from(serde_json::Error::custom(
8753 "Received `text/plain` content type response that cannot be converted to `models::InvitationStage`",
8754 )))
8755 }
8756 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8757 "Received `{unknown_type}` content type response that cannot be converted to `models::InvitationStage`"
8758 )))),
8759 }
8760 } else {
8761 let content = resp.text().await?;
8762 let entity: Option<StagesInvitationStagesPartialUpdateError> = serde_json::from_str(&content).ok();
8763 Err(Error::ResponseError(ResponseContent {
8764 status,
8765 content,
8766 entity,
8767 }))
8768 }
8769}
8770
8771pub async fn stages_invitation_stages_retrieve(
8773 configuration: &configuration::Configuration,
8774 stage_uuid: &str,
8775) -> Result<models::InvitationStage, Error<StagesInvitationStagesRetrieveError>> {
8776 let p_path_stage_uuid = stage_uuid;
8778
8779 let uri_str = format!(
8780 "{}/stages/invitation/stages/{stage_uuid}/",
8781 configuration.base_path,
8782 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8783 );
8784 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8785
8786 if let Some(ref user_agent) = configuration.user_agent {
8787 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8788 }
8789 if let Some(ref token) = configuration.bearer_access_token {
8790 req_builder = req_builder.bearer_auth(token.to_owned());
8791 };
8792
8793 let req = req_builder.build()?;
8794 let resp = configuration.client.execute(req).await?;
8795
8796 let status = resp.status();
8797 let content_type = resp
8798 .headers()
8799 .get("content-type")
8800 .and_then(|v| v.to_str().ok())
8801 .unwrap_or("application/octet-stream");
8802 let content_type = super::ContentType::from(content_type);
8803
8804 if !status.is_client_error() && !status.is_server_error() {
8805 let content = resp.text().await?;
8806 match content_type {
8807 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8808 ContentType::Text => {
8809 return Err(Error::from(serde_json::Error::custom(
8810 "Received `text/plain` content type response that cannot be converted to `models::InvitationStage`",
8811 )))
8812 }
8813 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8814 "Received `{unknown_type}` content type response that cannot be converted to `models::InvitationStage`"
8815 )))),
8816 }
8817 } else {
8818 let content = resp.text().await?;
8819 let entity: Option<StagesInvitationStagesRetrieveError> = serde_json::from_str(&content).ok();
8820 Err(Error::ResponseError(ResponseContent {
8821 status,
8822 content,
8823 entity,
8824 }))
8825 }
8826}
8827
8828pub async fn stages_invitation_stages_update(
8830 configuration: &configuration::Configuration,
8831 stage_uuid: &str,
8832 invitation_stage_request: models::InvitationStageRequest,
8833) -> Result<models::InvitationStage, Error<StagesInvitationStagesUpdateError>> {
8834 let p_path_stage_uuid = stage_uuid;
8836 let p_body_invitation_stage_request = invitation_stage_request;
8837
8838 let uri_str = format!(
8839 "{}/stages/invitation/stages/{stage_uuid}/",
8840 configuration.base_path,
8841 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8842 );
8843 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
8844
8845 if let Some(ref user_agent) = configuration.user_agent {
8846 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8847 }
8848 if let Some(ref token) = configuration.bearer_access_token {
8849 req_builder = req_builder.bearer_auth(token.to_owned());
8850 };
8851 req_builder = req_builder.json(&p_body_invitation_stage_request);
8852
8853 let req = req_builder.build()?;
8854 let resp = configuration.client.execute(req).await?;
8855
8856 let status = resp.status();
8857 let content_type = resp
8858 .headers()
8859 .get("content-type")
8860 .and_then(|v| v.to_str().ok())
8861 .unwrap_or("application/octet-stream");
8862 let content_type = super::ContentType::from(content_type);
8863
8864 if !status.is_client_error() && !status.is_server_error() {
8865 let content = resp.text().await?;
8866 match content_type {
8867 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8868 ContentType::Text => {
8869 return Err(Error::from(serde_json::Error::custom(
8870 "Received `text/plain` content type response that cannot be converted to `models::InvitationStage`",
8871 )))
8872 }
8873 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8874 "Received `{unknown_type}` content type response that cannot be converted to `models::InvitationStage`"
8875 )))),
8876 }
8877 } else {
8878 let content = resp.text().await?;
8879 let entity: Option<StagesInvitationStagesUpdateError> = serde_json::from_str(&content).ok();
8880 Err(Error::ResponseError(ResponseContent {
8881 status,
8882 content,
8883 entity,
8884 }))
8885 }
8886}
8887
8888pub async fn stages_invitation_stages_used_by_list(
8890 configuration: &configuration::Configuration,
8891 stage_uuid: &str,
8892) -> Result<Vec<models::UsedBy>, Error<StagesInvitationStagesUsedByListError>> {
8893 let p_path_stage_uuid = stage_uuid;
8895
8896 let uri_str = format!(
8897 "{}/stages/invitation/stages/{stage_uuid}/used_by/",
8898 configuration.base_path,
8899 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
8900 );
8901 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
8902
8903 if let Some(ref user_agent) = configuration.user_agent {
8904 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8905 }
8906 if let Some(ref token) = configuration.bearer_access_token {
8907 req_builder = req_builder.bearer_auth(token.to_owned());
8908 };
8909
8910 let req = req_builder.build()?;
8911 let resp = configuration.client.execute(req).await?;
8912
8913 let status = resp.status();
8914 let content_type = resp
8915 .headers()
8916 .get("content-type")
8917 .and_then(|v| v.to_str().ok())
8918 .unwrap_or("application/octet-stream");
8919 let content_type = super::ContentType::from(content_type);
8920
8921 if !status.is_client_error() && !status.is_server_error() {
8922 let content = resp.text().await?;
8923 match content_type {
8924 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8925 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
8926 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>`")))),
8927 }
8928 } else {
8929 let content = resp.text().await?;
8930 let entity: Option<StagesInvitationStagesUsedByListError> = serde_json::from_str(&content).ok();
8931 Err(Error::ResponseError(ResponseContent {
8932 status,
8933 content,
8934 entity,
8935 }))
8936 }
8937}
8938
8939pub async fn stages_mtls_create(
8941 configuration: &configuration::Configuration,
8942 mutual_tls_stage_request: models::MutualTlsStageRequest,
8943) -> Result<models::MutualTlsStage, Error<StagesMtlsCreateError>> {
8944 let p_body_mutual_tls_stage_request = mutual_tls_stage_request;
8946
8947 let uri_str = format!("{}/stages/mtls/", configuration.base_path);
8948 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
8949
8950 if let Some(ref user_agent) = configuration.user_agent {
8951 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
8952 }
8953 if let Some(ref token) = configuration.bearer_access_token {
8954 req_builder = req_builder.bearer_auth(token.to_owned());
8955 };
8956 req_builder = req_builder.json(&p_body_mutual_tls_stage_request);
8957
8958 let req = req_builder.build()?;
8959 let resp = configuration.client.execute(req).await?;
8960
8961 let status = resp.status();
8962 let content_type = resp
8963 .headers()
8964 .get("content-type")
8965 .and_then(|v| v.to_str().ok())
8966 .unwrap_or("application/octet-stream");
8967 let content_type = super::ContentType::from(content_type);
8968
8969 if !status.is_client_error() && !status.is_server_error() {
8970 let content = resp.text().await?;
8971 match content_type {
8972 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
8973 ContentType::Text => {
8974 return Err(Error::from(serde_json::Error::custom(
8975 "Received `text/plain` content type response that cannot be converted to `models::MutualTlsStage`",
8976 )))
8977 }
8978 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
8979 "Received `{unknown_type}` content type response that cannot be converted to `models::MutualTlsStage`"
8980 )))),
8981 }
8982 } else {
8983 let content = resp.text().await?;
8984 let entity: Option<StagesMtlsCreateError> = serde_json::from_str(&content).ok();
8985 Err(Error::ResponseError(ResponseContent {
8986 status,
8987 content,
8988 entity,
8989 }))
8990 }
8991}
8992
8993pub async fn stages_mtls_destroy(
8995 configuration: &configuration::Configuration,
8996 stage_uuid: &str,
8997) -> Result<(), Error<StagesMtlsDestroyError>> {
8998 let p_path_stage_uuid = stage_uuid;
9000
9001 let uri_str = format!(
9002 "{}/stages/mtls/{stage_uuid}/",
9003 configuration.base_path,
9004 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9005 );
9006 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9007
9008 if let Some(ref user_agent) = configuration.user_agent {
9009 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9010 }
9011 if let Some(ref token) = configuration.bearer_access_token {
9012 req_builder = req_builder.bearer_auth(token.to_owned());
9013 };
9014
9015 let req = req_builder.build()?;
9016 let resp = configuration.client.execute(req).await?;
9017
9018 let status = resp.status();
9019
9020 if !status.is_client_error() && !status.is_server_error() {
9021 Ok(())
9022 } else {
9023 let content = resp.text().await?;
9024 let entity: Option<StagesMtlsDestroyError> = serde_json::from_str(&content).ok();
9025 Err(Error::ResponseError(ResponseContent {
9026 status,
9027 content,
9028 entity,
9029 }))
9030 }
9031}
9032
9033pub async fn stages_mtls_list(
9035 configuration: &configuration::Configuration,
9036 cert_attribute: Option<&str>,
9037 certificate_authorities: Option<Vec<uuid::Uuid>>,
9038 mode: Option<&str>,
9039 name: Option<&str>,
9040 ordering: Option<&str>,
9041 page: Option<i32>,
9042 page_size: Option<i32>,
9043 search: Option<&str>,
9044 stage_uuid: Option<&str>,
9045 user_attribute: Option<&str>,
9046) -> Result<models::PaginatedMutualTlsStageList, Error<StagesMtlsListError>> {
9047 let p_query_cert_attribute = cert_attribute;
9049 let p_query_certificate_authorities = certificate_authorities;
9050 let p_query_mode = mode;
9051 let p_query_name = name;
9052 let p_query_ordering = ordering;
9053 let p_query_page = page;
9054 let p_query_page_size = page_size;
9055 let p_query_search = search;
9056 let p_query_stage_uuid = stage_uuid;
9057 let p_query_user_attribute = user_attribute;
9058
9059 let uri_str = format!("{}/stages/mtls/", configuration.base_path);
9060 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9061
9062 if let Some(ref param_value) = p_query_cert_attribute {
9063 req_builder = req_builder.query(&[("cert_attribute", ¶m_value.to_string())]);
9064 }
9065 if let Some(ref param_value) = p_query_certificate_authorities {
9066 req_builder = match "multi" {
9067 "multi" => req_builder.query(
9068 ¶m_value
9069 .into_iter()
9070 .map(|p| ("certificate_authorities".to_owned(), p.to_string()))
9071 .collect::<Vec<(std::string::String, std::string::String)>>(),
9072 ),
9073 _ => req_builder.query(&[(
9074 "certificate_authorities",
9075 ¶m_value
9076 .into_iter()
9077 .map(|p| p.to_string())
9078 .collect::<Vec<String>>()
9079 .join(",")
9080 .to_string(),
9081 )]),
9082 };
9083 }
9084 if let Some(ref param_value) = p_query_mode {
9085 req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]);
9086 }
9087 if let Some(ref param_value) = p_query_name {
9088 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
9089 }
9090 if let Some(ref param_value) = p_query_ordering {
9091 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
9092 }
9093 if let Some(ref param_value) = p_query_page {
9094 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
9095 }
9096 if let Some(ref param_value) = p_query_page_size {
9097 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
9098 }
9099 if let Some(ref param_value) = p_query_search {
9100 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
9101 }
9102 if let Some(ref param_value) = p_query_stage_uuid {
9103 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
9104 }
9105 if let Some(ref param_value) = p_query_user_attribute {
9106 req_builder = req_builder.query(&[("user_attribute", ¶m_value.to_string())]);
9107 }
9108 if let Some(ref user_agent) = configuration.user_agent {
9109 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9110 }
9111 if let Some(ref token) = configuration.bearer_access_token {
9112 req_builder = req_builder.bearer_auth(token.to_owned());
9113 };
9114
9115 let req = req_builder.build()?;
9116 let resp = configuration.client.execute(req).await?;
9117
9118 let status = resp.status();
9119 let content_type = resp
9120 .headers()
9121 .get("content-type")
9122 .and_then(|v| v.to_str().ok())
9123 .unwrap_or("application/octet-stream");
9124 let content_type = super::ContentType::from(content_type);
9125
9126 if !status.is_client_error() && !status.is_server_error() {
9127 let content = resp.text().await?;
9128 match content_type {
9129 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9130 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedMutualTlsStageList`"))),
9131 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedMutualTlsStageList`")))),
9132 }
9133 } else {
9134 let content = resp.text().await?;
9135 let entity: Option<StagesMtlsListError> = serde_json::from_str(&content).ok();
9136 Err(Error::ResponseError(ResponseContent {
9137 status,
9138 content,
9139 entity,
9140 }))
9141 }
9142}
9143
9144pub async fn stages_mtls_partial_update(
9146 configuration: &configuration::Configuration,
9147 stage_uuid: &str,
9148 patched_mutual_tls_stage_request: Option<models::PatchedMutualTlsStageRequest>,
9149) -> Result<models::MutualTlsStage, Error<StagesMtlsPartialUpdateError>> {
9150 let p_path_stage_uuid = stage_uuid;
9152 let p_body_patched_mutual_tls_stage_request = patched_mutual_tls_stage_request;
9153
9154 let uri_str = format!(
9155 "{}/stages/mtls/{stage_uuid}/",
9156 configuration.base_path,
9157 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9158 );
9159 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9160
9161 if let Some(ref user_agent) = configuration.user_agent {
9162 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9163 }
9164 if let Some(ref token) = configuration.bearer_access_token {
9165 req_builder = req_builder.bearer_auth(token.to_owned());
9166 };
9167 req_builder = req_builder.json(&p_body_patched_mutual_tls_stage_request);
9168
9169 let req = req_builder.build()?;
9170 let resp = configuration.client.execute(req).await?;
9171
9172 let status = resp.status();
9173 let content_type = resp
9174 .headers()
9175 .get("content-type")
9176 .and_then(|v| v.to_str().ok())
9177 .unwrap_or("application/octet-stream");
9178 let content_type = super::ContentType::from(content_type);
9179
9180 if !status.is_client_error() && !status.is_server_error() {
9181 let content = resp.text().await?;
9182 match content_type {
9183 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9184 ContentType::Text => {
9185 return Err(Error::from(serde_json::Error::custom(
9186 "Received `text/plain` content type response that cannot be converted to `models::MutualTlsStage`",
9187 )))
9188 }
9189 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9190 "Received `{unknown_type}` content type response that cannot be converted to `models::MutualTlsStage`"
9191 )))),
9192 }
9193 } else {
9194 let content = resp.text().await?;
9195 let entity: Option<StagesMtlsPartialUpdateError> = serde_json::from_str(&content).ok();
9196 Err(Error::ResponseError(ResponseContent {
9197 status,
9198 content,
9199 entity,
9200 }))
9201 }
9202}
9203
9204pub async fn stages_mtls_retrieve(
9206 configuration: &configuration::Configuration,
9207 stage_uuid: &str,
9208) -> Result<models::MutualTlsStage, Error<StagesMtlsRetrieveError>> {
9209 let p_path_stage_uuid = stage_uuid;
9211
9212 let uri_str = format!(
9213 "{}/stages/mtls/{stage_uuid}/",
9214 configuration.base_path,
9215 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9216 );
9217 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9218
9219 if let Some(ref user_agent) = configuration.user_agent {
9220 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9221 }
9222 if let Some(ref token) = configuration.bearer_access_token {
9223 req_builder = req_builder.bearer_auth(token.to_owned());
9224 };
9225
9226 let req = req_builder.build()?;
9227 let resp = configuration.client.execute(req).await?;
9228
9229 let status = resp.status();
9230 let content_type = resp
9231 .headers()
9232 .get("content-type")
9233 .and_then(|v| v.to_str().ok())
9234 .unwrap_or("application/octet-stream");
9235 let content_type = super::ContentType::from(content_type);
9236
9237 if !status.is_client_error() && !status.is_server_error() {
9238 let content = resp.text().await?;
9239 match content_type {
9240 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9241 ContentType::Text => {
9242 return Err(Error::from(serde_json::Error::custom(
9243 "Received `text/plain` content type response that cannot be converted to `models::MutualTlsStage`",
9244 )))
9245 }
9246 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9247 "Received `{unknown_type}` content type response that cannot be converted to `models::MutualTlsStage`"
9248 )))),
9249 }
9250 } else {
9251 let content = resp.text().await?;
9252 let entity: Option<StagesMtlsRetrieveError> = serde_json::from_str(&content).ok();
9253 Err(Error::ResponseError(ResponseContent {
9254 status,
9255 content,
9256 entity,
9257 }))
9258 }
9259}
9260
9261pub async fn stages_mtls_update(
9263 configuration: &configuration::Configuration,
9264 stage_uuid: &str,
9265 mutual_tls_stage_request: models::MutualTlsStageRequest,
9266) -> Result<models::MutualTlsStage, Error<StagesMtlsUpdateError>> {
9267 let p_path_stage_uuid = stage_uuid;
9269 let p_body_mutual_tls_stage_request = mutual_tls_stage_request;
9270
9271 let uri_str = format!(
9272 "{}/stages/mtls/{stage_uuid}/",
9273 configuration.base_path,
9274 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9275 );
9276 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9277
9278 if let Some(ref user_agent) = configuration.user_agent {
9279 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9280 }
9281 if let Some(ref token) = configuration.bearer_access_token {
9282 req_builder = req_builder.bearer_auth(token.to_owned());
9283 };
9284 req_builder = req_builder.json(&p_body_mutual_tls_stage_request);
9285
9286 let req = req_builder.build()?;
9287 let resp = configuration.client.execute(req).await?;
9288
9289 let status = resp.status();
9290 let content_type = resp
9291 .headers()
9292 .get("content-type")
9293 .and_then(|v| v.to_str().ok())
9294 .unwrap_or("application/octet-stream");
9295 let content_type = super::ContentType::from(content_type);
9296
9297 if !status.is_client_error() && !status.is_server_error() {
9298 let content = resp.text().await?;
9299 match content_type {
9300 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9301 ContentType::Text => {
9302 return Err(Error::from(serde_json::Error::custom(
9303 "Received `text/plain` content type response that cannot be converted to `models::MutualTlsStage`",
9304 )))
9305 }
9306 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9307 "Received `{unknown_type}` content type response that cannot be converted to `models::MutualTlsStage`"
9308 )))),
9309 }
9310 } else {
9311 let content = resp.text().await?;
9312 let entity: Option<StagesMtlsUpdateError> = serde_json::from_str(&content).ok();
9313 Err(Error::ResponseError(ResponseContent {
9314 status,
9315 content,
9316 entity,
9317 }))
9318 }
9319}
9320
9321pub async fn stages_mtls_used_by_list(
9323 configuration: &configuration::Configuration,
9324 stage_uuid: &str,
9325) -> Result<Vec<models::UsedBy>, Error<StagesMtlsUsedByListError>> {
9326 let p_path_stage_uuid = stage_uuid;
9328
9329 let uri_str = format!(
9330 "{}/stages/mtls/{stage_uuid}/used_by/",
9331 configuration.base_path,
9332 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9333 );
9334 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9335
9336 if let Some(ref user_agent) = configuration.user_agent {
9337 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9338 }
9339 if let Some(ref token) = configuration.bearer_access_token {
9340 req_builder = req_builder.bearer_auth(token.to_owned());
9341 };
9342
9343 let req = req_builder.build()?;
9344 let resp = configuration.client.execute(req).await?;
9345
9346 let status = resp.status();
9347 let content_type = resp
9348 .headers()
9349 .get("content-type")
9350 .and_then(|v| v.to_str().ok())
9351 .unwrap_or("application/octet-stream");
9352 let content_type = super::ContentType::from(content_type);
9353
9354 if !status.is_client_error() && !status.is_server_error() {
9355 let content = resp.text().await?;
9356 match content_type {
9357 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9358 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
9359 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>`")))),
9360 }
9361 } else {
9362 let content = resp.text().await?;
9363 let entity: Option<StagesMtlsUsedByListError> = serde_json::from_str(&content).ok();
9364 Err(Error::ResponseError(ResponseContent {
9365 status,
9366 content,
9367 entity,
9368 }))
9369 }
9370}
9371
9372pub async fn stages_password_create(
9374 configuration: &configuration::Configuration,
9375 password_stage_request: models::PasswordStageRequest,
9376) -> Result<models::PasswordStage, Error<StagesPasswordCreateError>> {
9377 let p_body_password_stage_request = password_stage_request;
9379
9380 let uri_str = format!("{}/stages/password/", configuration.base_path);
9381 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9382
9383 if let Some(ref user_agent) = configuration.user_agent {
9384 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9385 }
9386 if let Some(ref token) = configuration.bearer_access_token {
9387 req_builder = req_builder.bearer_auth(token.to_owned());
9388 };
9389 req_builder = req_builder.json(&p_body_password_stage_request);
9390
9391 let req = req_builder.build()?;
9392 let resp = configuration.client.execute(req).await?;
9393
9394 let status = resp.status();
9395 let content_type = resp
9396 .headers()
9397 .get("content-type")
9398 .and_then(|v| v.to_str().ok())
9399 .unwrap_or("application/octet-stream");
9400 let content_type = super::ContentType::from(content_type);
9401
9402 if !status.is_client_error() && !status.is_server_error() {
9403 let content = resp.text().await?;
9404 match content_type {
9405 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9406 ContentType::Text => {
9407 return Err(Error::from(serde_json::Error::custom(
9408 "Received `text/plain` content type response that cannot be converted to `models::PasswordStage`",
9409 )))
9410 }
9411 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9412 "Received `{unknown_type}` content type response that cannot be converted to `models::PasswordStage`"
9413 )))),
9414 }
9415 } else {
9416 let content = resp.text().await?;
9417 let entity: Option<StagesPasswordCreateError> = serde_json::from_str(&content).ok();
9418 Err(Error::ResponseError(ResponseContent {
9419 status,
9420 content,
9421 entity,
9422 }))
9423 }
9424}
9425
9426pub async fn stages_password_destroy(
9428 configuration: &configuration::Configuration,
9429 stage_uuid: &str,
9430) -> Result<(), Error<StagesPasswordDestroyError>> {
9431 let p_path_stage_uuid = stage_uuid;
9433
9434 let uri_str = format!(
9435 "{}/stages/password/{stage_uuid}/",
9436 configuration.base_path,
9437 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9438 );
9439 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9440
9441 if let Some(ref user_agent) = configuration.user_agent {
9442 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9443 }
9444 if let Some(ref token) = configuration.bearer_access_token {
9445 req_builder = req_builder.bearer_auth(token.to_owned());
9446 };
9447
9448 let req = req_builder.build()?;
9449 let resp = configuration.client.execute(req).await?;
9450
9451 let status = resp.status();
9452
9453 if !status.is_client_error() && !status.is_server_error() {
9454 Ok(())
9455 } else {
9456 let content = resp.text().await?;
9457 let entity: Option<StagesPasswordDestroyError> = serde_json::from_str(&content).ok();
9458 Err(Error::ResponseError(ResponseContent {
9459 status,
9460 content,
9461 entity,
9462 }))
9463 }
9464}
9465
9466pub async fn stages_password_list(
9468 configuration: &configuration::Configuration,
9469 allow_show_password: Option<bool>,
9470 configure_flow: Option<&str>,
9471 failed_attempts_before_cancel: Option<i32>,
9472 name: Option<&str>,
9473 ordering: Option<&str>,
9474 page: Option<i32>,
9475 page_size: Option<i32>,
9476 search: Option<&str>,
9477) -> Result<models::PaginatedPasswordStageList, Error<StagesPasswordListError>> {
9478 let p_query_allow_show_password = allow_show_password;
9480 let p_query_configure_flow = configure_flow;
9481 let p_query_failed_attempts_before_cancel = failed_attempts_before_cancel;
9482 let p_query_name = name;
9483 let p_query_ordering = ordering;
9484 let p_query_page = page;
9485 let p_query_page_size = page_size;
9486 let p_query_search = search;
9487
9488 let uri_str = format!("{}/stages/password/", configuration.base_path);
9489 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9490
9491 if let Some(ref param_value) = p_query_allow_show_password {
9492 req_builder = req_builder.query(&[("allow_show_password", ¶m_value.to_string())]);
9493 }
9494 if let Some(ref param_value) = p_query_configure_flow {
9495 req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]);
9496 }
9497 if let Some(ref param_value) = p_query_failed_attempts_before_cancel {
9498 req_builder = req_builder.query(&[("failed_attempts_before_cancel", ¶m_value.to_string())]);
9499 }
9500 if let Some(ref param_value) = p_query_name {
9501 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
9502 }
9503 if let Some(ref param_value) = p_query_ordering {
9504 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
9505 }
9506 if let Some(ref param_value) = p_query_page {
9507 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
9508 }
9509 if let Some(ref param_value) = p_query_page_size {
9510 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
9511 }
9512 if let Some(ref param_value) = p_query_search {
9513 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
9514 }
9515 if let Some(ref user_agent) = configuration.user_agent {
9516 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9517 }
9518 if let Some(ref token) = configuration.bearer_access_token {
9519 req_builder = req_builder.bearer_auth(token.to_owned());
9520 };
9521
9522 let req = req_builder.build()?;
9523 let resp = configuration.client.execute(req).await?;
9524
9525 let status = resp.status();
9526 let content_type = resp
9527 .headers()
9528 .get("content-type")
9529 .and_then(|v| v.to_str().ok())
9530 .unwrap_or("application/octet-stream");
9531 let content_type = super::ContentType::from(content_type);
9532
9533 if !status.is_client_error() && !status.is_server_error() {
9534 let content = resp.text().await?;
9535 match content_type {
9536 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9537 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPasswordStageList`"))),
9538 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPasswordStageList`")))),
9539 }
9540 } else {
9541 let content = resp.text().await?;
9542 let entity: Option<StagesPasswordListError> = serde_json::from_str(&content).ok();
9543 Err(Error::ResponseError(ResponseContent {
9544 status,
9545 content,
9546 entity,
9547 }))
9548 }
9549}
9550
9551pub async fn stages_password_partial_update(
9553 configuration: &configuration::Configuration,
9554 stage_uuid: &str,
9555 patched_password_stage_request: Option<models::PatchedPasswordStageRequest>,
9556) -> Result<models::PasswordStage, Error<StagesPasswordPartialUpdateError>> {
9557 let p_path_stage_uuid = stage_uuid;
9559 let p_body_patched_password_stage_request = patched_password_stage_request;
9560
9561 let uri_str = format!(
9562 "{}/stages/password/{stage_uuid}/",
9563 configuration.base_path,
9564 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9565 );
9566 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9567
9568 if let Some(ref user_agent) = configuration.user_agent {
9569 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9570 }
9571 if let Some(ref token) = configuration.bearer_access_token {
9572 req_builder = req_builder.bearer_auth(token.to_owned());
9573 };
9574 req_builder = req_builder.json(&p_body_patched_password_stage_request);
9575
9576 let req = req_builder.build()?;
9577 let resp = configuration.client.execute(req).await?;
9578
9579 let status = resp.status();
9580 let content_type = resp
9581 .headers()
9582 .get("content-type")
9583 .and_then(|v| v.to_str().ok())
9584 .unwrap_or("application/octet-stream");
9585 let content_type = super::ContentType::from(content_type);
9586
9587 if !status.is_client_error() && !status.is_server_error() {
9588 let content = resp.text().await?;
9589 match content_type {
9590 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9591 ContentType::Text => {
9592 return Err(Error::from(serde_json::Error::custom(
9593 "Received `text/plain` content type response that cannot be converted to `models::PasswordStage`",
9594 )))
9595 }
9596 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9597 "Received `{unknown_type}` content type response that cannot be converted to `models::PasswordStage`"
9598 )))),
9599 }
9600 } else {
9601 let content = resp.text().await?;
9602 let entity: Option<StagesPasswordPartialUpdateError> = serde_json::from_str(&content).ok();
9603 Err(Error::ResponseError(ResponseContent {
9604 status,
9605 content,
9606 entity,
9607 }))
9608 }
9609}
9610
9611pub async fn stages_password_retrieve(
9613 configuration: &configuration::Configuration,
9614 stage_uuid: &str,
9615) -> Result<models::PasswordStage, Error<StagesPasswordRetrieveError>> {
9616 let p_path_stage_uuid = stage_uuid;
9618
9619 let uri_str = format!(
9620 "{}/stages/password/{stage_uuid}/",
9621 configuration.base_path,
9622 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9623 );
9624 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9625
9626 if let Some(ref user_agent) = configuration.user_agent {
9627 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9628 }
9629 if let Some(ref token) = configuration.bearer_access_token {
9630 req_builder = req_builder.bearer_auth(token.to_owned());
9631 };
9632
9633 let req = req_builder.build()?;
9634 let resp = configuration.client.execute(req).await?;
9635
9636 let status = resp.status();
9637 let content_type = resp
9638 .headers()
9639 .get("content-type")
9640 .and_then(|v| v.to_str().ok())
9641 .unwrap_or("application/octet-stream");
9642 let content_type = super::ContentType::from(content_type);
9643
9644 if !status.is_client_error() && !status.is_server_error() {
9645 let content = resp.text().await?;
9646 match content_type {
9647 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9648 ContentType::Text => {
9649 return Err(Error::from(serde_json::Error::custom(
9650 "Received `text/plain` content type response that cannot be converted to `models::PasswordStage`",
9651 )))
9652 }
9653 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9654 "Received `{unknown_type}` content type response that cannot be converted to `models::PasswordStage`"
9655 )))),
9656 }
9657 } else {
9658 let content = resp.text().await?;
9659 let entity: Option<StagesPasswordRetrieveError> = serde_json::from_str(&content).ok();
9660 Err(Error::ResponseError(ResponseContent {
9661 status,
9662 content,
9663 entity,
9664 }))
9665 }
9666}
9667
9668pub async fn stages_password_update(
9670 configuration: &configuration::Configuration,
9671 stage_uuid: &str,
9672 password_stage_request: models::PasswordStageRequest,
9673) -> Result<models::PasswordStage, Error<StagesPasswordUpdateError>> {
9674 let p_path_stage_uuid = stage_uuid;
9676 let p_body_password_stage_request = password_stage_request;
9677
9678 let uri_str = format!(
9679 "{}/stages/password/{stage_uuid}/",
9680 configuration.base_path,
9681 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9682 );
9683 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
9684
9685 if let Some(ref user_agent) = configuration.user_agent {
9686 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9687 }
9688 if let Some(ref token) = configuration.bearer_access_token {
9689 req_builder = req_builder.bearer_auth(token.to_owned());
9690 };
9691 req_builder = req_builder.json(&p_body_password_stage_request);
9692
9693 let req = req_builder.build()?;
9694 let resp = configuration.client.execute(req).await?;
9695
9696 let status = resp.status();
9697 let content_type = resp
9698 .headers()
9699 .get("content-type")
9700 .and_then(|v| v.to_str().ok())
9701 .unwrap_or("application/octet-stream");
9702 let content_type = super::ContentType::from(content_type);
9703
9704 if !status.is_client_error() && !status.is_server_error() {
9705 let content = resp.text().await?;
9706 match content_type {
9707 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9708 ContentType::Text => {
9709 return Err(Error::from(serde_json::Error::custom(
9710 "Received `text/plain` content type response that cannot be converted to `models::PasswordStage`",
9711 )))
9712 }
9713 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
9714 "Received `{unknown_type}` content type response that cannot be converted to `models::PasswordStage`"
9715 )))),
9716 }
9717 } else {
9718 let content = resp.text().await?;
9719 let entity: Option<StagesPasswordUpdateError> = serde_json::from_str(&content).ok();
9720 Err(Error::ResponseError(ResponseContent {
9721 status,
9722 content,
9723 entity,
9724 }))
9725 }
9726}
9727
9728pub async fn stages_password_used_by_list(
9730 configuration: &configuration::Configuration,
9731 stage_uuid: &str,
9732) -> Result<Vec<models::UsedBy>, Error<StagesPasswordUsedByListError>> {
9733 let p_path_stage_uuid = stage_uuid;
9735
9736 let uri_str = format!(
9737 "{}/stages/password/{stage_uuid}/used_by/",
9738 configuration.base_path,
9739 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
9740 );
9741 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9742
9743 if let Some(ref user_agent) = configuration.user_agent {
9744 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9745 }
9746 if let Some(ref token) = configuration.bearer_access_token {
9747 req_builder = req_builder.bearer_auth(token.to_owned());
9748 };
9749
9750 let req = req_builder.build()?;
9751 let resp = configuration.client.execute(req).await?;
9752
9753 let status = resp.status();
9754 let content_type = resp
9755 .headers()
9756 .get("content-type")
9757 .and_then(|v| v.to_str().ok())
9758 .unwrap_or("application/octet-stream");
9759 let content_type = super::ContentType::from(content_type);
9760
9761 if !status.is_client_error() && !status.is_server_error() {
9762 let content = resp.text().await?;
9763 match content_type {
9764 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9765 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
9766 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>`")))),
9767 }
9768 } else {
9769 let content = resp.text().await?;
9770 let entity: Option<StagesPasswordUsedByListError> = serde_json::from_str(&content).ok();
9771 Err(Error::ResponseError(ResponseContent {
9772 status,
9773 content,
9774 entity,
9775 }))
9776 }
9777}
9778
9779pub async fn stages_prompt_prompts_create(
9781 configuration: &configuration::Configuration,
9782 prompt_request: models::PromptRequest,
9783) -> Result<models::Prompt, Error<StagesPromptPromptsCreateError>> {
9784 let p_body_prompt_request = prompt_request;
9786
9787 let uri_str = format!("{}/stages/prompt/prompts/", configuration.base_path);
9788 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
9789
9790 if let Some(ref user_agent) = configuration.user_agent {
9791 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9792 }
9793 if let Some(ref token) = configuration.bearer_access_token {
9794 req_builder = req_builder.bearer_auth(token.to_owned());
9795 };
9796 req_builder = req_builder.json(&p_body_prompt_request);
9797
9798 let req = req_builder.build()?;
9799 let resp = configuration.client.execute(req).await?;
9800
9801 let status = resp.status();
9802 let content_type = resp
9803 .headers()
9804 .get("content-type")
9805 .and_then(|v| v.to_str().ok())
9806 .unwrap_or("application/octet-stream");
9807 let content_type = super::ContentType::from(content_type);
9808
9809 if !status.is_client_error() && !status.is_server_error() {
9810 let content = resp.text().await?;
9811 match content_type {
9812 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9813 ContentType::Text => {
9814 return Err(Error::from(serde_json::Error::custom(
9815 "Received `text/plain` content type response that cannot be converted to `models::Prompt`",
9816 )))
9817 }
9818 ContentType::Unsupported(unknown_type) => {
9819 return Err(Error::from(serde_json::Error::custom(format!(
9820 "Received `{unknown_type}` content type response that cannot be converted to `models::Prompt`"
9821 ))))
9822 }
9823 }
9824 } else {
9825 let content = resp.text().await?;
9826 let entity: Option<StagesPromptPromptsCreateError> = serde_json::from_str(&content).ok();
9827 Err(Error::ResponseError(ResponseContent {
9828 status,
9829 content,
9830 entity,
9831 }))
9832 }
9833}
9834
9835pub async fn stages_prompt_prompts_destroy(
9837 configuration: &configuration::Configuration,
9838 prompt_uuid: &str,
9839) -> Result<(), Error<StagesPromptPromptsDestroyError>> {
9840 let p_path_prompt_uuid = prompt_uuid;
9842
9843 let uri_str = format!(
9844 "{}/stages/prompt/prompts/{prompt_uuid}/",
9845 configuration.base_path,
9846 prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid)
9847 );
9848 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
9849
9850 if let Some(ref user_agent) = configuration.user_agent {
9851 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9852 }
9853 if let Some(ref token) = configuration.bearer_access_token {
9854 req_builder = req_builder.bearer_auth(token.to_owned());
9855 };
9856
9857 let req = req_builder.build()?;
9858 let resp = configuration.client.execute(req).await?;
9859
9860 let status = resp.status();
9861
9862 if !status.is_client_error() && !status.is_server_error() {
9863 Ok(())
9864 } else {
9865 let content = resp.text().await?;
9866 let entity: Option<StagesPromptPromptsDestroyError> = serde_json::from_str(&content).ok();
9867 Err(Error::ResponseError(ResponseContent {
9868 status,
9869 content,
9870 entity,
9871 }))
9872 }
9873}
9874
9875pub async fn stages_prompt_prompts_list(
9877 configuration: &configuration::Configuration,
9878 field_key: Option<&str>,
9879 label: Option<&str>,
9880 name: Option<&str>,
9881 ordering: Option<&str>,
9882 page: Option<i32>,
9883 page_size: Option<i32>,
9884 placeholder: Option<&str>,
9885 search: Option<&str>,
9886 r#type: Option<&str>,
9887) -> Result<models::PaginatedPromptList, Error<StagesPromptPromptsListError>> {
9888 let p_query_field_key = field_key;
9890 let p_query_label = label;
9891 let p_query_name = name;
9892 let p_query_ordering = ordering;
9893 let p_query_page = page;
9894 let p_query_page_size = page_size;
9895 let p_query_placeholder = placeholder;
9896 let p_query_search = search;
9897 let p_query_type = r#type;
9898
9899 let uri_str = format!("{}/stages/prompt/prompts/", configuration.base_path);
9900 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
9901
9902 if let Some(ref param_value) = p_query_field_key {
9903 req_builder = req_builder.query(&[("field_key", ¶m_value.to_string())]);
9904 }
9905 if let Some(ref param_value) = p_query_label {
9906 req_builder = req_builder.query(&[("label", ¶m_value.to_string())]);
9907 }
9908 if let Some(ref param_value) = p_query_name {
9909 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
9910 }
9911 if let Some(ref param_value) = p_query_ordering {
9912 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
9913 }
9914 if let Some(ref param_value) = p_query_page {
9915 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
9916 }
9917 if let Some(ref param_value) = p_query_page_size {
9918 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
9919 }
9920 if let Some(ref param_value) = p_query_placeholder {
9921 req_builder = req_builder.query(&[("placeholder", ¶m_value.to_string())]);
9922 }
9923 if let Some(ref param_value) = p_query_search {
9924 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
9925 }
9926 if let Some(ref param_value) = p_query_type {
9927 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
9928 }
9929 if let Some(ref user_agent) = configuration.user_agent {
9930 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9931 }
9932 if let Some(ref token) = configuration.bearer_access_token {
9933 req_builder = req_builder.bearer_auth(token.to_owned());
9934 };
9935
9936 let req = req_builder.build()?;
9937 let resp = configuration.client.execute(req).await?;
9938
9939 let status = resp.status();
9940 let content_type = resp
9941 .headers()
9942 .get("content-type")
9943 .and_then(|v| v.to_str().ok())
9944 .unwrap_or("application/octet-stream");
9945 let content_type = super::ContentType::from(content_type);
9946
9947 if !status.is_client_error() && !status.is_server_error() {
9948 let content = resp.text().await?;
9949 match content_type {
9950 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
9951 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPromptList`"))),
9952 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPromptList`")))),
9953 }
9954 } else {
9955 let content = resp.text().await?;
9956 let entity: Option<StagesPromptPromptsListError> = serde_json::from_str(&content).ok();
9957 Err(Error::ResponseError(ResponseContent {
9958 status,
9959 content,
9960 entity,
9961 }))
9962 }
9963}
9964
9965pub async fn stages_prompt_prompts_partial_update(
9967 configuration: &configuration::Configuration,
9968 prompt_uuid: &str,
9969 patched_prompt_request: Option<models::PatchedPromptRequest>,
9970) -> Result<models::Prompt, Error<StagesPromptPromptsPartialUpdateError>> {
9971 let p_path_prompt_uuid = prompt_uuid;
9973 let p_body_patched_prompt_request = patched_prompt_request;
9974
9975 let uri_str = format!(
9976 "{}/stages/prompt/prompts/{prompt_uuid}/",
9977 configuration.base_path,
9978 prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid)
9979 );
9980 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
9981
9982 if let Some(ref user_agent) = configuration.user_agent {
9983 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
9984 }
9985 if let Some(ref token) = configuration.bearer_access_token {
9986 req_builder = req_builder.bearer_auth(token.to_owned());
9987 };
9988 req_builder = req_builder.json(&p_body_patched_prompt_request);
9989
9990 let req = req_builder.build()?;
9991 let resp = configuration.client.execute(req).await?;
9992
9993 let status = resp.status();
9994 let content_type = resp
9995 .headers()
9996 .get("content-type")
9997 .and_then(|v| v.to_str().ok())
9998 .unwrap_or("application/octet-stream");
9999 let content_type = super::ContentType::from(content_type);
10000
10001 if !status.is_client_error() && !status.is_server_error() {
10002 let content = resp.text().await?;
10003 match content_type {
10004 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10005 ContentType::Text => {
10006 return Err(Error::from(serde_json::Error::custom(
10007 "Received `text/plain` content type response that cannot be converted to `models::Prompt`",
10008 )))
10009 }
10010 ContentType::Unsupported(unknown_type) => {
10011 return Err(Error::from(serde_json::Error::custom(format!(
10012 "Received `{unknown_type}` content type response that cannot be converted to `models::Prompt`"
10013 ))))
10014 }
10015 }
10016 } else {
10017 let content = resp.text().await?;
10018 let entity: Option<StagesPromptPromptsPartialUpdateError> = serde_json::from_str(&content).ok();
10019 Err(Error::ResponseError(ResponseContent {
10020 status,
10021 content,
10022 entity,
10023 }))
10024 }
10025}
10026
10027pub async fn stages_prompt_prompts_preview_create(
10029 configuration: &configuration::Configuration,
10030 prompt_request: models::PromptRequest,
10031) -> Result<models::PromptChallenge, Error<StagesPromptPromptsPreviewCreateError>> {
10032 let p_body_prompt_request = prompt_request;
10034
10035 let uri_str = format!("{}/stages/prompt/prompts/preview/", configuration.base_path);
10036 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10037
10038 if let Some(ref user_agent) = configuration.user_agent {
10039 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10040 }
10041 if let Some(ref token) = configuration.bearer_access_token {
10042 req_builder = req_builder.bearer_auth(token.to_owned());
10043 };
10044 req_builder = req_builder.json(&p_body_prompt_request);
10045
10046 let req = req_builder.build()?;
10047 let resp = configuration.client.execute(req).await?;
10048
10049 let status = resp.status();
10050 let content_type = resp
10051 .headers()
10052 .get("content-type")
10053 .and_then(|v| v.to_str().ok())
10054 .unwrap_or("application/octet-stream");
10055 let content_type = super::ContentType::from(content_type);
10056
10057 if !status.is_client_error() && !status.is_server_error() {
10058 let content = resp.text().await?;
10059 match content_type {
10060 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10061 ContentType::Text => {
10062 return Err(Error::from(serde_json::Error::custom(
10063 "Received `text/plain` content type response that cannot be converted to `models::PromptChallenge`",
10064 )))
10065 }
10066 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
10067 "Received `{unknown_type}` content type response that cannot be converted to `models::PromptChallenge`"
10068 )))),
10069 }
10070 } else {
10071 let content = resp.text().await?;
10072 let entity: Option<StagesPromptPromptsPreviewCreateError> = serde_json::from_str(&content).ok();
10073 Err(Error::ResponseError(ResponseContent {
10074 status,
10075 content,
10076 entity,
10077 }))
10078 }
10079}
10080
10081pub async fn stages_prompt_prompts_retrieve(
10083 configuration: &configuration::Configuration,
10084 prompt_uuid: &str,
10085) -> Result<models::Prompt, Error<StagesPromptPromptsRetrieveError>> {
10086 let p_path_prompt_uuid = prompt_uuid;
10088
10089 let uri_str = format!(
10090 "{}/stages/prompt/prompts/{prompt_uuid}/",
10091 configuration.base_path,
10092 prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid)
10093 );
10094 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10095
10096 if let Some(ref user_agent) = configuration.user_agent {
10097 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10098 }
10099 if let Some(ref token) = configuration.bearer_access_token {
10100 req_builder = req_builder.bearer_auth(token.to_owned());
10101 };
10102
10103 let req = req_builder.build()?;
10104 let resp = configuration.client.execute(req).await?;
10105
10106 let status = resp.status();
10107 let content_type = resp
10108 .headers()
10109 .get("content-type")
10110 .and_then(|v| v.to_str().ok())
10111 .unwrap_or("application/octet-stream");
10112 let content_type = super::ContentType::from(content_type);
10113
10114 if !status.is_client_error() && !status.is_server_error() {
10115 let content = resp.text().await?;
10116 match content_type {
10117 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10118 ContentType::Text => {
10119 return Err(Error::from(serde_json::Error::custom(
10120 "Received `text/plain` content type response that cannot be converted to `models::Prompt`",
10121 )))
10122 }
10123 ContentType::Unsupported(unknown_type) => {
10124 return Err(Error::from(serde_json::Error::custom(format!(
10125 "Received `{unknown_type}` content type response that cannot be converted to `models::Prompt`"
10126 ))))
10127 }
10128 }
10129 } else {
10130 let content = resp.text().await?;
10131 let entity: Option<StagesPromptPromptsRetrieveError> = serde_json::from_str(&content).ok();
10132 Err(Error::ResponseError(ResponseContent {
10133 status,
10134 content,
10135 entity,
10136 }))
10137 }
10138}
10139
10140pub async fn stages_prompt_prompts_update(
10142 configuration: &configuration::Configuration,
10143 prompt_uuid: &str,
10144 prompt_request: models::PromptRequest,
10145) -> Result<models::Prompt, Error<StagesPromptPromptsUpdateError>> {
10146 let p_path_prompt_uuid = prompt_uuid;
10148 let p_body_prompt_request = prompt_request;
10149
10150 let uri_str = format!(
10151 "{}/stages/prompt/prompts/{prompt_uuid}/",
10152 configuration.base_path,
10153 prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid)
10154 );
10155 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10156
10157 if let Some(ref user_agent) = configuration.user_agent {
10158 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10159 }
10160 if let Some(ref token) = configuration.bearer_access_token {
10161 req_builder = req_builder.bearer_auth(token.to_owned());
10162 };
10163 req_builder = req_builder.json(&p_body_prompt_request);
10164
10165 let req = req_builder.build()?;
10166 let resp = configuration.client.execute(req).await?;
10167
10168 let status = resp.status();
10169 let content_type = resp
10170 .headers()
10171 .get("content-type")
10172 .and_then(|v| v.to_str().ok())
10173 .unwrap_or("application/octet-stream");
10174 let content_type = super::ContentType::from(content_type);
10175
10176 if !status.is_client_error() && !status.is_server_error() {
10177 let content = resp.text().await?;
10178 match content_type {
10179 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10180 ContentType::Text => {
10181 return Err(Error::from(serde_json::Error::custom(
10182 "Received `text/plain` content type response that cannot be converted to `models::Prompt`",
10183 )))
10184 }
10185 ContentType::Unsupported(unknown_type) => {
10186 return Err(Error::from(serde_json::Error::custom(format!(
10187 "Received `{unknown_type}` content type response that cannot be converted to `models::Prompt`"
10188 ))))
10189 }
10190 }
10191 } else {
10192 let content = resp.text().await?;
10193 let entity: Option<StagesPromptPromptsUpdateError> = serde_json::from_str(&content).ok();
10194 Err(Error::ResponseError(ResponseContent {
10195 status,
10196 content,
10197 entity,
10198 }))
10199 }
10200}
10201
10202pub async fn stages_prompt_prompts_used_by_list(
10204 configuration: &configuration::Configuration,
10205 prompt_uuid: &str,
10206) -> Result<Vec<models::UsedBy>, Error<StagesPromptPromptsUsedByListError>> {
10207 let p_path_prompt_uuid = prompt_uuid;
10209
10210 let uri_str = format!(
10211 "{}/stages/prompt/prompts/{prompt_uuid}/used_by/",
10212 configuration.base_path,
10213 prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid)
10214 );
10215 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10216
10217 if let Some(ref user_agent) = configuration.user_agent {
10218 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10219 }
10220 if let Some(ref token) = configuration.bearer_access_token {
10221 req_builder = req_builder.bearer_auth(token.to_owned());
10222 };
10223
10224 let req = req_builder.build()?;
10225 let resp = configuration.client.execute(req).await?;
10226
10227 let status = resp.status();
10228 let content_type = resp
10229 .headers()
10230 .get("content-type")
10231 .and_then(|v| v.to_str().ok())
10232 .unwrap_or("application/octet-stream");
10233 let content_type = super::ContentType::from(content_type);
10234
10235 if !status.is_client_error() && !status.is_server_error() {
10236 let content = resp.text().await?;
10237 match content_type {
10238 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10239 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
10240 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>`")))),
10241 }
10242 } else {
10243 let content = resp.text().await?;
10244 let entity: Option<StagesPromptPromptsUsedByListError> = serde_json::from_str(&content).ok();
10245 Err(Error::ResponseError(ResponseContent {
10246 status,
10247 content,
10248 entity,
10249 }))
10250 }
10251}
10252
10253pub async fn stages_prompt_stages_create(
10255 configuration: &configuration::Configuration,
10256 prompt_stage_request: models::PromptStageRequest,
10257) -> Result<models::PromptStage, Error<StagesPromptStagesCreateError>> {
10258 let p_body_prompt_stage_request = prompt_stage_request;
10260
10261 let uri_str = format!("{}/stages/prompt/stages/", configuration.base_path);
10262 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10263
10264 if let Some(ref user_agent) = configuration.user_agent {
10265 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10266 }
10267 if let Some(ref token) = configuration.bearer_access_token {
10268 req_builder = req_builder.bearer_auth(token.to_owned());
10269 };
10270 req_builder = req_builder.json(&p_body_prompt_stage_request);
10271
10272 let req = req_builder.build()?;
10273 let resp = configuration.client.execute(req).await?;
10274
10275 let status = resp.status();
10276 let content_type = resp
10277 .headers()
10278 .get("content-type")
10279 .and_then(|v| v.to_str().ok())
10280 .unwrap_or("application/octet-stream");
10281 let content_type = super::ContentType::from(content_type);
10282
10283 if !status.is_client_error() && !status.is_server_error() {
10284 let content = resp.text().await?;
10285 match content_type {
10286 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10287 ContentType::Text => {
10288 return Err(Error::from(serde_json::Error::custom(
10289 "Received `text/plain` content type response that cannot be converted to `models::PromptStage`",
10290 )))
10291 }
10292 ContentType::Unsupported(unknown_type) => {
10293 return Err(Error::from(serde_json::Error::custom(format!(
10294 "Received `{unknown_type}` content type response that cannot be converted to `models::PromptStage`"
10295 ))))
10296 }
10297 }
10298 } else {
10299 let content = resp.text().await?;
10300 let entity: Option<StagesPromptStagesCreateError> = serde_json::from_str(&content).ok();
10301 Err(Error::ResponseError(ResponseContent {
10302 status,
10303 content,
10304 entity,
10305 }))
10306 }
10307}
10308
10309pub async fn stages_prompt_stages_destroy(
10311 configuration: &configuration::Configuration,
10312 stage_uuid: &str,
10313) -> Result<(), Error<StagesPromptStagesDestroyError>> {
10314 let p_path_stage_uuid = stage_uuid;
10316
10317 let uri_str = format!(
10318 "{}/stages/prompt/stages/{stage_uuid}/",
10319 configuration.base_path,
10320 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10321 );
10322 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10323
10324 if let Some(ref user_agent) = configuration.user_agent {
10325 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10326 }
10327 if let Some(ref token) = configuration.bearer_access_token {
10328 req_builder = req_builder.bearer_auth(token.to_owned());
10329 };
10330
10331 let req = req_builder.build()?;
10332 let resp = configuration.client.execute(req).await?;
10333
10334 let status = resp.status();
10335
10336 if !status.is_client_error() && !status.is_server_error() {
10337 Ok(())
10338 } else {
10339 let content = resp.text().await?;
10340 let entity: Option<StagesPromptStagesDestroyError> = serde_json::from_str(&content).ok();
10341 Err(Error::ResponseError(ResponseContent {
10342 status,
10343 content,
10344 entity,
10345 }))
10346 }
10347}
10348
10349pub async fn stages_prompt_stages_list(
10351 configuration: &configuration::Configuration,
10352 fields: Option<Vec<uuid::Uuid>>,
10353 name: Option<&str>,
10354 ordering: Option<&str>,
10355 page: Option<i32>,
10356 page_size: Option<i32>,
10357 search: Option<&str>,
10358 stage_uuid: Option<&str>,
10359 validation_policies: Option<Vec<uuid::Uuid>>,
10360) -> Result<models::PaginatedPromptStageList, Error<StagesPromptStagesListError>> {
10361 let p_query_fields = fields;
10363 let p_query_name = name;
10364 let p_query_ordering = ordering;
10365 let p_query_page = page;
10366 let p_query_page_size = page_size;
10367 let p_query_search = search;
10368 let p_query_stage_uuid = stage_uuid;
10369 let p_query_validation_policies = validation_policies;
10370
10371 let uri_str = format!("{}/stages/prompt/stages/", configuration.base_path);
10372 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10373
10374 if let Some(ref param_value) = p_query_fields {
10375 req_builder = match "multi" {
10376 "multi" => req_builder.query(
10377 ¶m_value
10378 .into_iter()
10379 .map(|p| ("fields".to_owned(), p.to_string()))
10380 .collect::<Vec<(std::string::String, std::string::String)>>(),
10381 ),
10382 _ => req_builder.query(&[(
10383 "fields",
10384 ¶m_value
10385 .into_iter()
10386 .map(|p| p.to_string())
10387 .collect::<Vec<String>>()
10388 .join(",")
10389 .to_string(),
10390 )]),
10391 };
10392 }
10393 if let Some(ref param_value) = p_query_name {
10394 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
10395 }
10396 if let Some(ref param_value) = p_query_ordering {
10397 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
10398 }
10399 if let Some(ref param_value) = p_query_page {
10400 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
10401 }
10402 if let Some(ref param_value) = p_query_page_size {
10403 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
10404 }
10405 if let Some(ref param_value) = p_query_search {
10406 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
10407 }
10408 if let Some(ref param_value) = p_query_stage_uuid {
10409 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
10410 }
10411 if let Some(ref param_value) = p_query_validation_policies {
10412 req_builder = match "multi" {
10413 "multi" => req_builder.query(
10414 ¶m_value
10415 .into_iter()
10416 .map(|p| ("validation_policies".to_owned(), p.to_string()))
10417 .collect::<Vec<(std::string::String, std::string::String)>>(),
10418 ),
10419 _ => req_builder.query(&[(
10420 "validation_policies",
10421 ¶m_value
10422 .into_iter()
10423 .map(|p| p.to_string())
10424 .collect::<Vec<String>>()
10425 .join(",")
10426 .to_string(),
10427 )]),
10428 };
10429 }
10430 if let Some(ref user_agent) = configuration.user_agent {
10431 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10432 }
10433 if let Some(ref token) = configuration.bearer_access_token {
10434 req_builder = req_builder.bearer_auth(token.to_owned());
10435 };
10436
10437 let req = req_builder.build()?;
10438 let resp = configuration.client.execute(req).await?;
10439
10440 let status = resp.status();
10441 let content_type = resp
10442 .headers()
10443 .get("content-type")
10444 .and_then(|v| v.to_str().ok())
10445 .unwrap_or("application/octet-stream");
10446 let content_type = super::ContentType::from(content_type);
10447
10448 if !status.is_client_error() && !status.is_server_error() {
10449 let content = resp.text().await?;
10450 match content_type {
10451 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10452 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPromptStageList`"))),
10453 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPromptStageList`")))),
10454 }
10455 } else {
10456 let content = resp.text().await?;
10457 let entity: Option<StagesPromptStagesListError> = serde_json::from_str(&content).ok();
10458 Err(Error::ResponseError(ResponseContent {
10459 status,
10460 content,
10461 entity,
10462 }))
10463 }
10464}
10465
10466pub async fn stages_prompt_stages_partial_update(
10468 configuration: &configuration::Configuration,
10469 stage_uuid: &str,
10470 patched_prompt_stage_request: Option<models::PatchedPromptStageRequest>,
10471) -> Result<models::PromptStage, Error<StagesPromptStagesPartialUpdateError>> {
10472 let p_path_stage_uuid = stage_uuid;
10474 let p_body_patched_prompt_stage_request = patched_prompt_stage_request;
10475
10476 let uri_str = format!(
10477 "{}/stages/prompt/stages/{stage_uuid}/",
10478 configuration.base_path,
10479 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10480 );
10481 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10482
10483 if let Some(ref user_agent) = configuration.user_agent {
10484 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10485 }
10486 if let Some(ref token) = configuration.bearer_access_token {
10487 req_builder = req_builder.bearer_auth(token.to_owned());
10488 };
10489 req_builder = req_builder.json(&p_body_patched_prompt_stage_request);
10490
10491 let req = req_builder.build()?;
10492 let resp = configuration.client.execute(req).await?;
10493
10494 let status = resp.status();
10495 let content_type = resp
10496 .headers()
10497 .get("content-type")
10498 .and_then(|v| v.to_str().ok())
10499 .unwrap_or("application/octet-stream");
10500 let content_type = super::ContentType::from(content_type);
10501
10502 if !status.is_client_error() && !status.is_server_error() {
10503 let content = resp.text().await?;
10504 match content_type {
10505 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10506 ContentType::Text => {
10507 return Err(Error::from(serde_json::Error::custom(
10508 "Received `text/plain` content type response that cannot be converted to `models::PromptStage`",
10509 )))
10510 }
10511 ContentType::Unsupported(unknown_type) => {
10512 return Err(Error::from(serde_json::Error::custom(format!(
10513 "Received `{unknown_type}` content type response that cannot be converted to `models::PromptStage`"
10514 ))))
10515 }
10516 }
10517 } else {
10518 let content = resp.text().await?;
10519 let entity: Option<StagesPromptStagesPartialUpdateError> = serde_json::from_str(&content).ok();
10520 Err(Error::ResponseError(ResponseContent {
10521 status,
10522 content,
10523 entity,
10524 }))
10525 }
10526}
10527
10528pub async fn stages_prompt_stages_retrieve(
10530 configuration: &configuration::Configuration,
10531 stage_uuid: &str,
10532) -> Result<models::PromptStage, Error<StagesPromptStagesRetrieveError>> {
10533 let p_path_stage_uuid = stage_uuid;
10535
10536 let uri_str = format!(
10537 "{}/stages/prompt/stages/{stage_uuid}/",
10538 configuration.base_path,
10539 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10540 );
10541 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10542
10543 if let Some(ref user_agent) = configuration.user_agent {
10544 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10545 }
10546 if let Some(ref token) = configuration.bearer_access_token {
10547 req_builder = req_builder.bearer_auth(token.to_owned());
10548 };
10549
10550 let req = req_builder.build()?;
10551 let resp = configuration.client.execute(req).await?;
10552
10553 let status = resp.status();
10554 let content_type = resp
10555 .headers()
10556 .get("content-type")
10557 .and_then(|v| v.to_str().ok())
10558 .unwrap_or("application/octet-stream");
10559 let content_type = super::ContentType::from(content_type);
10560
10561 if !status.is_client_error() && !status.is_server_error() {
10562 let content = resp.text().await?;
10563 match content_type {
10564 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10565 ContentType::Text => {
10566 return Err(Error::from(serde_json::Error::custom(
10567 "Received `text/plain` content type response that cannot be converted to `models::PromptStage`",
10568 )))
10569 }
10570 ContentType::Unsupported(unknown_type) => {
10571 return Err(Error::from(serde_json::Error::custom(format!(
10572 "Received `{unknown_type}` content type response that cannot be converted to `models::PromptStage`"
10573 ))))
10574 }
10575 }
10576 } else {
10577 let content = resp.text().await?;
10578 let entity: Option<StagesPromptStagesRetrieveError> = serde_json::from_str(&content).ok();
10579 Err(Error::ResponseError(ResponseContent {
10580 status,
10581 content,
10582 entity,
10583 }))
10584 }
10585}
10586
10587pub async fn stages_prompt_stages_update(
10589 configuration: &configuration::Configuration,
10590 stage_uuid: &str,
10591 prompt_stage_request: models::PromptStageRequest,
10592) -> Result<models::PromptStage, Error<StagesPromptStagesUpdateError>> {
10593 let p_path_stage_uuid = stage_uuid;
10595 let p_body_prompt_stage_request = prompt_stage_request;
10596
10597 let uri_str = format!(
10598 "{}/stages/prompt/stages/{stage_uuid}/",
10599 configuration.base_path,
10600 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10601 );
10602 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10603
10604 if let Some(ref user_agent) = configuration.user_agent {
10605 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10606 }
10607 if let Some(ref token) = configuration.bearer_access_token {
10608 req_builder = req_builder.bearer_auth(token.to_owned());
10609 };
10610 req_builder = req_builder.json(&p_body_prompt_stage_request);
10611
10612 let req = req_builder.build()?;
10613 let resp = configuration.client.execute(req).await?;
10614
10615 let status = resp.status();
10616 let content_type = resp
10617 .headers()
10618 .get("content-type")
10619 .and_then(|v| v.to_str().ok())
10620 .unwrap_or("application/octet-stream");
10621 let content_type = super::ContentType::from(content_type);
10622
10623 if !status.is_client_error() && !status.is_server_error() {
10624 let content = resp.text().await?;
10625 match content_type {
10626 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10627 ContentType::Text => {
10628 return Err(Error::from(serde_json::Error::custom(
10629 "Received `text/plain` content type response that cannot be converted to `models::PromptStage`",
10630 )))
10631 }
10632 ContentType::Unsupported(unknown_type) => {
10633 return Err(Error::from(serde_json::Error::custom(format!(
10634 "Received `{unknown_type}` content type response that cannot be converted to `models::PromptStage`"
10635 ))))
10636 }
10637 }
10638 } else {
10639 let content = resp.text().await?;
10640 let entity: Option<StagesPromptStagesUpdateError> = serde_json::from_str(&content).ok();
10641 Err(Error::ResponseError(ResponseContent {
10642 status,
10643 content,
10644 entity,
10645 }))
10646 }
10647}
10648
10649pub async fn stages_prompt_stages_used_by_list(
10651 configuration: &configuration::Configuration,
10652 stage_uuid: &str,
10653) -> Result<Vec<models::UsedBy>, Error<StagesPromptStagesUsedByListError>> {
10654 let p_path_stage_uuid = stage_uuid;
10656
10657 let uri_str = format!(
10658 "{}/stages/prompt/stages/{stage_uuid}/used_by/",
10659 configuration.base_path,
10660 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10661 );
10662 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10663
10664 if let Some(ref user_agent) = configuration.user_agent {
10665 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10666 }
10667 if let Some(ref token) = configuration.bearer_access_token {
10668 req_builder = req_builder.bearer_auth(token.to_owned());
10669 };
10670
10671 let req = req_builder.build()?;
10672 let resp = configuration.client.execute(req).await?;
10673
10674 let status = resp.status();
10675 let content_type = resp
10676 .headers()
10677 .get("content-type")
10678 .and_then(|v| v.to_str().ok())
10679 .unwrap_or("application/octet-stream");
10680 let content_type = super::ContentType::from(content_type);
10681
10682 if !status.is_client_error() && !status.is_server_error() {
10683 let content = resp.text().await?;
10684 match content_type {
10685 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10686 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
10687 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>`")))),
10688 }
10689 } else {
10690 let content = resp.text().await?;
10691 let entity: Option<StagesPromptStagesUsedByListError> = serde_json::from_str(&content).ok();
10692 Err(Error::ResponseError(ResponseContent {
10693 status,
10694 content,
10695 entity,
10696 }))
10697 }
10698}
10699
10700pub async fn stages_redirect_create(
10702 configuration: &configuration::Configuration,
10703 redirect_stage_request: models::RedirectStageRequest,
10704) -> Result<models::RedirectStage, Error<StagesRedirectCreateError>> {
10705 let p_body_redirect_stage_request = redirect_stage_request;
10707
10708 let uri_str = format!("{}/stages/redirect/", configuration.base_path);
10709 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
10710
10711 if let Some(ref user_agent) = configuration.user_agent {
10712 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10713 }
10714 if let Some(ref token) = configuration.bearer_access_token {
10715 req_builder = req_builder.bearer_auth(token.to_owned());
10716 };
10717 req_builder = req_builder.json(&p_body_redirect_stage_request);
10718
10719 let req = req_builder.build()?;
10720 let resp = configuration.client.execute(req).await?;
10721
10722 let status = resp.status();
10723 let content_type = resp
10724 .headers()
10725 .get("content-type")
10726 .and_then(|v| v.to_str().ok())
10727 .unwrap_or("application/octet-stream");
10728 let content_type = super::ContentType::from(content_type);
10729
10730 if !status.is_client_error() && !status.is_server_error() {
10731 let content = resp.text().await?;
10732 match content_type {
10733 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10734 ContentType::Text => {
10735 return Err(Error::from(serde_json::Error::custom(
10736 "Received `text/plain` content type response that cannot be converted to `models::RedirectStage`",
10737 )))
10738 }
10739 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
10740 "Received `{unknown_type}` content type response that cannot be converted to `models::RedirectStage`"
10741 )))),
10742 }
10743 } else {
10744 let content = resp.text().await?;
10745 let entity: Option<StagesRedirectCreateError> = serde_json::from_str(&content).ok();
10746 Err(Error::ResponseError(ResponseContent {
10747 status,
10748 content,
10749 entity,
10750 }))
10751 }
10752}
10753
10754pub async fn stages_redirect_destroy(
10756 configuration: &configuration::Configuration,
10757 stage_uuid: &str,
10758) -> Result<(), Error<StagesRedirectDestroyError>> {
10759 let p_path_stage_uuid = stage_uuid;
10761
10762 let uri_str = format!(
10763 "{}/stages/redirect/{stage_uuid}/",
10764 configuration.base_path,
10765 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10766 );
10767 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
10768
10769 if let Some(ref user_agent) = configuration.user_agent {
10770 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10771 }
10772 if let Some(ref token) = configuration.bearer_access_token {
10773 req_builder = req_builder.bearer_auth(token.to_owned());
10774 };
10775
10776 let req = req_builder.build()?;
10777 let resp = configuration.client.execute(req).await?;
10778
10779 let status = resp.status();
10780
10781 if !status.is_client_error() && !status.is_server_error() {
10782 Ok(())
10783 } else {
10784 let content = resp.text().await?;
10785 let entity: Option<StagesRedirectDestroyError> = serde_json::from_str(&content).ok();
10786 Err(Error::ResponseError(ResponseContent {
10787 status,
10788 content,
10789 entity,
10790 }))
10791 }
10792}
10793
10794pub async fn stages_redirect_list(
10796 configuration: &configuration::Configuration,
10797 name: Option<&str>,
10798 ordering: Option<&str>,
10799 page: Option<i32>,
10800 page_size: Option<i32>,
10801 search: Option<&str>,
10802) -> Result<models::PaginatedRedirectStageList, Error<StagesRedirectListError>> {
10803 let p_query_name = name;
10805 let p_query_ordering = ordering;
10806 let p_query_page = page;
10807 let p_query_page_size = page_size;
10808 let p_query_search = search;
10809
10810 let uri_str = format!("{}/stages/redirect/", configuration.base_path);
10811 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10812
10813 if let Some(ref param_value) = p_query_name {
10814 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
10815 }
10816 if let Some(ref param_value) = p_query_ordering {
10817 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
10818 }
10819 if let Some(ref param_value) = p_query_page {
10820 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
10821 }
10822 if let Some(ref param_value) = p_query_page_size {
10823 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
10824 }
10825 if let Some(ref param_value) = p_query_search {
10826 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
10827 }
10828 if let Some(ref user_agent) = configuration.user_agent {
10829 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10830 }
10831 if let Some(ref token) = configuration.bearer_access_token {
10832 req_builder = req_builder.bearer_auth(token.to_owned());
10833 };
10834
10835 let req = req_builder.build()?;
10836 let resp = configuration.client.execute(req).await?;
10837
10838 let status = resp.status();
10839 let content_type = resp
10840 .headers()
10841 .get("content-type")
10842 .and_then(|v| v.to_str().ok())
10843 .unwrap_or("application/octet-stream");
10844 let content_type = super::ContentType::from(content_type);
10845
10846 if !status.is_client_error() && !status.is_server_error() {
10847 let content = resp.text().await?;
10848 match content_type {
10849 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10850 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRedirectStageList`"))),
10851 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedRedirectStageList`")))),
10852 }
10853 } else {
10854 let content = resp.text().await?;
10855 let entity: Option<StagesRedirectListError> = serde_json::from_str(&content).ok();
10856 Err(Error::ResponseError(ResponseContent {
10857 status,
10858 content,
10859 entity,
10860 }))
10861 }
10862}
10863
10864pub async fn stages_redirect_partial_update(
10866 configuration: &configuration::Configuration,
10867 stage_uuid: &str,
10868 patched_redirect_stage_request: Option<models::PatchedRedirectStageRequest>,
10869) -> Result<models::RedirectStage, Error<StagesRedirectPartialUpdateError>> {
10870 let p_path_stage_uuid = stage_uuid;
10872 let p_body_patched_redirect_stage_request = patched_redirect_stage_request;
10873
10874 let uri_str = format!(
10875 "{}/stages/redirect/{stage_uuid}/",
10876 configuration.base_path,
10877 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10878 );
10879 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
10880
10881 if let Some(ref user_agent) = configuration.user_agent {
10882 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10883 }
10884 if let Some(ref token) = configuration.bearer_access_token {
10885 req_builder = req_builder.bearer_auth(token.to_owned());
10886 };
10887 req_builder = req_builder.json(&p_body_patched_redirect_stage_request);
10888
10889 let req = req_builder.build()?;
10890 let resp = configuration.client.execute(req).await?;
10891
10892 let status = resp.status();
10893 let content_type = resp
10894 .headers()
10895 .get("content-type")
10896 .and_then(|v| v.to_str().ok())
10897 .unwrap_or("application/octet-stream");
10898 let content_type = super::ContentType::from(content_type);
10899
10900 if !status.is_client_error() && !status.is_server_error() {
10901 let content = resp.text().await?;
10902 match content_type {
10903 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10904 ContentType::Text => {
10905 return Err(Error::from(serde_json::Error::custom(
10906 "Received `text/plain` content type response that cannot be converted to `models::RedirectStage`",
10907 )))
10908 }
10909 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
10910 "Received `{unknown_type}` content type response that cannot be converted to `models::RedirectStage`"
10911 )))),
10912 }
10913 } else {
10914 let content = resp.text().await?;
10915 let entity: Option<StagesRedirectPartialUpdateError> = serde_json::from_str(&content).ok();
10916 Err(Error::ResponseError(ResponseContent {
10917 status,
10918 content,
10919 entity,
10920 }))
10921 }
10922}
10923
10924pub async fn stages_redirect_retrieve(
10926 configuration: &configuration::Configuration,
10927 stage_uuid: &str,
10928) -> Result<models::RedirectStage, Error<StagesRedirectRetrieveError>> {
10929 let p_path_stage_uuid = stage_uuid;
10931
10932 let uri_str = format!(
10933 "{}/stages/redirect/{stage_uuid}/",
10934 configuration.base_path,
10935 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10936 );
10937 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
10938
10939 if let Some(ref user_agent) = configuration.user_agent {
10940 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
10941 }
10942 if let Some(ref token) = configuration.bearer_access_token {
10943 req_builder = req_builder.bearer_auth(token.to_owned());
10944 };
10945
10946 let req = req_builder.build()?;
10947 let resp = configuration.client.execute(req).await?;
10948
10949 let status = resp.status();
10950 let content_type = resp
10951 .headers()
10952 .get("content-type")
10953 .and_then(|v| v.to_str().ok())
10954 .unwrap_or("application/octet-stream");
10955 let content_type = super::ContentType::from(content_type);
10956
10957 if !status.is_client_error() && !status.is_server_error() {
10958 let content = resp.text().await?;
10959 match content_type {
10960 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
10961 ContentType::Text => {
10962 return Err(Error::from(serde_json::Error::custom(
10963 "Received `text/plain` content type response that cannot be converted to `models::RedirectStage`",
10964 )))
10965 }
10966 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
10967 "Received `{unknown_type}` content type response that cannot be converted to `models::RedirectStage`"
10968 )))),
10969 }
10970 } else {
10971 let content = resp.text().await?;
10972 let entity: Option<StagesRedirectRetrieveError> = serde_json::from_str(&content).ok();
10973 Err(Error::ResponseError(ResponseContent {
10974 status,
10975 content,
10976 entity,
10977 }))
10978 }
10979}
10980
10981pub async fn stages_redirect_update(
10983 configuration: &configuration::Configuration,
10984 stage_uuid: &str,
10985 redirect_stage_request: models::RedirectStageRequest,
10986) -> Result<models::RedirectStage, Error<StagesRedirectUpdateError>> {
10987 let p_path_stage_uuid = stage_uuid;
10989 let p_body_redirect_stage_request = redirect_stage_request;
10990
10991 let uri_str = format!(
10992 "{}/stages/redirect/{stage_uuid}/",
10993 configuration.base_path,
10994 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
10995 );
10996 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
10997
10998 if let Some(ref user_agent) = configuration.user_agent {
10999 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11000 }
11001 if let Some(ref token) = configuration.bearer_access_token {
11002 req_builder = req_builder.bearer_auth(token.to_owned());
11003 };
11004 req_builder = req_builder.json(&p_body_redirect_stage_request);
11005
11006 let req = req_builder.build()?;
11007 let resp = configuration.client.execute(req).await?;
11008
11009 let status = resp.status();
11010 let content_type = resp
11011 .headers()
11012 .get("content-type")
11013 .and_then(|v| v.to_str().ok())
11014 .unwrap_or("application/octet-stream");
11015 let content_type = super::ContentType::from(content_type);
11016
11017 if !status.is_client_error() && !status.is_server_error() {
11018 let content = resp.text().await?;
11019 match content_type {
11020 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11021 ContentType::Text => {
11022 return Err(Error::from(serde_json::Error::custom(
11023 "Received `text/plain` content type response that cannot be converted to `models::RedirectStage`",
11024 )))
11025 }
11026 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
11027 "Received `{unknown_type}` content type response that cannot be converted to `models::RedirectStage`"
11028 )))),
11029 }
11030 } else {
11031 let content = resp.text().await?;
11032 let entity: Option<StagesRedirectUpdateError> = serde_json::from_str(&content).ok();
11033 Err(Error::ResponseError(ResponseContent {
11034 status,
11035 content,
11036 entity,
11037 }))
11038 }
11039}
11040
11041pub async fn stages_redirect_used_by_list(
11043 configuration: &configuration::Configuration,
11044 stage_uuid: &str,
11045) -> Result<Vec<models::UsedBy>, Error<StagesRedirectUsedByListError>> {
11046 let p_path_stage_uuid = stage_uuid;
11048
11049 let uri_str = format!(
11050 "{}/stages/redirect/{stage_uuid}/used_by/",
11051 configuration.base_path,
11052 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11053 );
11054 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11055
11056 if let Some(ref user_agent) = configuration.user_agent {
11057 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11058 }
11059 if let Some(ref token) = configuration.bearer_access_token {
11060 req_builder = req_builder.bearer_auth(token.to_owned());
11061 };
11062
11063 let req = req_builder.build()?;
11064 let resp = configuration.client.execute(req).await?;
11065
11066 let status = resp.status();
11067 let content_type = resp
11068 .headers()
11069 .get("content-type")
11070 .and_then(|v| v.to_str().ok())
11071 .unwrap_or("application/octet-stream");
11072 let content_type = super::ContentType::from(content_type);
11073
11074 if !status.is_client_error() && !status.is_server_error() {
11075 let content = resp.text().await?;
11076 match content_type {
11077 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11078 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
11079 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>`")))),
11080 }
11081 } else {
11082 let content = resp.text().await?;
11083 let entity: Option<StagesRedirectUsedByListError> = serde_json::from_str(&content).ok();
11084 Err(Error::ResponseError(ResponseContent {
11085 status,
11086 content,
11087 entity,
11088 }))
11089 }
11090}
11091
11092pub async fn stages_source_create(
11094 configuration: &configuration::Configuration,
11095 source_stage_request: models::SourceStageRequest,
11096) -> Result<models::SourceStage, Error<StagesSourceCreateError>> {
11097 let p_body_source_stage_request = source_stage_request;
11099
11100 let uri_str = format!("{}/stages/source/", configuration.base_path);
11101 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11102
11103 if let Some(ref user_agent) = configuration.user_agent {
11104 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11105 }
11106 if let Some(ref token) = configuration.bearer_access_token {
11107 req_builder = req_builder.bearer_auth(token.to_owned());
11108 };
11109 req_builder = req_builder.json(&p_body_source_stage_request);
11110
11111 let req = req_builder.build()?;
11112 let resp = configuration.client.execute(req).await?;
11113
11114 let status = resp.status();
11115 let content_type = resp
11116 .headers()
11117 .get("content-type")
11118 .and_then(|v| v.to_str().ok())
11119 .unwrap_or("application/octet-stream");
11120 let content_type = super::ContentType::from(content_type);
11121
11122 if !status.is_client_error() && !status.is_server_error() {
11123 let content = resp.text().await?;
11124 match content_type {
11125 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11126 ContentType::Text => {
11127 return Err(Error::from(serde_json::Error::custom(
11128 "Received `text/plain` content type response that cannot be converted to `models::SourceStage`",
11129 )))
11130 }
11131 ContentType::Unsupported(unknown_type) => {
11132 return Err(Error::from(serde_json::Error::custom(format!(
11133 "Received `{unknown_type}` content type response that cannot be converted to `models::SourceStage`"
11134 ))))
11135 }
11136 }
11137 } else {
11138 let content = resp.text().await?;
11139 let entity: Option<StagesSourceCreateError> = serde_json::from_str(&content).ok();
11140 Err(Error::ResponseError(ResponseContent {
11141 status,
11142 content,
11143 entity,
11144 }))
11145 }
11146}
11147
11148pub async fn stages_source_destroy(
11150 configuration: &configuration::Configuration,
11151 stage_uuid: &str,
11152) -> Result<(), Error<StagesSourceDestroyError>> {
11153 let p_path_stage_uuid = stage_uuid;
11155
11156 let uri_str = format!(
11157 "{}/stages/source/{stage_uuid}/",
11158 configuration.base_path,
11159 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11160 );
11161 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
11162
11163 if let Some(ref user_agent) = configuration.user_agent {
11164 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11165 }
11166 if let Some(ref token) = configuration.bearer_access_token {
11167 req_builder = req_builder.bearer_auth(token.to_owned());
11168 };
11169
11170 let req = req_builder.build()?;
11171 let resp = configuration.client.execute(req).await?;
11172
11173 let status = resp.status();
11174
11175 if !status.is_client_error() && !status.is_server_error() {
11176 Ok(())
11177 } else {
11178 let content = resp.text().await?;
11179 let entity: Option<StagesSourceDestroyError> = serde_json::from_str(&content).ok();
11180 Err(Error::ResponseError(ResponseContent {
11181 status,
11182 content,
11183 entity,
11184 }))
11185 }
11186}
11187
11188pub async fn stages_source_list(
11190 configuration: &configuration::Configuration,
11191 name: Option<&str>,
11192 ordering: Option<&str>,
11193 page: Option<i32>,
11194 page_size: Option<i32>,
11195 resume_timeout: Option<&str>,
11196 search: Option<&str>,
11197 source: Option<&str>,
11198 stage_uuid: Option<&str>,
11199) -> Result<models::PaginatedSourceStageList, Error<StagesSourceListError>> {
11200 let p_query_name = name;
11202 let p_query_ordering = ordering;
11203 let p_query_page = page;
11204 let p_query_page_size = page_size;
11205 let p_query_resume_timeout = resume_timeout;
11206 let p_query_search = search;
11207 let p_query_source = source;
11208 let p_query_stage_uuid = stage_uuid;
11209
11210 let uri_str = format!("{}/stages/source/", configuration.base_path);
11211 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11212
11213 if let Some(ref param_value) = p_query_name {
11214 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
11215 }
11216 if let Some(ref param_value) = p_query_ordering {
11217 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
11218 }
11219 if let Some(ref param_value) = p_query_page {
11220 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
11221 }
11222 if let Some(ref param_value) = p_query_page_size {
11223 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
11224 }
11225 if let Some(ref param_value) = p_query_resume_timeout {
11226 req_builder = req_builder.query(&[("resume_timeout", ¶m_value.to_string())]);
11227 }
11228 if let Some(ref param_value) = p_query_search {
11229 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
11230 }
11231 if let Some(ref param_value) = p_query_source {
11232 req_builder = req_builder.query(&[("source", ¶m_value.to_string())]);
11233 }
11234 if let Some(ref param_value) = p_query_stage_uuid {
11235 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
11236 }
11237 if let Some(ref user_agent) = configuration.user_agent {
11238 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11239 }
11240 if let Some(ref token) = configuration.bearer_access_token {
11241 req_builder = req_builder.bearer_auth(token.to_owned());
11242 };
11243
11244 let req = req_builder.build()?;
11245 let resp = configuration.client.execute(req).await?;
11246
11247 let status = resp.status();
11248 let content_type = resp
11249 .headers()
11250 .get("content-type")
11251 .and_then(|v| v.to_str().ok())
11252 .unwrap_or("application/octet-stream");
11253 let content_type = super::ContentType::from(content_type);
11254
11255 if !status.is_client_error() && !status.is_server_error() {
11256 let content = resp.text().await?;
11257 match content_type {
11258 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11259 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSourceStageList`"))),
11260 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSourceStageList`")))),
11261 }
11262 } else {
11263 let content = resp.text().await?;
11264 let entity: Option<StagesSourceListError> = serde_json::from_str(&content).ok();
11265 Err(Error::ResponseError(ResponseContent {
11266 status,
11267 content,
11268 entity,
11269 }))
11270 }
11271}
11272
11273pub async fn stages_source_partial_update(
11275 configuration: &configuration::Configuration,
11276 stage_uuid: &str,
11277 patched_source_stage_request: Option<models::PatchedSourceStageRequest>,
11278) -> Result<models::SourceStage, Error<StagesSourcePartialUpdateError>> {
11279 let p_path_stage_uuid = stage_uuid;
11281 let p_body_patched_source_stage_request = patched_source_stage_request;
11282
11283 let uri_str = format!(
11284 "{}/stages/source/{stage_uuid}/",
11285 configuration.base_path,
11286 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11287 );
11288 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
11289
11290 if let Some(ref user_agent) = configuration.user_agent {
11291 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11292 }
11293 if let Some(ref token) = configuration.bearer_access_token {
11294 req_builder = req_builder.bearer_auth(token.to_owned());
11295 };
11296 req_builder = req_builder.json(&p_body_patched_source_stage_request);
11297
11298 let req = req_builder.build()?;
11299 let resp = configuration.client.execute(req).await?;
11300
11301 let status = resp.status();
11302 let content_type = resp
11303 .headers()
11304 .get("content-type")
11305 .and_then(|v| v.to_str().ok())
11306 .unwrap_or("application/octet-stream");
11307 let content_type = super::ContentType::from(content_type);
11308
11309 if !status.is_client_error() && !status.is_server_error() {
11310 let content = resp.text().await?;
11311 match content_type {
11312 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11313 ContentType::Text => {
11314 return Err(Error::from(serde_json::Error::custom(
11315 "Received `text/plain` content type response that cannot be converted to `models::SourceStage`",
11316 )))
11317 }
11318 ContentType::Unsupported(unknown_type) => {
11319 return Err(Error::from(serde_json::Error::custom(format!(
11320 "Received `{unknown_type}` content type response that cannot be converted to `models::SourceStage`"
11321 ))))
11322 }
11323 }
11324 } else {
11325 let content = resp.text().await?;
11326 let entity: Option<StagesSourcePartialUpdateError> = serde_json::from_str(&content).ok();
11327 Err(Error::ResponseError(ResponseContent {
11328 status,
11329 content,
11330 entity,
11331 }))
11332 }
11333}
11334
11335pub async fn stages_source_retrieve(
11337 configuration: &configuration::Configuration,
11338 stage_uuid: &str,
11339) -> Result<models::SourceStage, Error<StagesSourceRetrieveError>> {
11340 let p_path_stage_uuid = stage_uuid;
11342
11343 let uri_str = format!(
11344 "{}/stages/source/{stage_uuid}/",
11345 configuration.base_path,
11346 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11347 );
11348 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11349
11350 if let Some(ref user_agent) = configuration.user_agent {
11351 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11352 }
11353 if let Some(ref token) = configuration.bearer_access_token {
11354 req_builder = req_builder.bearer_auth(token.to_owned());
11355 };
11356
11357 let req = req_builder.build()?;
11358 let resp = configuration.client.execute(req).await?;
11359
11360 let status = resp.status();
11361 let content_type = resp
11362 .headers()
11363 .get("content-type")
11364 .and_then(|v| v.to_str().ok())
11365 .unwrap_or("application/octet-stream");
11366 let content_type = super::ContentType::from(content_type);
11367
11368 if !status.is_client_error() && !status.is_server_error() {
11369 let content = resp.text().await?;
11370 match content_type {
11371 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11372 ContentType::Text => {
11373 return Err(Error::from(serde_json::Error::custom(
11374 "Received `text/plain` content type response that cannot be converted to `models::SourceStage`",
11375 )))
11376 }
11377 ContentType::Unsupported(unknown_type) => {
11378 return Err(Error::from(serde_json::Error::custom(format!(
11379 "Received `{unknown_type}` content type response that cannot be converted to `models::SourceStage`"
11380 ))))
11381 }
11382 }
11383 } else {
11384 let content = resp.text().await?;
11385 let entity: Option<StagesSourceRetrieveError> = serde_json::from_str(&content).ok();
11386 Err(Error::ResponseError(ResponseContent {
11387 status,
11388 content,
11389 entity,
11390 }))
11391 }
11392}
11393
11394pub async fn stages_source_update(
11396 configuration: &configuration::Configuration,
11397 stage_uuid: &str,
11398 source_stage_request: models::SourceStageRequest,
11399) -> Result<models::SourceStage, Error<StagesSourceUpdateError>> {
11400 let p_path_stage_uuid = stage_uuid;
11402 let p_body_source_stage_request = source_stage_request;
11403
11404 let uri_str = format!(
11405 "{}/stages/source/{stage_uuid}/",
11406 configuration.base_path,
11407 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11408 );
11409 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
11410
11411 if let Some(ref user_agent) = configuration.user_agent {
11412 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11413 }
11414 if let Some(ref token) = configuration.bearer_access_token {
11415 req_builder = req_builder.bearer_auth(token.to_owned());
11416 };
11417 req_builder = req_builder.json(&p_body_source_stage_request);
11418
11419 let req = req_builder.build()?;
11420 let resp = configuration.client.execute(req).await?;
11421
11422 let status = resp.status();
11423 let content_type = resp
11424 .headers()
11425 .get("content-type")
11426 .and_then(|v| v.to_str().ok())
11427 .unwrap_or("application/octet-stream");
11428 let content_type = super::ContentType::from(content_type);
11429
11430 if !status.is_client_error() && !status.is_server_error() {
11431 let content = resp.text().await?;
11432 match content_type {
11433 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11434 ContentType::Text => {
11435 return Err(Error::from(serde_json::Error::custom(
11436 "Received `text/plain` content type response that cannot be converted to `models::SourceStage`",
11437 )))
11438 }
11439 ContentType::Unsupported(unknown_type) => {
11440 return Err(Error::from(serde_json::Error::custom(format!(
11441 "Received `{unknown_type}` content type response that cannot be converted to `models::SourceStage`"
11442 ))))
11443 }
11444 }
11445 } else {
11446 let content = resp.text().await?;
11447 let entity: Option<StagesSourceUpdateError> = serde_json::from_str(&content).ok();
11448 Err(Error::ResponseError(ResponseContent {
11449 status,
11450 content,
11451 entity,
11452 }))
11453 }
11454}
11455
11456pub async fn stages_source_used_by_list(
11458 configuration: &configuration::Configuration,
11459 stage_uuid: &str,
11460) -> Result<Vec<models::UsedBy>, Error<StagesSourceUsedByListError>> {
11461 let p_path_stage_uuid = stage_uuid;
11463
11464 let uri_str = format!(
11465 "{}/stages/source/{stage_uuid}/used_by/",
11466 configuration.base_path,
11467 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11468 );
11469 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11470
11471 if let Some(ref user_agent) = configuration.user_agent {
11472 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11473 }
11474 if let Some(ref token) = configuration.bearer_access_token {
11475 req_builder = req_builder.bearer_auth(token.to_owned());
11476 };
11477
11478 let req = req_builder.build()?;
11479 let resp = configuration.client.execute(req).await?;
11480
11481 let status = resp.status();
11482 let content_type = resp
11483 .headers()
11484 .get("content-type")
11485 .and_then(|v| v.to_str().ok())
11486 .unwrap_or("application/octet-stream");
11487 let content_type = super::ContentType::from(content_type);
11488
11489 if !status.is_client_error() && !status.is_server_error() {
11490 let content = resp.text().await?;
11491 match content_type {
11492 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11493 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
11494 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>`")))),
11495 }
11496 } else {
11497 let content = resp.text().await?;
11498 let entity: Option<StagesSourceUsedByListError> = serde_json::from_str(&content).ok();
11499 Err(Error::ResponseError(ResponseContent {
11500 status,
11501 content,
11502 entity,
11503 }))
11504 }
11505}
11506
11507pub async fn stages_user_delete_create(
11509 configuration: &configuration::Configuration,
11510 user_delete_stage_request: models::UserDeleteStageRequest,
11511) -> Result<models::UserDeleteStage, Error<StagesUserDeleteCreateError>> {
11512 let p_body_user_delete_stage_request = user_delete_stage_request;
11514
11515 let uri_str = format!("{}/stages/user_delete/", configuration.base_path);
11516 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11517
11518 if let Some(ref user_agent) = configuration.user_agent {
11519 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11520 }
11521 if let Some(ref token) = configuration.bearer_access_token {
11522 req_builder = req_builder.bearer_auth(token.to_owned());
11523 };
11524 req_builder = req_builder.json(&p_body_user_delete_stage_request);
11525
11526 let req = req_builder.build()?;
11527 let resp = configuration.client.execute(req).await?;
11528
11529 let status = resp.status();
11530 let content_type = resp
11531 .headers()
11532 .get("content-type")
11533 .and_then(|v| v.to_str().ok())
11534 .unwrap_or("application/octet-stream");
11535 let content_type = super::ContentType::from(content_type);
11536
11537 if !status.is_client_error() && !status.is_server_error() {
11538 let content = resp.text().await?;
11539 match content_type {
11540 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11541 ContentType::Text => {
11542 return Err(Error::from(serde_json::Error::custom(
11543 "Received `text/plain` content type response that cannot be converted to `models::UserDeleteStage`",
11544 )))
11545 }
11546 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
11547 "Received `{unknown_type}` content type response that cannot be converted to `models::UserDeleteStage`"
11548 )))),
11549 }
11550 } else {
11551 let content = resp.text().await?;
11552 let entity: Option<StagesUserDeleteCreateError> = serde_json::from_str(&content).ok();
11553 Err(Error::ResponseError(ResponseContent {
11554 status,
11555 content,
11556 entity,
11557 }))
11558 }
11559}
11560
11561pub async fn stages_user_delete_destroy(
11563 configuration: &configuration::Configuration,
11564 stage_uuid: &str,
11565) -> Result<(), Error<StagesUserDeleteDestroyError>> {
11566 let p_path_stage_uuid = stage_uuid;
11568
11569 let uri_str = format!(
11570 "{}/stages/user_delete/{stage_uuid}/",
11571 configuration.base_path,
11572 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11573 );
11574 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
11575
11576 if let Some(ref user_agent) = configuration.user_agent {
11577 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11578 }
11579 if let Some(ref token) = configuration.bearer_access_token {
11580 req_builder = req_builder.bearer_auth(token.to_owned());
11581 };
11582
11583 let req = req_builder.build()?;
11584 let resp = configuration.client.execute(req).await?;
11585
11586 let status = resp.status();
11587
11588 if !status.is_client_error() && !status.is_server_error() {
11589 Ok(())
11590 } else {
11591 let content = resp.text().await?;
11592 let entity: Option<StagesUserDeleteDestroyError> = serde_json::from_str(&content).ok();
11593 Err(Error::ResponseError(ResponseContent {
11594 status,
11595 content,
11596 entity,
11597 }))
11598 }
11599}
11600
11601pub async fn stages_user_delete_list(
11603 configuration: &configuration::Configuration,
11604 name: Option<&str>,
11605 ordering: Option<&str>,
11606 page: Option<i32>,
11607 page_size: Option<i32>,
11608 search: Option<&str>,
11609 stage_uuid: Option<&str>,
11610) -> Result<models::PaginatedUserDeleteStageList, Error<StagesUserDeleteListError>> {
11611 let p_query_name = name;
11613 let p_query_ordering = ordering;
11614 let p_query_page = page;
11615 let p_query_page_size = page_size;
11616 let p_query_search = search;
11617 let p_query_stage_uuid = stage_uuid;
11618
11619 let uri_str = format!("{}/stages/user_delete/", configuration.base_path);
11620 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11621
11622 if let Some(ref param_value) = p_query_name {
11623 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
11624 }
11625 if let Some(ref param_value) = p_query_ordering {
11626 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
11627 }
11628 if let Some(ref param_value) = p_query_page {
11629 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
11630 }
11631 if let Some(ref param_value) = p_query_page_size {
11632 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
11633 }
11634 if let Some(ref param_value) = p_query_search {
11635 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
11636 }
11637 if let Some(ref param_value) = p_query_stage_uuid {
11638 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
11639 }
11640 if let Some(ref user_agent) = configuration.user_agent {
11641 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11642 }
11643 if let Some(ref token) = configuration.bearer_access_token {
11644 req_builder = req_builder.bearer_auth(token.to_owned());
11645 };
11646
11647 let req = req_builder.build()?;
11648 let resp = configuration.client.execute(req).await?;
11649
11650 let status = resp.status();
11651 let content_type = resp
11652 .headers()
11653 .get("content-type")
11654 .and_then(|v| v.to_str().ok())
11655 .unwrap_or("application/octet-stream");
11656 let content_type = super::ContentType::from(content_type);
11657
11658 if !status.is_client_error() && !status.is_server_error() {
11659 let content = resp.text().await?;
11660 match content_type {
11661 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11662 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserDeleteStageList`"))),
11663 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserDeleteStageList`")))),
11664 }
11665 } else {
11666 let content = resp.text().await?;
11667 let entity: Option<StagesUserDeleteListError> = serde_json::from_str(&content).ok();
11668 Err(Error::ResponseError(ResponseContent {
11669 status,
11670 content,
11671 entity,
11672 }))
11673 }
11674}
11675
11676pub async fn stages_user_delete_partial_update(
11678 configuration: &configuration::Configuration,
11679 stage_uuid: &str,
11680 patched_user_delete_stage_request: Option<models::PatchedUserDeleteStageRequest>,
11681) -> Result<models::UserDeleteStage, Error<StagesUserDeletePartialUpdateError>> {
11682 let p_path_stage_uuid = stage_uuid;
11684 let p_body_patched_user_delete_stage_request = patched_user_delete_stage_request;
11685
11686 let uri_str = format!(
11687 "{}/stages/user_delete/{stage_uuid}/",
11688 configuration.base_path,
11689 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11690 );
11691 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
11692
11693 if let Some(ref user_agent) = configuration.user_agent {
11694 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11695 }
11696 if let Some(ref token) = configuration.bearer_access_token {
11697 req_builder = req_builder.bearer_auth(token.to_owned());
11698 };
11699 req_builder = req_builder.json(&p_body_patched_user_delete_stage_request);
11700
11701 let req = req_builder.build()?;
11702 let resp = configuration.client.execute(req).await?;
11703
11704 let status = resp.status();
11705 let content_type = resp
11706 .headers()
11707 .get("content-type")
11708 .and_then(|v| v.to_str().ok())
11709 .unwrap_or("application/octet-stream");
11710 let content_type = super::ContentType::from(content_type);
11711
11712 if !status.is_client_error() && !status.is_server_error() {
11713 let content = resp.text().await?;
11714 match content_type {
11715 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11716 ContentType::Text => {
11717 return Err(Error::from(serde_json::Error::custom(
11718 "Received `text/plain` content type response that cannot be converted to `models::UserDeleteStage`",
11719 )))
11720 }
11721 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
11722 "Received `{unknown_type}` content type response that cannot be converted to `models::UserDeleteStage`"
11723 )))),
11724 }
11725 } else {
11726 let content = resp.text().await?;
11727 let entity: Option<StagesUserDeletePartialUpdateError> = serde_json::from_str(&content).ok();
11728 Err(Error::ResponseError(ResponseContent {
11729 status,
11730 content,
11731 entity,
11732 }))
11733 }
11734}
11735
11736pub async fn stages_user_delete_retrieve(
11738 configuration: &configuration::Configuration,
11739 stage_uuid: &str,
11740) -> Result<models::UserDeleteStage, Error<StagesUserDeleteRetrieveError>> {
11741 let p_path_stage_uuid = stage_uuid;
11743
11744 let uri_str = format!(
11745 "{}/stages/user_delete/{stage_uuid}/",
11746 configuration.base_path,
11747 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11748 );
11749 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11750
11751 if let Some(ref user_agent) = configuration.user_agent {
11752 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11753 }
11754 if let Some(ref token) = configuration.bearer_access_token {
11755 req_builder = req_builder.bearer_auth(token.to_owned());
11756 };
11757
11758 let req = req_builder.build()?;
11759 let resp = configuration.client.execute(req).await?;
11760
11761 let status = resp.status();
11762 let content_type = resp
11763 .headers()
11764 .get("content-type")
11765 .and_then(|v| v.to_str().ok())
11766 .unwrap_or("application/octet-stream");
11767 let content_type = super::ContentType::from(content_type);
11768
11769 if !status.is_client_error() && !status.is_server_error() {
11770 let content = resp.text().await?;
11771 match content_type {
11772 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11773 ContentType::Text => {
11774 return Err(Error::from(serde_json::Error::custom(
11775 "Received `text/plain` content type response that cannot be converted to `models::UserDeleteStage`",
11776 )))
11777 }
11778 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
11779 "Received `{unknown_type}` content type response that cannot be converted to `models::UserDeleteStage`"
11780 )))),
11781 }
11782 } else {
11783 let content = resp.text().await?;
11784 let entity: Option<StagesUserDeleteRetrieveError> = serde_json::from_str(&content).ok();
11785 Err(Error::ResponseError(ResponseContent {
11786 status,
11787 content,
11788 entity,
11789 }))
11790 }
11791}
11792
11793pub async fn stages_user_delete_update(
11795 configuration: &configuration::Configuration,
11796 stage_uuid: &str,
11797 user_delete_stage_request: models::UserDeleteStageRequest,
11798) -> Result<models::UserDeleteStage, Error<StagesUserDeleteUpdateError>> {
11799 let p_path_stage_uuid = stage_uuid;
11801 let p_body_user_delete_stage_request = user_delete_stage_request;
11802
11803 let uri_str = format!(
11804 "{}/stages/user_delete/{stage_uuid}/",
11805 configuration.base_path,
11806 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11807 );
11808 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
11809
11810 if let Some(ref user_agent) = configuration.user_agent {
11811 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11812 }
11813 if let Some(ref token) = configuration.bearer_access_token {
11814 req_builder = req_builder.bearer_auth(token.to_owned());
11815 };
11816 req_builder = req_builder.json(&p_body_user_delete_stage_request);
11817
11818 let req = req_builder.build()?;
11819 let resp = configuration.client.execute(req).await?;
11820
11821 let status = resp.status();
11822 let content_type = resp
11823 .headers()
11824 .get("content-type")
11825 .and_then(|v| v.to_str().ok())
11826 .unwrap_or("application/octet-stream");
11827 let content_type = super::ContentType::from(content_type);
11828
11829 if !status.is_client_error() && !status.is_server_error() {
11830 let content = resp.text().await?;
11831 match content_type {
11832 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11833 ContentType::Text => {
11834 return Err(Error::from(serde_json::Error::custom(
11835 "Received `text/plain` content type response that cannot be converted to `models::UserDeleteStage`",
11836 )))
11837 }
11838 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
11839 "Received `{unknown_type}` content type response that cannot be converted to `models::UserDeleteStage`"
11840 )))),
11841 }
11842 } else {
11843 let content = resp.text().await?;
11844 let entity: Option<StagesUserDeleteUpdateError> = serde_json::from_str(&content).ok();
11845 Err(Error::ResponseError(ResponseContent {
11846 status,
11847 content,
11848 entity,
11849 }))
11850 }
11851}
11852
11853pub async fn stages_user_delete_used_by_list(
11855 configuration: &configuration::Configuration,
11856 stage_uuid: &str,
11857) -> Result<Vec<models::UsedBy>, Error<StagesUserDeleteUsedByListError>> {
11858 let p_path_stage_uuid = stage_uuid;
11860
11861 let uri_str = format!(
11862 "{}/stages/user_delete/{stage_uuid}/used_by/",
11863 configuration.base_path,
11864 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11865 );
11866 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
11867
11868 if let Some(ref user_agent) = configuration.user_agent {
11869 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11870 }
11871 if let Some(ref token) = configuration.bearer_access_token {
11872 req_builder = req_builder.bearer_auth(token.to_owned());
11873 };
11874
11875 let req = req_builder.build()?;
11876 let resp = configuration.client.execute(req).await?;
11877
11878 let status = resp.status();
11879 let content_type = resp
11880 .headers()
11881 .get("content-type")
11882 .and_then(|v| v.to_str().ok())
11883 .unwrap_or("application/octet-stream");
11884 let content_type = super::ContentType::from(content_type);
11885
11886 if !status.is_client_error() && !status.is_server_error() {
11887 let content = resp.text().await?;
11888 match content_type {
11889 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11890 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
11891 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>`")))),
11892 }
11893 } else {
11894 let content = resp.text().await?;
11895 let entity: Option<StagesUserDeleteUsedByListError> = serde_json::from_str(&content).ok();
11896 Err(Error::ResponseError(ResponseContent {
11897 status,
11898 content,
11899 entity,
11900 }))
11901 }
11902}
11903
11904pub async fn stages_user_login_create(
11906 configuration: &configuration::Configuration,
11907 user_login_stage_request: models::UserLoginStageRequest,
11908) -> Result<models::UserLoginStage, Error<StagesUserLoginCreateError>> {
11909 let p_body_user_login_stage_request = user_login_stage_request;
11911
11912 let uri_str = format!("{}/stages/user_login/", configuration.base_path);
11913 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
11914
11915 if let Some(ref user_agent) = configuration.user_agent {
11916 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11917 }
11918 if let Some(ref token) = configuration.bearer_access_token {
11919 req_builder = req_builder.bearer_auth(token.to_owned());
11920 };
11921 req_builder = req_builder.json(&p_body_user_login_stage_request);
11922
11923 let req = req_builder.build()?;
11924 let resp = configuration.client.execute(req).await?;
11925
11926 let status = resp.status();
11927 let content_type = resp
11928 .headers()
11929 .get("content-type")
11930 .and_then(|v| v.to_str().ok())
11931 .unwrap_or("application/octet-stream");
11932 let content_type = super::ContentType::from(content_type);
11933
11934 if !status.is_client_error() && !status.is_server_error() {
11935 let content = resp.text().await?;
11936 match content_type {
11937 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
11938 ContentType::Text => {
11939 return Err(Error::from(serde_json::Error::custom(
11940 "Received `text/plain` content type response that cannot be converted to `models::UserLoginStage`",
11941 )))
11942 }
11943 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
11944 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLoginStage`"
11945 )))),
11946 }
11947 } else {
11948 let content = resp.text().await?;
11949 let entity: Option<StagesUserLoginCreateError> = serde_json::from_str(&content).ok();
11950 Err(Error::ResponseError(ResponseContent {
11951 status,
11952 content,
11953 entity,
11954 }))
11955 }
11956}
11957
11958pub async fn stages_user_login_destroy(
11960 configuration: &configuration::Configuration,
11961 stage_uuid: &str,
11962) -> Result<(), Error<StagesUserLoginDestroyError>> {
11963 let p_path_stage_uuid = stage_uuid;
11965
11966 let uri_str = format!(
11967 "{}/stages/user_login/{stage_uuid}/",
11968 configuration.base_path,
11969 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
11970 );
11971 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
11972
11973 if let Some(ref user_agent) = configuration.user_agent {
11974 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
11975 }
11976 if let Some(ref token) = configuration.bearer_access_token {
11977 req_builder = req_builder.bearer_auth(token.to_owned());
11978 };
11979
11980 let req = req_builder.build()?;
11981 let resp = configuration.client.execute(req).await?;
11982
11983 let status = resp.status();
11984
11985 if !status.is_client_error() && !status.is_server_error() {
11986 Ok(())
11987 } else {
11988 let content = resp.text().await?;
11989 let entity: Option<StagesUserLoginDestroyError> = serde_json::from_str(&content).ok();
11990 Err(Error::ResponseError(ResponseContent {
11991 status,
11992 content,
11993 entity,
11994 }))
11995 }
11996}
11997
11998pub async fn stages_user_login_list(
12000 configuration: &configuration::Configuration,
12001 geoip_binding: Option<&str>,
12002 name: Option<&str>,
12003 network_binding: Option<&str>,
12004 ordering: Option<&str>,
12005 page: Option<i32>,
12006 page_size: Option<i32>,
12007 remember_device: Option<&str>,
12008 remember_me_offset: Option<&str>,
12009 search: Option<&str>,
12010 session_duration: Option<&str>,
12011 stage_uuid: Option<&str>,
12012 terminate_other_sessions: Option<bool>,
12013) -> Result<models::PaginatedUserLoginStageList, Error<StagesUserLoginListError>> {
12014 let p_query_geoip_binding = geoip_binding;
12016 let p_query_name = name;
12017 let p_query_network_binding = network_binding;
12018 let p_query_ordering = ordering;
12019 let p_query_page = page;
12020 let p_query_page_size = page_size;
12021 let p_query_remember_device = remember_device;
12022 let p_query_remember_me_offset = remember_me_offset;
12023 let p_query_search = search;
12024 let p_query_session_duration = session_duration;
12025 let p_query_stage_uuid = stage_uuid;
12026 let p_query_terminate_other_sessions = terminate_other_sessions;
12027
12028 let uri_str = format!("{}/stages/user_login/", configuration.base_path);
12029 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12030
12031 if let Some(ref param_value) = p_query_geoip_binding {
12032 req_builder = req_builder.query(&[("geoip_binding", ¶m_value.to_string())]);
12033 }
12034 if let Some(ref param_value) = p_query_name {
12035 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
12036 }
12037 if let Some(ref param_value) = p_query_network_binding {
12038 req_builder = req_builder.query(&[("network_binding", ¶m_value.to_string())]);
12039 }
12040 if let Some(ref param_value) = p_query_ordering {
12041 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
12042 }
12043 if let Some(ref param_value) = p_query_page {
12044 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
12045 }
12046 if let Some(ref param_value) = p_query_page_size {
12047 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
12048 }
12049 if let Some(ref param_value) = p_query_remember_device {
12050 req_builder = req_builder.query(&[("remember_device", ¶m_value.to_string())]);
12051 }
12052 if let Some(ref param_value) = p_query_remember_me_offset {
12053 req_builder = req_builder.query(&[("remember_me_offset", ¶m_value.to_string())]);
12054 }
12055 if let Some(ref param_value) = p_query_search {
12056 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
12057 }
12058 if let Some(ref param_value) = p_query_session_duration {
12059 req_builder = req_builder.query(&[("session_duration", ¶m_value.to_string())]);
12060 }
12061 if let Some(ref param_value) = p_query_stage_uuid {
12062 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
12063 }
12064 if let Some(ref param_value) = p_query_terminate_other_sessions {
12065 req_builder = req_builder.query(&[("terminate_other_sessions", ¶m_value.to_string())]);
12066 }
12067 if let Some(ref user_agent) = configuration.user_agent {
12068 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12069 }
12070 if let Some(ref token) = configuration.bearer_access_token {
12071 req_builder = req_builder.bearer_auth(token.to_owned());
12072 };
12073
12074 let req = req_builder.build()?;
12075 let resp = configuration.client.execute(req).await?;
12076
12077 let status = resp.status();
12078 let content_type = resp
12079 .headers()
12080 .get("content-type")
12081 .and_then(|v| v.to_str().ok())
12082 .unwrap_or("application/octet-stream");
12083 let content_type = super::ContentType::from(content_type);
12084
12085 if !status.is_client_error() && !status.is_server_error() {
12086 let content = resp.text().await?;
12087 match content_type {
12088 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12089 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserLoginStageList`"))),
12090 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserLoginStageList`")))),
12091 }
12092 } else {
12093 let content = resp.text().await?;
12094 let entity: Option<StagesUserLoginListError> = serde_json::from_str(&content).ok();
12095 Err(Error::ResponseError(ResponseContent {
12096 status,
12097 content,
12098 entity,
12099 }))
12100 }
12101}
12102
12103pub async fn stages_user_login_partial_update(
12105 configuration: &configuration::Configuration,
12106 stage_uuid: &str,
12107 patched_user_login_stage_request: Option<models::PatchedUserLoginStageRequest>,
12108) -> Result<models::UserLoginStage, Error<StagesUserLoginPartialUpdateError>> {
12109 let p_path_stage_uuid = stage_uuid;
12111 let p_body_patched_user_login_stage_request = patched_user_login_stage_request;
12112
12113 let uri_str = format!(
12114 "{}/stages/user_login/{stage_uuid}/",
12115 configuration.base_path,
12116 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12117 );
12118 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
12119
12120 if let Some(ref user_agent) = configuration.user_agent {
12121 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12122 }
12123 if let Some(ref token) = configuration.bearer_access_token {
12124 req_builder = req_builder.bearer_auth(token.to_owned());
12125 };
12126 req_builder = req_builder.json(&p_body_patched_user_login_stage_request);
12127
12128 let req = req_builder.build()?;
12129 let resp = configuration.client.execute(req).await?;
12130
12131 let status = resp.status();
12132 let content_type = resp
12133 .headers()
12134 .get("content-type")
12135 .and_then(|v| v.to_str().ok())
12136 .unwrap_or("application/octet-stream");
12137 let content_type = super::ContentType::from(content_type);
12138
12139 if !status.is_client_error() && !status.is_server_error() {
12140 let content = resp.text().await?;
12141 match content_type {
12142 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12143 ContentType::Text => {
12144 return Err(Error::from(serde_json::Error::custom(
12145 "Received `text/plain` content type response that cannot be converted to `models::UserLoginStage`",
12146 )))
12147 }
12148 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12149 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLoginStage`"
12150 )))),
12151 }
12152 } else {
12153 let content = resp.text().await?;
12154 let entity: Option<StagesUserLoginPartialUpdateError> = serde_json::from_str(&content).ok();
12155 Err(Error::ResponseError(ResponseContent {
12156 status,
12157 content,
12158 entity,
12159 }))
12160 }
12161}
12162
12163pub async fn stages_user_login_retrieve(
12165 configuration: &configuration::Configuration,
12166 stage_uuid: &str,
12167) -> Result<models::UserLoginStage, Error<StagesUserLoginRetrieveError>> {
12168 let p_path_stage_uuid = stage_uuid;
12170
12171 let uri_str = format!(
12172 "{}/stages/user_login/{stage_uuid}/",
12173 configuration.base_path,
12174 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12175 );
12176 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12177
12178 if let Some(ref user_agent) = configuration.user_agent {
12179 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12180 }
12181 if let Some(ref token) = configuration.bearer_access_token {
12182 req_builder = req_builder.bearer_auth(token.to_owned());
12183 };
12184
12185 let req = req_builder.build()?;
12186 let resp = configuration.client.execute(req).await?;
12187
12188 let status = resp.status();
12189 let content_type = resp
12190 .headers()
12191 .get("content-type")
12192 .and_then(|v| v.to_str().ok())
12193 .unwrap_or("application/octet-stream");
12194 let content_type = super::ContentType::from(content_type);
12195
12196 if !status.is_client_error() && !status.is_server_error() {
12197 let content = resp.text().await?;
12198 match content_type {
12199 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12200 ContentType::Text => {
12201 return Err(Error::from(serde_json::Error::custom(
12202 "Received `text/plain` content type response that cannot be converted to `models::UserLoginStage`",
12203 )))
12204 }
12205 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12206 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLoginStage`"
12207 )))),
12208 }
12209 } else {
12210 let content = resp.text().await?;
12211 let entity: Option<StagesUserLoginRetrieveError> = serde_json::from_str(&content).ok();
12212 Err(Error::ResponseError(ResponseContent {
12213 status,
12214 content,
12215 entity,
12216 }))
12217 }
12218}
12219
12220pub async fn stages_user_login_update(
12222 configuration: &configuration::Configuration,
12223 stage_uuid: &str,
12224 user_login_stage_request: models::UserLoginStageRequest,
12225) -> Result<models::UserLoginStage, Error<StagesUserLoginUpdateError>> {
12226 let p_path_stage_uuid = stage_uuid;
12228 let p_body_user_login_stage_request = user_login_stage_request;
12229
12230 let uri_str = format!(
12231 "{}/stages/user_login/{stage_uuid}/",
12232 configuration.base_path,
12233 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12234 );
12235 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
12236
12237 if let Some(ref user_agent) = configuration.user_agent {
12238 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12239 }
12240 if let Some(ref token) = configuration.bearer_access_token {
12241 req_builder = req_builder.bearer_auth(token.to_owned());
12242 };
12243 req_builder = req_builder.json(&p_body_user_login_stage_request);
12244
12245 let req = req_builder.build()?;
12246 let resp = configuration.client.execute(req).await?;
12247
12248 let status = resp.status();
12249 let content_type = resp
12250 .headers()
12251 .get("content-type")
12252 .and_then(|v| v.to_str().ok())
12253 .unwrap_or("application/octet-stream");
12254 let content_type = super::ContentType::from(content_type);
12255
12256 if !status.is_client_error() && !status.is_server_error() {
12257 let content = resp.text().await?;
12258 match content_type {
12259 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12260 ContentType::Text => {
12261 return Err(Error::from(serde_json::Error::custom(
12262 "Received `text/plain` content type response that cannot be converted to `models::UserLoginStage`",
12263 )))
12264 }
12265 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12266 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLoginStage`"
12267 )))),
12268 }
12269 } else {
12270 let content = resp.text().await?;
12271 let entity: Option<StagesUserLoginUpdateError> = serde_json::from_str(&content).ok();
12272 Err(Error::ResponseError(ResponseContent {
12273 status,
12274 content,
12275 entity,
12276 }))
12277 }
12278}
12279
12280pub async fn stages_user_login_used_by_list(
12282 configuration: &configuration::Configuration,
12283 stage_uuid: &str,
12284) -> Result<Vec<models::UsedBy>, Error<StagesUserLoginUsedByListError>> {
12285 let p_path_stage_uuid = stage_uuid;
12287
12288 let uri_str = format!(
12289 "{}/stages/user_login/{stage_uuid}/used_by/",
12290 configuration.base_path,
12291 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12292 );
12293 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12294
12295 if let Some(ref user_agent) = configuration.user_agent {
12296 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12297 }
12298 if let Some(ref token) = configuration.bearer_access_token {
12299 req_builder = req_builder.bearer_auth(token.to_owned());
12300 };
12301
12302 let req = req_builder.build()?;
12303 let resp = configuration.client.execute(req).await?;
12304
12305 let status = resp.status();
12306 let content_type = resp
12307 .headers()
12308 .get("content-type")
12309 .and_then(|v| v.to_str().ok())
12310 .unwrap_or("application/octet-stream");
12311 let content_type = super::ContentType::from(content_type);
12312
12313 if !status.is_client_error() && !status.is_server_error() {
12314 let content = resp.text().await?;
12315 match content_type {
12316 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12317 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
12318 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>`")))),
12319 }
12320 } else {
12321 let content = resp.text().await?;
12322 let entity: Option<StagesUserLoginUsedByListError> = serde_json::from_str(&content).ok();
12323 Err(Error::ResponseError(ResponseContent {
12324 status,
12325 content,
12326 entity,
12327 }))
12328 }
12329}
12330
12331pub async fn stages_user_logout_create(
12333 configuration: &configuration::Configuration,
12334 user_logout_stage_request: models::UserLogoutStageRequest,
12335) -> Result<models::UserLogoutStage, Error<StagesUserLogoutCreateError>> {
12336 let p_body_user_logout_stage_request = user_logout_stage_request;
12338
12339 let uri_str = format!("{}/stages/user_logout/", configuration.base_path);
12340 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
12341
12342 if let Some(ref user_agent) = configuration.user_agent {
12343 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12344 }
12345 if let Some(ref token) = configuration.bearer_access_token {
12346 req_builder = req_builder.bearer_auth(token.to_owned());
12347 };
12348 req_builder = req_builder.json(&p_body_user_logout_stage_request);
12349
12350 let req = req_builder.build()?;
12351 let resp = configuration.client.execute(req).await?;
12352
12353 let status = resp.status();
12354 let content_type = resp
12355 .headers()
12356 .get("content-type")
12357 .and_then(|v| v.to_str().ok())
12358 .unwrap_or("application/octet-stream");
12359 let content_type = super::ContentType::from(content_type);
12360
12361 if !status.is_client_error() && !status.is_server_error() {
12362 let content = resp.text().await?;
12363 match content_type {
12364 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12365 ContentType::Text => {
12366 return Err(Error::from(serde_json::Error::custom(
12367 "Received `text/plain` content type response that cannot be converted to `models::UserLogoutStage`",
12368 )))
12369 }
12370 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12371 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLogoutStage`"
12372 )))),
12373 }
12374 } else {
12375 let content = resp.text().await?;
12376 let entity: Option<StagesUserLogoutCreateError> = serde_json::from_str(&content).ok();
12377 Err(Error::ResponseError(ResponseContent {
12378 status,
12379 content,
12380 entity,
12381 }))
12382 }
12383}
12384
12385pub async fn stages_user_logout_destroy(
12387 configuration: &configuration::Configuration,
12388 stage_uuid: &str,
12389) -> Result<(), Error<StagesUserLogoutDestroyError>> {
12390 let p_path_stage_uuid = stage_uuid;
12392
12393 let uri_str = format!(
12394 "{}/stages/user_logout/{stage_uuid}/",
12395 configuration.base_path,
12396 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12397 );
12398 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
12399
12400 if let Some(ref user_agent) = configuration.user_agent {
12401 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12402 }
12403 if let Some(ref token) = configuration.bearer_access_token {
12404 req_builder = req_builder.bearer_auth(token.to_owned());
12405 };
12406
12407 let req = req_builder.build()?;
12408 let resp = configuration.client.execute(req).await?;
12409
12410 let status = resp.status();
12411
12412 if !status.is_client_error() && !status.is_server_error() {
12413 Ok(())
12414 } else {
12415 let content = resp.text().await?;
12416 let entity: Option<StagesUserLogoutDestroyError> = serde_json::from_str(&content).ok();
12417 Err(Error::ResponseError(ResponseContent {
12418 status,
12419 content,
12420 entity,
12421 }))
12422 }
12423}
12424
12425pub async fn stages_user_logout_list(
12427 configuration: &configuration::Configuration,
12428 name: Option<&str>,
12429 ordering: Option<&str>,
12430 page: Option<i32>,
12431 page_size: Option<i32>,
12432 search: Option<&str>,
12433 stage_uuid: Option<&str>,
12434) -> Result<models::PaginatedUserLogoutStageList, Error<StagesUserLogoutListError>> {
12435 let p_query_name = name;
12437 let p_query_ordering = ordering;
12438 let p_query_page = page;
12439 let p_query_page_size = page_size;
12440 let p_query_search = search;
12441 let p_query_stage_uuid = stage_uuid;
12442
12443 let uri_str = format!("{}/stages/user_logout/", configuration.base_path);
12444 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12445
12446 if let Some(ref param_value) = p_query_name {
12447 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
12448 }
12449 if let Some(ref param_value) = p_query_ordering {
12450 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
12451 }
12452 if let Some(ref param_value) = p_query_page {
12453 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
12454 }
12455 if let Some(ref param_value) = p_query_page_size {
12456 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
12457 }
12458 if let Some(ref param_value) = p_query_search {
12459 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
12460 }
12461 if let Some(ref param_value) = p_query_stage_uuid {
12462 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
12463 }
12464 if let Some(ref user_agent) = configuration.user_agent {
12465 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12466 }
12467 if let Some(ref token) = configuration.bearer_access_token {
12468 req_builder = req_builder.bearer_auth(token.to_owned());
12469 };
12470
12471 let req = req_builder.build()?;
12472 let resp = configuration.client.execute(req).await?;
12473
12474 let status = resp.status();
12475 let content_type = resp
12476 .headers()
12477 .get("content-type")
12478 .and_then(|v| v.to_str().ok())
12479 .unwrap_or("application/octet-stream");
12480 let content_type = super::ContentType::from(content_type);
12481
12482 if !status.is_client_error() && !status.is_server_error() {
12483 let content = resp.text().await?;
12484 match content_type {
12485 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12486 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserLogoutStageList`"))),
12487 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserLogoutStageList`")))),
12488 }
12489 } else {
12490 let content = resp.text().await?;
12491 let entity: Option<StagesUserLogoutListError> = serde_json::from_str(&content).ok();
12492 Err(Error::ResponseError(ResponseContent {
12493 status,
12494 content,
12495 entity,
12496 }))
12497 }
12498}
12499
12500pub async fn stages_user_logout_partial_update(
12502 configuration: &configuration::Configuration,
12503 stage_uuid: &str,
12504 patched_user_logout_stage_request: Option<models::PatchedUserLogoutStageRequest>,
12505) -> Result<models::UserLogoutStage, Error<StagesUserLogoutPartialUpdateError>> {
12506 let p_path_stage_uuid = stage_uuid;
12508 let p_body_patched_user_logout_stage_request = patched_user_logout_stage_request;
12509
12510 let uri_str = format!(
12511 "{}/stages/user_logout/{stage_uuid}/",
12512 configuration.base_path,
12513 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12514 );
12515 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
12516
12517 if let Some(ref user_agent) = configuration.user_agent {
12518 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12519 }
12520 if let Some(ref token) = configuration.bearer_access_token {
12521 req_builder = req_builder.bearer_auth(token.to_owned());
12522 };
12523 req_builder = req_builder.json(&p_body_patched_user_logout_stage_request);
12524
12525 let req = req_builder.build()?;
12526 let resp = configuration.client.execute(req).await?;
12527
12528 let status = resp.status();
12529 let content_type = resp
12530 .headers()
12531 .get("content-type")
12532 .and_then(|v| v.to_str().ok())
12533 .unwrap_or("application/octet-stream");
12534 let content_type = super::ContentType::from(content_type);
12535
12536 if !status.is_client_error() && !status.is_server_error() {
12537 let content = resp.text().await?;
12538 match content_type {
12539 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12540 ContentType::Text => {
12541 return Err(Error::from(serde_json::Error::custom(
12542 "Received `text/plain` content type response that cannot be converted to `models::UserLogoutStage`",
12543 )))
12544 }
12545 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12546 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLogoutStage`"
12547 )))),
12548 }
12549 } else {
12550 let content = resp.text().await?;
12551 let entity: Option<StagesUserLogoutPartialUpdateError> = serde_json::from_str(&content).ok();
12552 Err(Error::ResponseError(ResponseContent {
12553 status,
12554 content,
12555 entity,
12556 }))
12557 }
12558}
12559
12560pub async fn stages_user_logout_retrieve(
12562 configuration: &configuration::Configuration,
12563 stage_uuid: &str,
12564) -> Result<models::UserLogoutStage, Error<StagesUserLogoutRetrieveError>> {
12565 let p_path_stage_uuid = stage_uuid;
12567
12568 let uri_str = format!(
12569 "{}/stages/user_logout/{stage_uuid}/",
12570 configuration.base_path,
12571 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12572 );
12573 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12574
12575 if let Some(ref user_agent) = configuration.user_agent {
12576 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12577 }
12578 if let Some(ref token) = configuration.bearer_access_token {
12579 req_builder = req_builder.bearer_auth(token.to_owned());
12580 };
12581
12582 let req = req_builder.build()?;
12583 let resp = configuration.client.execute(req).await?;
12584
12585 let status = resp.status();
12586 let content_type = resp
12587 .headers()
12588 .get("content-type")
12589 .and_then(|v| v.to_str().ok())
12590 .unwrap_or("application/octet-stream");
12591 let content_type = super::ContentType::from(content_type);
12592
12593 if !status.is_client_error() && !status.is_server_error() {
12594 let content = resp.text().await?;
12595 match content_type {
12596 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12597 ContentType::Text => {
12598 return Err(Error::from(serde_json::Error::custom(
12599 "Received `text/plain` content type response that cannot be converted to `models::UserLogoutStage`",
12600 )))
12601 }
12602 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12603 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLogoutStage`"
12604 )))),
12605 }
12606 } else {
12607 let content = resp.text().await?;
12608 let entity: Option<StagesUserLogoutRetrieveError> = serde_json::from_str(&content).ok();
12609 Err(Error::ResponseError(ResponseContent {
12610 status,
12611 content,
12612 entity,
12613 }))
12614 }
12615}
12616
12617pub async fn stages_user_logout_update(
12619 configuration: &configuration::Configuration,
12620 stage_uuid: &str,
12621 user_logout_stage_request: models::UserLogoutStageRequest,
12622) -> Result<models::UserLogoutStage, Error<StagesUserLogoutUpdateError>> {
12623 let p_path_stage_uuid = stage_uuid;
12625 let p_body_user_logout_stage_request = user_logout_stage_request;
12626
12627 let uri_str = format!(
12628 "{}/stages/user_logout/{stage_uuid}/",
12629 configuration.base_path,
12630 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12631 );
12632 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
12633
12634 if let Some(ref user_agent) = configuration.user_agent {
12635 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12636 }
12637 if let Some(ref token) = configuration.bearer_access_token {
12638 req_builder = req_builder.bearer_auth(token.to_owned());
12639 };
12640 req_builder = req_builder.json(&p_body_user_logout_stage_request);
12641
12642 let req = req_builder.build()?;
12643 let resp = configuration.client.execute(req).await?;
12644
12645 let status = resp.status();
12646 let content_type = resp
12647 .headers()
12648 .get("content-type")
12649 .and_then(|v| v.to_str().ok())
12650 .unwrap_or("application/octet-stream");
12651 let content_type = super::ContentType::from(content_type);
12652
12653 if !status.is_client_error() && !status.is_server_error() {
12654 let content = resp.text().await?;
12655 match content_type {
12656 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12657 ContentType::Text => {
12658 return Err(Error::from(serde_json::Error::custom(
12659 "Received `text/plain` content type response that cannot be converted to `models::UserLogoutStage`",
12660 )))
12661 }
12662 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12663 "Received `{unknown_type}` content type response that cannot be converted to `models::UserLogoutStage`"
12664 )))),
12665 }
12666 } else {
12667 let content = resp.text().await?;
12668 let entity: Option<StagesUserLogoutUpdateError> = serde_json::from_str(&content).ok();
12669 Err(Error::ResponseError(ResponseContent {
12670 status,
12671 content,
12672 entity,
12673 }))
12674 }
12675}
12676
12677pub async fn stages_user_logout_used_by_list(
12679 configuration: &configuration::Configuration,
12680 stage_uuid: &str,
12681) -> Result<Vec<models::UsedBy>, Error<StagesUserLogoutUsedByListError>> {
12682 let p_path_stage_uuid = stage_uuid;
12684
12685 let uri_str = format!(
12686 "{}/stages/user_logout/{stage_uuid}/used_by/",
12687 configuration.base_path,
12688 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12689 );
12690 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12691
12692 if let Some(ref user_agent) = configuration.user_agent {
12693 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12694 }
12695 if let Some(ref token) = configuration.bearer_access_token {
12696 req_builder = req_builder.bearer_auth(token.to_owned());
12697 };
12698
12699 let req = req_builder.build()?;
12700 let resp = configuration.client.execute(req).await?;
12701
12702 let status = resp.status();
12703 let content_type = resp
12704 .headers()
12705 .get("content-type")
12706 .and_then(|v| v.to_str().ok())
12707 .unwrap_or("application/octet-stream");
12708 let content_type = super::ContentType::from(content_type);
12709
12710 if !status.is_client_error() && !status.is_server_error() {
12711 let content = resp.text().await?;
12712 match content_type {
12713 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12714 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
12715 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>`")))),
12716 }
12717 } else {
12718 let content = resp.text().await?;
12719 let entity: Option<StagesUserLogoutUsedByListError> = serde_json::from_str(&content).ok();
12720 Err(Error::ResponseError(ResponseContent {
12721 status,
12722 content,
12723 entity,
12724 }))
12725 }
12726}
12727
12728pub async fn stages_user_write_create(
12730 configuration: &configuration::Configuration,
12731 user_write_stage_request: models::UserWriteStageRequest,
12732) -> Result<models::UserWriteStage, Error<StagesUserWriteCreateError>> {
12733 let p_body_user_write_stage_request = user_write_stage_request;
12735
12736 let uri_str = format!("{}/stages/user_write/", configuration.base_path);
12737 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
12738
12739 if let Some(ref user_agent) = configuration.user_agent {
12740 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12741 }
12742 if let Some(ref token) = configuration.bearer_access_token {
12743 req_builder = req_builder.bearer_auth(token.to_owned());
12744 };
12745 req_builder = req_builder.json(&p_body_user_write_stage_request);
12746
12747 let req = req_builder.build()?;
12748 let resp = configuration.client.execute(req).await?;
12749
12750 let status = resp.status();
12751 let content_type = resp
12752 .headers()
12753 .get("content-type")
12754 .and_then(|v| v.to_str().ok())
12755 .unwrap_or("application/octet-stream");
12756 let content_type = super::ContentType::from(content_type);
12757
12758 if !status.is_client_error() && !status.is_server_error() {
12759 let content = resp.text().await?;
12760 match content_type {
12761 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12762 ContentType::Text => {
12763 return Err(Error::from(serde_json::Error::custom(
12764 "Received `text/plain` content type response that cannot be converted to `models::UserWriteStage`",
12765 )))
12766 }
12767 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12768 "Received `{unknown_type}` content type response that cannot be converted to `models::UserWriteStage`"
12769 )))),
12770 }
12771 } else {
12772 let content = resp.text().await?;
12773 let entity: Option<StagesUserWriteCreateError> = serde_json::from_str(&content).ok();
12774 Err(Error::ResponseError(ResponseContent {
12775 status,
12776 content,
12777 entity,
12778 }))
12779 }
12780}
12781
12782pub async fn stages_user_write_destroy(
12784 configuration: &configuration::Configuration,
12785 stage_uuid: &str,
12786) -> Result<(), Error<StagesUserWriteDestroyError>> {
12787 let p_path_stage_uuid = stage_uuid;
12789
12790 let uri_str = format!(
12791 "{}/stages/user_write/{stage_uuid}/",
12792 configuration.base_path,
12793 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12794 );
12795 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
12796
12797 if let Some(ref user_agent) = configuration.user_agent {
12798 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12799 }
12800 if let Some(ref token) = configuration.bearer_access_token {
12801 req_builder = req_builder.bearer_auth(token.to_owned());
12802 };
12803
12804 let req = req_builder.build()?;
12805 let resp = configuration.client.execute(req).await?;
12806
12807 let status = resp.status();
12808
12809 if !status.is_client_error() && !status.is_server_error() {
12810 Ok(())
12811 } else {
12812 let content = resp.text().await?;
12813 let entity: Option<StagesUserWriteDestroyError> = serde_json::from_str(&content).ok();
12814 Err(Error::ResponseError(ResponseContent {
12815 status,
12816 content,
12817 entity,
12818 }))
12819 }
12820}
12821
12822pub async fn stages_user_write_list(
12824 configuration: &configuration::Configuration,
12825 create_users_as_inactive: Option<bool>,
12826 create_users_group: Option<&str>,
12827 name: Option<&str>,
12828 ordering: Option<&str>,
12829 page: Option<i32>,
12830 page_size: Option<i32>,
12831 search: Option<&str>,
12832 stage_uuid: Option<&str>,
12833 user_creation_mode: Option<&str>,
12834 user_path_template: Option<&str>,
12835 user_type: Option<&str>,
12836) -> Result<models::PaginatedUserWriteStageList, Error<StagesUserWriteListError>> {
12837 let p_query_create_users_as_inactive = create_users_as_inactive;
12839 let p_query_create_users_group = create_users_group;
12840 let p_query_name = name;
12841 let p_query_ordering = ordering;
12842 let p_query_page = page;
12843 let p_query_page_size = page_size;
12844 let p_query_search = search;
12845 let p_query_stage_uuid = stage_uuid;
12846 let p_query_user_creation_mode = user_creation_mode;
12847 let p_query_user_path_template = user_path_template;
12848 let p_query_user_type = user_type;
12849
12850 let uri_str = format!("{}/stages/user_write/", configuration.base_path);
12851 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12852
12853 if let Some(ref param_value) = p_query_create_users_as_inactive {
12854 req_builder = req_builder.query(&[("create_users_as_inactive", ¶m_value.to_string())]);
12855 }
12856 if let Some(ref param_value) = p_query_create_users_group {
12857 req_builder = req_builder.query(&[("create_users_group", ¶m_value.to_string())]);
12858 }
12859 if let Some(ref param_value) = p_query_name {
12860 req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
12861 }
12862 if let Some(ref param_value) = p_query_ordering {
12863 req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
12864 }
12865 if let Some(ref param_value) = p_query_page {
12866 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
12867 }
12868 if let Some(ref param_value) = p_query_page_size {
12869 req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
12870 }
12871 if let Some(ref param_value) = p_query_search {
12872 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
12873 }
12874 if let Some(ref param_value) = p_query_stage_uuid {
12875 req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]);
12876 }
12877 if let Some(ref param_value) = p_query_user_creation_mode {
12878 req_builder = req_builder.query(&[("user_creation_mode", ¶m_value.to_string())]);
12879 }
12880 if let Some(ref param_value) = p_query_user_path_template {
12881 req_builder = req_builder.query(&[("user_path_template", ¶m_value.to_string())]);
12882 }
12883 if let Some(ref param_value) = p_query_user_type {
12884 req_builder = req_builder.query(&[("user_type", ¶m_value.to_string())]);
12885 }
12886 if let Some(ref user_agent) = configuration.user_agent {
12887 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12888 }
12889 if let Some(ref token) = configuration.bearer_access_token {
12890 req_builder = req_builder.bearer_auth(token.to_owned());
12891 };
12892
12893 let req = req_builder.build()?;
12894 let resp = configuration.client.execute(req).await?;
12895
12896 let status = resp.status();
12897 let content_type = resp
12898 .headers()
12899 .get("content-type")
12900 .and_then(|v| v.to_str().ok())
12901 .unwrap_or("application/octet-stream");
12902 let content_type = super::ContentType::from(content_type);
12903
12904 if !status.is_client_error() && !status.is_server_error() {
12905 let content = resp.text().await?;
12906 match content_type {
12907 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12908 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedUserWriteStageList`"))),
12909 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedUserWriteStageList`")))),
12910 }
12911 } else {
12912 let content = resp.text().await?;
12913 let entity: Option<StagesUserWriteListError> = serde_json::from_str(&content).ok();
12914 Err(Error::ResponseError(ResponseContent {
12915 status,
12916 content,
12917 entity,
12918 }))
12919 }
12920}
12921
12922pub async fn stages_user_write_partial_update(
12924 configuration: &configuration::Configuration,
12925 stage_uuid: &str,
12926 patched_user_write_stage_request: Option<models::PatchedUserWriteStageRequest>,
12927) -> Result<models::UserWriteStage, Error<StagesUserWritePartialUpdateError>> {
12928 let p_path_stage_uuid = stage_uuid;
12930 let p_body_patched_user_write_stage_request = patched_user_write_stage_request;
12931
12932 let uri_str = format!(
12933 "{}/stages/user_write/{stage_uuid}/",
12934 configuration.base_path,
12935 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12936 );
12937 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
12938
12939 if let Some(ref user_agent) = configuration.user_agent {
12940 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12941 }
12942 if let Some(ref token) = configuration.bearer_access_token {
12943 req_builder = req_builder.bearer_auth(token.to_owned());
12944 };
12945 req_builder = req_builder.json(&p_body_patched_user_write_stage_request);
12946
12947 let req = req_builder.build()?;
12948 let resp = configuration.client.execute(req).await?;
12949
12950 let status = resp.status();
12951 let content_type = resp
12952 .headers()
12953 .get("content-type")
12954 .and_then(|v| v.to_str().ok())
12955 .unwrap_or("application/octet-stream");
12956 let content_type = super::ContentType::from(content_type);
12957
12958 if !status.is_client_error() && !status.is_server_error() {
12959 let content = resp.text().await?;
12960 match content_type {
12961 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
12962 ContentType::Text => {
12963 return Err(Error::from(serde_json::Error::custom(
12964 "Received `text/plain` content type response that cannot be converted to `models::UserWriteStage`",
12965 )))
12966 }
12967 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
12968 "Received `{unknown_type}` content type response that cannot be converted to `models::UserWriteStage`"
12969 )))),
12970 }
12971 } else {
12972 let content = resp.text().await?;
12973 let entity: Option<StagesUserWritePartialUpdateError> = serde_json::from_str(&content).ok();
12974 Err(Error::ResponseError(ResponseContent {
12975 status,
12976 content,
12977 entity,
12978 }))
12979 }
12980}
12981
12982pub async fn stages_user_write_retrieve(
12984 configuration: &configuration::Configuration,
12985 stage_uuid: &str,
12986) -> Result<models::UserWriteStage, Error<StagesUserWriteRetrieveError>> {
12987 let p_path_stage_uuid = stage_uuid;
12989
12990 let uri_str = format!(
12991 "{}/stages/user_write/{stage_uuid}/",
12992 configuration.base_path,
12993 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
12994 );
12995 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
12996
12997 if let Some(ref user_agent) = configuration.user_agent {
12998 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
12999 }
13000 if let Some(ref token) = configuration.bearer_access_token {
13001 req_builder = req_builder.bearer_auth(token.to_owned());
13002 };
13003
13004 let req = req_builder.build()?;
13005 let resp = configuration.client.execute(req).await?;
13006
13007 let status = resp.status();
13008 let content_type = resp
13009 .headers()
13010 .get("content-type")
13011 .and_then(|v| v.to_str().ok())
13012 .unwrap_or("application/octet-stream");
13013 let content_type = super::ContentType::from(content_type);
13014
13015 if !status.is_client_error() && !status.is_server_error() {
13016 let content = resp.text().await?;
13017 match content_type {
13018 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13019 ContentType::Text => {
13020 return Err(Error::from(serde_json::Error::custom(
13021 "Received `text/plain` content type response that cannot be converted to `models::UserWriteStage`",
13022 )))
13023 }
13024 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
13025 "Received `{unknown_type}` content type response that cannot be converted to `models::UserWriteStage`"
13026 )))),
13027 }
13028 } else {
13029 let content = resp.text().await?;
13030 let entity: Option<StagesUserWriteRetrieveError> = serde_json::from_str(&content).ok();
13031 Err(Error::ResponseError(ResponseContent {
13032 status,
13033 content,
13034 entity,
13035 }))
13036 }
13037}
13038
13039pub async fn stages_user_write_update(
13041 configuration: &configuration::Configuration,
13042 stage_uuid: &str,
13043 user_write_stage_request: models::UserWriteStageRequest,
13044) -> Result<models::UserWriteStage, Error<StagesUserWriteUpdateError>> {
13045 let p_path_stage_uuid = stage_uuid;
13047 let p_body_user_write_stage_request = user_write_stage_request;
13048
13049 let uri_str = format!(
13050 "{}/stages/user_write/{stage_uuid}/",
13051 configuration.base_path,
13052 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
13053 );
13054 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
13055
13056 if let Some(ref user_agent) = configuration.user_agent {
13057 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13058 }
13059 if let Some(ref token) = configuration.bearer_access_token {
13060 req_builder = req_builder.bearer_auth(token.to_owned());
13061 };
13062 req_builder = req_builder.json(&p_body_user_write_stage_request);
13063
13064 let req = req_builder.build()?;
13065 let resp = configuration.client.execute(req).await?;
13066
13067 let status = resp.status();
13068 let content_type = resp
13069 .headers()
13070 .get("content-type")
13071 .and_then(|v| v.to_str().ok())
13072 .unwrap_or("application/octet-stream");
13073 let content_type = super::ContentType::from(content_type);
13074
13075 if !status.is_client_error() && !status.is_server_error() {
13076 let content = resp.text().await?;
13077 match content_type {
13078 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13079 ContentType::Text => {
13080 return Err(Error::from(serde_json::Error::custom(
13081 "Received `text/plain` content type response that cannot be converted to `models::UserWriteStage`",
13082 )))
13083 }
13084 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
13085 "Received `{unknown_type}` content type response that cannot be converted to `models::UserWriteStage`"
13086 )))),
13087 }
13088 } else {
13089 let content = resp.text().await?;
13090 let entity: Option<StagesUserWriteUpdateError> = serde_json::from_str(&content).ok();
13091 Err(Error::ResponseError(ResponseContent {
13092 status,
13093 content,
13094 entity,
13095 }))
13096 }
13097}
13098
13099pub async fn stages_user_write_used_by_list(
13101 configuration: &configuration::Configuration,
13102 stage_uuid: &str,
13103) -> Result<Vec<models::UsedBy>, Error<StagesUserWriteUsedByListError>> {
13104 let p_path_stage_uuid = stage_uuid;
13106
13107 let uri_str = format!(
13108 "{}/stages/user_write/{stage_uuid}/used_by/",
13109 configuration.base_path,
13110 stage_uuid = crate::apis::urlencode(p_path_stage_uuid)
13111 );
13112 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
13113
13114 if let Some(ref user_agent) = configuration.user_agent {
13115 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
13116 }
13117 if let Some(ref token) = configuration.bearer_access_token {
13118 req_builder = req_builder.bearer_auth(token.to_owned());
13119 };
13120
13121 let req = req_builder.build()?;
13122 let resp = configuration.client.execute(req).await?;
13123
13124 let status = resp.status();
13125 let content_type = resp
13126 .headers()
13127 .get("content-type")
13128 .and_then(|v| v.to_str().ok())
13129 .unwrap_or("application/octet-stream");
13130 let content_type = super::ContentType::from(content_type);
13131
13132 if !status.is_client_error() && !status.is_server_error() {
13133 let content = resp.text().await?;
13134 match content_type {
13135 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
13136 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
13137 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>`")))),
13138 }
13139 } else {
13140 let content = resp.text().await?;
13141 let entity: Option<StagesUserWriteUsedByListError> = serde_json::from_str(&content).ok();
13142 Err(Error::ResponseError(ResponseContent {
13143 status,
13144 content,
13145 entity,
13146 }))
13147 }
13148}