1use reqwest;
12use serde::{de::Error as _, Deserialize, Serialize};
13
14use super::{configuration, ContentType, Error};
15use crate::{apis::ResponseContent, models};
16
17#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(untagged)]
20pub enum CommitFilesError {
21 Status400(models::JsonErrorResponseNull),
22 Status401(models::JsonErrorResponseNull),
23 Status403(models::JsonErrorResponseNull),
24 Status404(models::JsonErrorResponseNull),
25 Status409(models::JsonErrorResponseNull),
26 Status422(models::RuleCheckOutput),
27 Status429(models::JsonErrorResponseNull),
28 Status500(models::JsonErrorResponseNull),
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum CommitsCalculateDivergenceError {
36 Status400(models::JsonErrorResponseNull),
37 Status401(models::JsonErrorResponseNull),
38 Status403(models::JsonErrorResponseNull),
39 Status404(models::JsonErrorResponseNull),
40 Status409(models::JsonErrorResponseNull),
41 Status429(models::JsonErrorResponseNull),
42 Status500(models::JsonErrorResponseNull),
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DeleteBranchError {
50 Status400(models::JsonErrorResponseNull),
51 Status401(models::JsonErrorResponseNull),
52 Status403(models::JsonErrorResponseNull),
53 Status404(models::JsonErrorResponseNull),
54 Status409(models::JsonErrorResponseNull),
55 Status422(models::RuleCheckOutput),
56 Status429(models::JsonErrorResponseNull),
57 Status500(models::JsonErrorResponseNull),
58 UnknownValue(serde_json::Value),
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum DeleteReleaseError {
65 Status400(models::JsonErrorResponseNull),
66 Status401(models::JsonErrorResponseNull),
67 Status403(models::JsonErrorResponseNull),
68 Status404(models::JsonErrorResponseNull),
69 Status409(models::JsonErrorResponseNull),
70 Status422(models::RuleCheckOutput),
71 Status429(models::JsonErrorResponseNull),
72 Status500(models::JsonErrorResponseNull),
73 UnknownValue(serde_json::Value),
74}
75
76#[derive(Debug, Clone, Serialize, Deserialize)]
78#[serde(untagged)]
79pub enum DeleteRepositoryRunnerError {
80 Status400(models::JsonErrorResponseNull),
81 Status401(models::JsonErrorResponseNull),
82 Status403(models::JsonErrorResponseNull),
83 Status404(models::JsonErrorResponseNull),
84 Status409(models::JsonErrorResponseNull),
85 Status429(models::JsonErrorResponseNull),
86 Status500(models::JsonErrorResponseNull),
87 UnknownValue(serde_json::Value),
88}
89
90#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum DeleteRepositoryVariableError {
94 Status400(models::JsonErrorResponseNull),
95 Status401(models::JsonErrorResponseNull),
96 Status403(models::JsonErrorResponseNull),
97 Status404(models::JsonErrorResponseNull),
98 Status409(models::JsonErrorResponseNull),
99 Status429(models::JsonErrorResponseNull),
100 Status500(models::JsonErrorResponseNull),
101 UnknownValue(serde_json::Value),
102}
103
104#[derive(Debug, Clone, Serialize, Deserialize)]
106#[serde(untagged)]
107pub enum DeleteTagError {
108 Status400(models::JsonErrorResponseNull),
109 Status401(models::JsonErrorResponseNull),
110 Status403(models::JsonErrorResponseNull),
111 Status404(models::JsonErrorResponseNull),
112 Status409(models::JsonErrorResponseNull),
113 Status422(models::RuleCheckOutput),
114 Status429(models::JsonErrorResponseNull),
115 Status500(models::JsonErrorResponseNull),
116 UnknownValue(serde_json::Value),
117}
118
119#[derive(Debug, Clone, Serialize, Deserialize)]
121#[serde(untagged)]
122pub enum GeneralUpdateError {
123 Status400(models::JsonErrorResponseNull),
124 Status401(models::JsonErrorResponseNull),
125 Status403(models::JsonErrorResponseNull),
126 Status404(models::JsonErrorResponseNull),
127 Status409(models::JsonErrorResponseNull),
128 Status429(models::JsonErrorResponseNull),
129 Status500(models::JsonErrorResponseNull),
130 UnknownValue(serde_json::Value),
131}
132
133#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum GetArchiveError {
137 Status400(models::JsonErrorResponseNull),
138 Status401(models::JsonErrorResponseNull),
139 Status403(models::JsonErrorResponseNull),
140 Status404(models::JsonErrorResponseNull),
141 Status409(models::JsonErrorResponseNull),
142 Status429(models::JsonErrorResponseNull),
143 Status500(models::JsonErrorResponseNull),
144 UnknownValue(serde_json::Value),
145}
146
147#[derive(Debug, Clone, Serialize, Deserialize)]
149#[serde(untagged)]
150pub enum GetBlameError {
151 Status400(models::JsonErrorResponseNull),
152 Status401(models::JsonErrorResponseNull),
153 Status403(models::JsonErrorResponseNull),
154 Status404(models::JsonErrorResponseNull),
155 Status409(models::JsonErrorResponseNull),
156 Status429(models::JsonErrorResponseNull),
157 Status500(models::JsonErrorResponseNull),
158 UnknownValue(serde_json::Value),
159}
160
161#[derive(Debug, Clone, Serialize, Deserialize)]
163#[serde(untagged)]
164pub enum GetBranchError {
165 Status400(models::JsonErrorResponseNull),
166 Status401(models::JsonErrorResponseNull),
167 Status403(models::JsonErrorResponseNull),
168 Status404(models::JsonErrorResponseNull),
169 Status409(models::JsonErrorResponseNull),
170 Status429(models::JsonErrorResponseNull),
171 Status500(models::JsonErrorResponseNull),
172 UnknownValue(serde_json::Value),
173}
174
175#[derive(Debug, Clone, Serialize, Deserialize)]
177#[serde(untagged)]
178pub enum GetBranchesError {
179 Status400(models::JsonErrorResponseNull),
180 Status401(models::JsonErrorResponseNull),
181 Status403(models::JsonErrorResponseNull),
182 Status404(models::JsonErrorResponseNull),
183 Status409(models::JsonErrorResponseNull),
184 Status429(models::JsonErrorResponseNull),
185 Status500(models::JsonErrorResponseNull),
186 UnknownValue(serde_json::Value),
187}
188
189#[derive(Debug, Clone, Serialize, Deserialize)]
191#[serde(untagged)]
192pub enum GetCodeownersValidateError {
193 Status400(models::JsonErrorResponseNull),
194 Status401(models::JsonErrorResponseNull),
195 Status403(models::JsonErrorResponseNull),
196 Status404(models::JsonErrorResponseNull),
197 Status409(models::JsonErrorResponseNull),
198 Status429(models::JsonErrorResponseNull),
199 Status500(models::JsonErrorResponseNull),
200 UnknownValue(serde_json::Value),
201}
202
203#[derive(Debug, Clone, Serialize, Deserialize)]
205#[serde(untagged)]
206pub enum GetCommitError {
207 Status400(models::JsonErrorResponseNull),
208 Status401(models::JsonErrorResponseNull),
209 Status403(models::JsonErrorResponseNull),
210 Status404(models::JsonErrorResponseNull),
211 Status409(models::JsonErrorResponseNull),
212 Status429(models::JsonErrorResponseNull),
213 Status500(models::JsonErrorResponseNull),
214 UnknownValue(serde_json::Value),
215}
216
217#[derive(Debug, Clone, Serialize, Deserialize)]
219#[serde(untagged)]
220pub enum GetCommitDiffError {
221 Status400(models::JsonErrorResponseNull),
222 Status401(models::JsonErrorResponseNull),
223 Status403(models::JsonErrorResponseNull),
224 Status404(models::JsonErrorResponseNull),
225 Status409(models::JsonErrorResponseNull),
226 Status429(models::JsonErrorResponseNull),
227 Status500(models::JsonErrorResponseNull),
228 UnknownValue(serde_json::Value),
229}
230
231#[derive(Debug, Clone, Serialize, Deserialize)]
233#[serde(untagged)]
234pub enum GetCommitFileContentError {
235 Status400(models::JsonErrorResponseNull),
236 Status401(models::JsonErrorResponseNull),
237 Status403(models::JsonErrorResponseNull),
238 Status404(models::JsonErrorResponseNull),
239 Status409(models::JsonErrorResponseNull),
240 Status429(models::JsonErrorResponseNull),
241 Status500(models::JsonErrorResponseNull),
242 UnknownValue(serde_json::Value),
243}
244
245#[derive(Debug, Clone, Serialize, Deserialize)]
247#[serde(untagged)]
248pub enum GetCommitsError {
249 Status400(models::JsonErrorResponseNull),
250 Status401(models::JsonErrorResponseNull),
251 Status403(models::JsonErrorResponseNull),
252 Status404(models::JsonErrorResponseNull),
253 Status409(models::JsonErrorResponseNull),
254 Status429(models::JsonErrorResponseNull),
255 Status500(models::JsonErrorResponseNull),
256 UnknownValue(serde_json::Value),
257}
258
259#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum GetContentError {
263 Status400(models::JsonErrorResponseNull),
264 Status401(models::JsonErrorResponseNull),
265 Status403(models::JsonErrorResponseNull),
266 Status404(models::JsonErrorResponseNull),
267 Status409(models::JsonErrorResponseNull),
268 Status429(models::JsonErrorResponseNull),
269 Status500(models::JsonErrorResponseNull),
270 UnknownValue(serde_json::Value),
271}
272
273#[derive(Debug, Clone, Serialize, Deserialize)]
275#[serde(untagged)]
276pub enum GetContributorsError {
277 Status400(models::JsonErrorResponseNull),
278 Status401(models::JsonErrorResponseNull),
279 Status403(models::JsonErrorResponseNull),
280 Status404(models::JsonErrorResponseNull),
281 Status409(models::JsonErrorResponseNull),
282 Status429(models::JsonErrorResponseNull),
283 Status500(models::JsonErrorResponseNull),
284 UnknownValue(serde_json::Value),
285}
286
287#[derive(Debug, Clone, Serialize, Deserialize)]
289#[serde(untagged)]
290pub enum GetDiffStatsError {
291 Status400(models::JsonErrorResponseNull),
292 Status401(models::JsonErrorResponseNull),
293 Status403(models::JsonErrorResponseNull),
294 Status404(models::JsonErrorResponseNull),
295 Status409(models::JsonErrorResponseNull),
296 Status429(models::JsonErrorResponseNull),
297 Status500(models::JsonErrorResponseNull),
298 UnknownValue(serde_json::Value),
299}
300
301#[derive(Debug, Clone, Serialize, Deserialize)]
303#[serde(untagged)]
304pub enum GetDiffsError {
305 Status400(models::JsonErrorResponseNull),
306 Status401(models::JsonErrorResponseNull),
307 Status403(models::JsonErrorResponseNull),
308 Status404(models::JsonErrorResponseNull),
309 Status409(models::JsonErrorResponseNull),
310 Status429(models::JsonErrorResponseNull),
311 Status500(models::JsonErrorResponseNull),
312 UnknownValue(serde_json::Value),
313}
314
315#[derive(Debug, Clone, Serialize, Deserialize)]
317#[serde(untagged)]
318pub enum GetForksError {
319 Status400(models::JsonErrorResponseNull),
320 Status401(models::JsonErrorResponseNull),
321 Status403(models::JsonErrorResponseNull),
322 Status404(models::JsonErrorResponseNull),
323 Status409(models::JsonErrorResponseNull),
324 Status429(models::JsonErrorResponseNull),
325 Status500(models::JsonErrorResponseNull),
326 UnknownValue(serde_json::Value),
327}
328
329#[derive(Debug, Clone, Serialize, Deserialize)]
331#[serde(untagged)]
332pub enum GetGeneralError {
333 Status400(models::JsonErrorResponseNull),
334 Status401(models::JsonErrorResponseNull),
335 Status403(models::JsonErrorResponseNull),
336 Status404(models::JsonErrorResponseNull),
337 Status409(models::JsonErrorResponseNull),
338 Status429(models::JsonErrorResponseNull),
339 Status500(models::JsonErrorResponseNull),
340 UnknownValue(serde_json::Value),
341}
342
343#[derive(Debug, Clone, Serialize, Deserialize)]
345#[serde(untagged)]
346pub enum GetHasStarredError {
347 Status400(models::JsonErrorResponseNull),
348 Status401(models::JsonErrorResponseNull),
349 Status403(models::JsonErrorResponseNull),
350 Status404(models::JsonErrorResponseNull),
351 Status409(models::JsonErrorResponseNull),
352 Status429(models::JsonErrorResponseNull),
353 Status500(models::JsonErrorResponseNull),
354 UnknownValue(serde_json::Value),
355}
356
357#[derive(Debug, Clone, Serialize, Deserialize)]
359#[serde(untagged)]
360pub enum GetImportProgressError {
361 Status400(models::JsonErrorResponseNull),
362 Status401(models::JsonErrorResponseNull),
363 Status403(models::JsonErrorResponseNull),
364 Status404(models::JsonErrorResponseNull),
365 Status409(models::JsonErrorResponseNull),
366 Status429(models::JsonErrorResponseNull),
367 Status500(models::JsonErrorResponseNull),
368 UnknownValue(serde_json::Value),
369}
370
371#[derive(Debug, Clone, Serialize, Deserialize)]
373#[serde(untagged)]
374pub enum GetPathsError {
375 Status400(models::JsonErrorResponseNull),
376 Status401(models::JsonErrorResponseNull),
377 Status403(models::JsonErrorResponseNull),
378 Status404(models::JsonErrorResponseNull),
379 Status409(models::JsonErrorResponseNull),
380 Status429(models::JsonErrorResponseNull),
381 Status500(models::JsonErrorResponseNull),
382 UnknownValue(serde_json::Value),
383}
384
385#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum GetRawError {
389 Status400(models::JsonErrorResponseNull),
390 Status401(models::JsonErrorResponseNull),
391 Status403(models::JsonErrorResponseNull),
392 Status404(models::JsonErrorResponseNull),
393 Status409(models::JsonErrorResponseNull),
394 Status429(models::JsonErrorResponseNull),
395 Status500(models::JsonErrorResponseNull),
396 UnknownValue(serde_json::Value),
397}
398
399#[derive(Debug, Clone, Serialize, Deserialize)]
401#[serde(untagged)]
402pub enum GetReleaseError {
403 Status400(models::JsonErrorResponseNull),
404 Status401(models::JsonErrorResponseNull),
405 Status403(models::JsonErrorResponseNull),
406 Status404(models::JsonErrorResponseNull),
407 Status409(models::JsonErrorResponseNull),
408 Status429(models::JsonErrorResponseNull),
409 Status500(models::JsonErrorResponseNull),
410 UnknownValue(serde_json::Value),
411}
412
413#[derive(Debug, Clone, Serialize, Deserialize)]
415#[serde(untagged)]
416pub enum GetReleasesError {
417 Status400(models::JsonErrorResponseNull),
418 Status401(models::JsonErrorResponseNull),
419 Status403(models::JsonErrorResponseNull),
420 Status404(models::JsonErrorResponseNull),
421 Status409(models::JsonErrorResponseNull),
422 Status429(models::JsonErrorResponseNull),
423 Status500(models::JsonErrorResponseNull),
424 UnknownValue(serde_json::Value),
425}
426
427#[derive(Debug, Clone, Serialize, Deserialize)]
429#[serde(untagged)]
430pub enum GetRepoError {
431 Status400(models::JsonErrorResponseNull),
432 Status401(models::JsonErrorResponseNull),
433 Status403(models::JsonErrorResponseNull),
434 Status404(models::JsonErrorResponseNull),
435 Status409(models::JsonErrorResponseNull),
436 Status429(models::JsonErrorResponseNull),
437 Status500(models::JsonErrorResponseNull),
438 UnknownValue(serde_json::Value),
439}
440
441#[derive(Debug, Clone, Serialize, Deserialize)]
443#[serde(untagged)]
444pub enum GetRepositoryResetedRunnerRegisterTokenError {
445 Status400(models::JsonErrorResponseNull),
446 Status401(models::JsonErrorResponseNull),
447 Status403(models::JsonErrorResponseNull),
448 Status404(models::JsonErrorResponseNull),
449 Status409(models::JsonErrorResponseNull),
450 Status429(models::JsonErrorResponseNull),
451 Status500(models::JsonErrorResponseNull),
452 UnknownValue(serde_json::Value),
453}
454
455#[derive(Debug, Clone, Serialize, Deserialize)]
457#[serde(untagged)]
458pub enum GetRepositoryRunnerError {
459 Status400(models::JsonErrorResponseNull),
460 Status401(models::JsonErrorResponseNull),
461 Status403(models::JsonErrorResponseNull),
462 Status404(models::JsonErrorResponseNull),
463 Status409(models::JsonErrorResponseNull),
464 Status429(models::JsonErrorResponseNull),
465 Status500(models::JsonErrorResponseNull),
466 UnknownValue(serde_json::Value),
467}
468
469#[derive(Debug, Clone, Serialize, Deserialize)]
471#[serde(untagged)]
472pub enum GetRepositoryRunnerRegisterTokenError {
473 Status400(models::JsonErrorResponseNull),
474 Status401(models::JsonErrorResponseNull),
475 Status403(models::JsonErrorResponseNull),
476 Status404(models::JsonErrorResponseNull),
477 Status409(models::JsonErrorResponseNull),
478 Status429(models::JsonErrorResponseNull),
479 Status500(models::JsonErrorResponseNull),
480 UnknownValue(serde_json::Value),
481}
482
483#[derive(Debug, Clone, Serialize, Deserialize)]
485#[serde(untagged)]
486pub enum GetRepositoryRunnersError {
487 Status400(models::JsonErrorResponseNull),
488 Status401(models::JsonErrorResponseNull),
489 Status403(models::JsonErrorResponseNull),
490 Status404(models::JsonErrorResponseNull),
491 Status409(models::JsonErrorResponseNull),
492 Status429(models::JsonErrorResponseNull),
493 Status500(models::JsonErrorResponseNull),
494 UnknownValue(serde_json::Value),
495}
496
497#[derive(Debug, Clone, Serialize, Deserialize)]
499#[serde(untagged)]
500pub enum GetRepositoryServiceAccountsError {
501 Status400(models::JsonErrorResponseNull),
502 Status401(models::JsonErrorResponseNull),
503 Status403(models::JsonErrorResponseNull),
504 Status404(models::JsonErrorResponseNull),
505 Status409(models::JsonErrorResponseNull),
506 Status429(models::JsonErrorResponseNull),
507 Status500(models::JsonErrorResponseNull),
508 UnknownValue(serde_json::Value),
509}
510
511#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum GetRepositoryStatsError {
515 Status400(models::JsonErrorResponseNull),
516 Status401(models::JsonErrorResponseNull),
517 Status403(models::JsonErrorResponseNull),
518 Status404(models::JsonErrorResponseNull),
519 Status409(models::JsonErrorResponseNull),
520 Status429(models::JsonErrorResponseNull),
521 Status500(models::JsonErrorResponseNull),
522 UnknownValue(serde_json::Value),
523}
524
525#[derive(Debug, Clone, Serialize, Deserialize)]
527#[serde(untagged)]
528pub enum GetRepositoryVariableError {
529 Status400(models::JsonErrorResponseNull),
530 Status401(models::JsonErrorResponseNull),
531 Status403(models::JsonErrorResponseNull),
532 Status404(models::JsonErrorResponseNull),
533 Status409(models::JsonErrorResponseNull),
534 Status429(models::JsonErrorResponseNull),
535 Status500(models::JsonErrorResponseNull),
536 UnknownValue(serde_json::Value),
537}
538
539#[derive(Debug, Clone, Serialize, Deserialize)]
541#[serde(untagged)]
542pub enum GetRepositoryVariablesError {
543 Status400(models::JsonErrorResponseNull),
544 Status401(models::JsonErrorResponseNull),
545 Status403(models::JsonErrorResponseNull),
546 Status404(models::JsonErrorResponseNull),
547 Status409(models::JsonErrorResponseNull),
548 Status429(models::JsonErrorResponseNull),
549 Status500(models::JsonErrorResponseNull),
550 UnknownValue(serde_json::Value),
551}
552
553#[derive(Debug, Clone, Serialize, Deserialize)]
555#[serde(untagged)]
556pub enum GetSecurityError {
557 Status400(models::JsonErrorResponseNull),
558 Status401(models::JsonErrorResponseNull),
559 Status403(models::JsonErrorResponseNull),
560 Status404(models::JsonErrorResponseNull),
561 Status409(models::JsonErrorResponseNull),
562 Status429(models::JsonErrorResponseNull),
563 Status500(models::JsonErrorResponseNull),
564 UnknownValue(serde_json::Value),
565}
566
567#[derive(Debug, Clone, Serialize, Deserialize)]
569#[serde(untagged)]
570pub enum GetStarsError {
571 Status400(models::JsonErrorResponseNull),
572 Status401(models::JsonErrorResponseNull),
573 Status403(models::JsonErrorResponseNull),
574 Status404(models::JsonErrorResponseNull),
575 Status409(models::JsonErrorResponseNull),
576 Status429(models::JsonErrorResponseNull),
577 Status500(models::JsonErrorResponseNull),
578 UnknownValue(serde_json::Value),
579}
580
581#[derive(Debug, Clone, Serialize, Deserialize)]
583#[serde(untagged)]
584pub enum GetTagsError {
585 Status400(models::JsonErrorResponseNull),
586 Status401(models::JsonErrorResponseNull),
587 Status403(models::JsonErrorResponseNull),
588 Status404(models::JsonErrorResponseNull),
589 Status409(models::JsonErrorResponseNull),
590 Status429(models::JsonErrorResponseNull),
591 Status500(models::JsonErrorResponseNull),
592 UnknownValue(serde_json::Value),
593}
594
595#[derive(Debug, Clone, Serialize, Deserialize)]
597#[serde(untagged)]
598pub enum PatchRepoError {
599 Status400(models::JsonErrorResponseNull),
600 Status401(models::JsonErrorResponseNull),
601 Status403(models::JsonErrorResponseNull),
602 Status404(models::JsonErrorResponseNull),
603 Status409(models::JsonErrorResponseNull),
604 Status429(models::JsonErrorResponseNull),
605 Status500(models::JsonErrorResponseNull),
606 UnknownValue(serde_json::Value),
607}
608
609#[derive(Debug, Clone, Serialize, Deserialize)]
611#[serde(untagged)]
612pub enum PatchRepositoryRunnerError {
613 Status400(models::JsonErrorResponseNull),
614 Status401(models::JsonErrorResponseNull),
615 Status403(models::JsonErrorResponseNull),
616 Status404(models::JsonErrorResponseNull),
617 Status409(models::JsonErrorResponseNull),
618 Status429(models::JsonErrorResponseNull),
619 Status500(models::JsonErrorResponseNull),
620 UnknownValue(serde_json::Value),
621}
622
623#[derive(Debug, Clone, Serialize, Deserialize)]
625#[serde(untagged)]
626pub enum PatchRepositoryVariableError {
627 Status400(models::JsonErrorResponseNull),
628 Status401(models::JsonErrorResponseNull),
629 Status403(models::JsonErrorResponseNull),
630 Status404(models::JsonErrorResponseNull),
631 Status409(models::JsonErrorResponseNull),
632 Status429(models::JsonErrorResponseNull),
633 Status500(models::JsonErrorResponseNull),
634 UnknownValue(serde_json::Value),
635}
636
637#[derive(Debug, Clone, Serialize, Deserialize)]
639#[serde(untagged)]
640pub enum PatchSecurityError {
641 Status400(models::JsonErrorResponseNull),
642 Status401(models::JsonErrorResponseNull),
643 Status403(models::JsonErrorResponseNull),
644 Status404(models::JsonErrorResponseNull),
645 Status409(models::JsonErrorResponseNull),
646 Status429(models::JsonErrorResponseNull),
647 Status500(models::JsonErrorResponseNull),
648 UnknownValue(serde_json::Value),
649}
650
651#[derive(Debug, Clone, Serialize, Deserialize)]
653#[serde(untagged)]
654pub enum PatchStarsError {
655 Status400(models::JsonErrorResponseNull),
656 Status401(models::JsonErrorResponseNull),
657 Status403(models::JsonErrorResponseNull),
658 Status404(models::JsonErrorResponseNull),
659 Status409(models::JsonErrorResponseNull),
660 Status429(models::JsonErrorResponseNull),
661 Status500(models::JsonErrorResponseNull),
662 UnknownValue(serde_json::Value),
663}
664
665#[derive(Debug, Clone, Serialize, Deserialize)]
667#[serde(untagged)]
668pub enum PostBranchError {
669 Status400(models::JsonErrorResponseNull),
670 Status401(models::JsonErrorResponseNull),
671 Status403(models::JsonErrorResponseNull),
672 Status404(models::JsonErrorResponseNull),
673 Status409(models::JsonErrorResponseNull),
674 Status422(models::RuleCheckOutput),
675 Status429(models::JsonErrorResponseNull),
676 Status500(models::JsonErrorResponseNull),
677 UnknownValue(serde_json::Value),
678}
679
680#[derive(Debug, Clone, Serialize, Deserialize)]
682#[serde(untagged)]
683pub enum PostDefaultBranchError {
684 Status400(models::JsonErrorResponseNull),
685 Status401(models::JsonErrorResponseNull),
686 Status403(models::JsonErrorResponseNull),
687 Status404(models::JsonErrorResponseNull),
688 Status409(models::JsonErrorResponseNull),
689 Status429(models::JsonErrorResponseNull),
690 Status500(models::JsonErrorResponseNull),
691 UnknownValue(serde_json::Value),
692}
693
694#[derive(Debug, Clone, Serialize, Deserialize)]
696#[serde(untagged)]
697pub enum PostDiffsError {
698 Status400(models::JsonErrorResponseNull),
699 Status401(models::JsonErrorResponseNull),
700 Status403(models::JsonErrorResponseNull),
701 Status404(models::JsonErrorResponseNull),
702 Status409(models::JsonErrorResponseNull),
703 Status429(models::JsonErrorResponseNull),
704 Status500(models::JsonErrorResponseNull),
705 UnknownValue(serde_json::Value),
706}
707
708#[derive(Debug, Clone, Serialize, Deserialize)]
710#[serde(untagged)]
711pub enum PostMergeCheckError {
712 Status400(models::JsonErrorResponseNull),
713 Status401(models::JsonErrorResponseNull),
714 Status403(models::JsonErrorResponseNull),
715 Status404(models::JsonErrorResponseNull),
716 Status409(models::JsonErrorResponseNull),
717 Status429(models::JsonErrorResponseNull),
718 Status500(models::JsonErrorResponseNull),
719 UnknownValue(serde_json::Value),
720}
721
722#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum PostPathDetailsError {
726 Status400(models::JsonErrorResponseNull),
727 Status401(models::JsonErrorResponseNull),
728 Status403(models::JsonErrorResponseNull),
729 Status404(models::JsonErrorResponseNull),
730 Status409(models::JsonErrorResponseNull),
731 Status429(models::JsonErrorResponseNull),
732 Status500(models::JsonErrorResponseNull),
733 UnknownValue(serde_json::Value),
734}
735
736#[derive(Debug, Clone, Serialize, Deserialize)]
738#[serde(untagged)]
739pub enum PostReleaseError {
740 Status400(models::JsonErrorResponseNull),
741 Status401(models::JsonErrorResponseNull),
742 Status403(models::JsonErrorResponseNull),
743 Status404(models::JsonErrorResponseNull),
744 Status409(models::JsonErrorResponseNull),
745 Status422(models::RuleCheckOutput),
746 Status429(models::JsonErrorResponseNull),
747 Status500(models::JsonErrorResponseNull),
748 UnknownValue(serde_json::Value),
749}
750
751#[derive(Debug, Clone, Serialize, Deserialize)]
753#[serde(untagged)]
754pub enum PostRepoError {
755 Status400(models::JsonErrorResponseNull),
756 Status401(models::JsonErrorResponseNull),
757 Status403(models::JsonErrorResponseNull),
758 Status404(models::JsonErrorResponseNull),
759 Status409(models::JsonErrorResponseNull),
760 Status429(models::JsonErrorResponseNull),
761 Status500(models::JsonErrorResponseNull),
762 UnknownValue(serde_json::Value),
763}
764
765#[derive(Debug, Clone, Serialize, Deserialize)]
767#[serde(untagged)]
768pub enum PostRepositoryImportError {
769 Status400(models::JsonErrorResponseNull),
770 Status401(models::JsonErrorResponseNull),
771 Status403(models::JsonErrorResponseNull),
772 Status404(models::JsonErrorResponseNull),
773 Status409(models::JsonErrorResponseNull),
774 Status429(models::JsonErrorResponseNull),
775 Status500(models::JsonErrorResponseNull),
776 UnknownValue(serde_json::Value),
777}
778
779#[derive(Debug, Clone, Serialize, Deserialize)]
781#[serde(untagged)]
782pub enum PostRepositoryMoveError {
783 Status400(models::JsonErrorResponseNull),
784 Status401(models::JsonErrorResponseNull),
785 Status403(models::JsonErrorResponseNull),
786 Status404(models::JsonErrorResponseNull),
787 Status409(models::JsonErrorResponseNull),
788 Status429(models::JsonErrorResponseNull),
789 Status500(models::JsonErrorResponseNull),
790 UnknownValue(serde_json::Value),
791}
792
793#[derive(Debug, Clone, Serialize, Deserialize)]
795#[serde(untagged)]
796pub enum PostRepositoryPurgeError {
797 Status400(models::JsonErrorResponseNull),
798 Status401(models::JsonErrorResponseNull),
799 Status403(models::JsonErrorResponseNull),
800 Status404(models::JsonErrorResponseNull),
801 Status409(models::JsonErrorResponseNull),
802 Status429(models::JsonErrorResponseNull),
803 Status500(models::JsonErrorResponseNull),
804 UnknownValue(serde_json::Value),
805}
806
807#[derive(Debug, Clone, Serialize, Deserialize)]
809#[serde(untagged)]
810pub enum PostRepositoryVariableError {
811 Status400(models::JsonErrorResponseNull),
812 Status401(models::JsonErrorResponseNull),
813 Status403(models::JsonErrorResponseNull),
814 Status404(models::JsonErrorResponseNull),
815 Status409(models::JsonErrorResponseNull),
816 Status429(models::JsonErrorResponseNull),
817 Status500(models::JsonErrorResponseNull),
818 UnknownValue(serde_json::Value),
819}
820
821#[derive(Debug, Clone, Serialize, Deserialize)]
823#[serde(untagged)]
824pub enum PostTagError {
825 Status400(models::JsonErrorResponseNull),
826 Status401(models::JsonErrorResponseNull),
827 Status403(models::JsonErrorResponseNull),
828 Status404(models::JsonErrorResponseNull),
829 Status409(models::JsonErrorResponseNull),
830 Status422(models::RuleCheckOutput),
831 Status429(models::JsonErrorResponseNull),
832 Status500(models::JsonErrorResponseNull),
833 UnknownValue(serde_json::Value),
834}
835
836#[derive(Debug, Clone, Serialize, Deserialize)]
838#[serde(untagged)]
839pub enum RenameBranchError {
840 Status400(models::JsonErrorResponseNull),
841 Status401(models::JsonErrorResponseNull),
842 Status403(models::JsonErrorResponseNull),
843 Status404(models::JsonErrorResponseNull),
844 Status409(models::JsonErrorResponseNull),
845 Status422(models::RuleCheckOutput),
846 Status429(models::JsonErrorResponseNull),
847 Status500(models::JsonErrorResponseNull),
848 UnknownValue(serde_json::Value),
849}
850
851#[derive(Debug, Clone, Serialize, Deserialize)]
853#[serde(untagged)]
854pub enum RepoRestoreError {
855 Status400(models::JsonErrorResponseNull),
856 Status401(models::JsonErrorResponseNull),
857 Status403(models::JsonErrorResponseNull),
858 Status404(models::JsonErrorResponseNull),
859 Status409(models::JsonErrorResponseNull),
860 Status429(models::JsonErrorResponseNull),
861 Status500(models::JsonErrorResponseNull),
862 UnknownValue(serde_json::Value),
863}
864
865#[derive(Debug, Clone, Serialize, Deserialize)]
867#[serde(untagged)]
868pub enum SoftRepositoryDeleteError {
869 Status400(models::JsonErrorResponseNull),
870 Status401(models::JsonErrorResponseNull),
871 Status403(models::JsonErrorResponseNull),
872 Status404(models::JsonErrorResponseNull),
873 Status409(models::JsonErrorResponseNull),
874 Status429(models::JsonErrorResponseNull),
875 Status500(models::JsonErrorResponseNull),
876 UnknownValue(serde_json::Value),
877}
878
879pub async fn commit_files(
880 configuration: &configuration::Configuration,
881 repo_ref: &str,
882 commit_files_input: models::CommitFilesInput,
883) -> Result<models::CommitFilesOutput, Error<CommitFilesError>> {
884 let p_path_repo_ref = repo_ref;
886 let p_body_commit_files_input = commit_files_input;
887
888 let uri_str = format!(
889 "{}/repos/{repo_ref}/+/commits",
890 configuration.base_path,
891 repo_ref = crate::apis::urlencode(p_path_repo_ref)
892 );
893 let mut req_builder = configuration
894 .client
895 .request(reqwest::Method::POST, &uri_str);
896
897 if let Some(ref apikey) = configuration.api_key {
898 let key = apikey.key.clone();
899 let value = match apikey.prefix {
900 Some(ref prefix) => format!("{} {}", prefix, key),
901 None => key,
902 };
903 req_builder = req_builder.query(&[("access_token", value)]);
904 }
905 if let Some(ref user_agent) = configuration.user_agent {
906 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
907 }
908 if let Some(ref auth_conf) = configuration.basic_auth {
909 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
910 };
911 if let Some(ref token) = configuration.bearer_access_token {
912 req_builder = req_builder.bearer_auth(token.to_owned());
913 };
914 req_builder = req_builder.json(&p_body_commit_files_input);
915
916 let req = req_builder.build()?;
917 let resp = configuration.client.execute(req).await?;
918
919 let status = resp.status();
920 let content_type = resp
921 .headers()
922 .get("content-type")
923 .and_then(|v| v.to_str().ok())
924 .unwrap_or("application/octet-stream");
925 let content_type = super::ContentType::from(content_type);
926
927 if !status.is_client_error() && !status.is_server_error() {
928 let content = resp.text().await?;
929 match content_type {
930 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
931 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitFilesOutput`"))),
932 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitFilesOutput`")))),
933 }
934 } else {
935 let content = resp.text().await?;
936 let entity: Option<CommitFilesError> = serde_json::from_str(&content).ok();
937 Err(Error::ResponseError(ResponseContent {
938 status,
939 content,
940 entity,
941 }))
942 }
943}
944
945pub async fn commits_calculate_divergence(
946 configuration: &configuration::Configuration,
947 repo_ref: &str,
948 repo_commit_divergences_input: models::RepoCommitDivergencesInput,
949) -> Result<Vec<models::CommitDivergence>, Error<CommitsCalculateDivergenceError>> {
950 let p_path_repo_ref = repo_ref;
952 let p_body_repo_commit_divergences_input = repo_commit_divergences_input;
953
954 let uri_str = format!(
955 "{}/repos/{repo_ref}/+/commits/calculate-divergence",
956 configuration.base_path,
957 repo_ref = crate::apis::urlencode(p_path_repo_ref)
958 );
959 let mut req_builder = configuration
960 .client
961 .request(reqwest::Method::POST, &uri_str);
962
963 if let Some(ref apikey) = configuration.api_key {
964 let key = apikey.key.clone();
965 let value = match apikey.prefix {
966 Some(ref prefix) => format!("{} {}", prefix, key),
967 None => key,
968 };
969 req_builder = req_builder.query(&[("access_token", value)]);
970 }
971 if let Some(ref user_agent) = configuration.user_agent {
972 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
973 }
974 if let Some(ref auth_conf) = configuration.basic_auth {
975 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
976 };
977 if let Some(ref token) = configuration.bearer_access_token {
978 req_builder = req_builder.bearer_auth(token.to_owned());
979 };
980 req_builder = req_builder.json(&p_body_repo_commit_divergences_input);
981
982 let req = req_builder.build()?;
983 let resp = configuration.client.execute(req).await?;
984
985 let status = resp.status();
986 let content_type = resp
987 .headers()
988 .get("content-type")
989 .and_then(|v| v.to_str().ok())
990 .unwrap_or("application/octet-stream");
991 let content_type = super::ContentType::from(content_type);
992
993 if !status.is_client_error() && !status.is_server_error() {
994 let content = resp.text().await?;
995 match content_type {
996 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
997 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CommitDivergence>`"))),
998 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CommitDivergence>`")))),
999 }
1000 } else {
1001 let content = resp.text().await?;
1002 let entity: Option<CommitsCalculateDivergenceError> = serde_json::from_str(&content).ok();
1003 Err(Error::ResponseError(ResponseContent {
1004 status,
1005 content,
1006 entity,
1007 }))
1008 }
1009}
1010
1011pub async fn delete_branch(
1012 configuration: &configuration::Configuration,
1013 repo_ref: &str,
1014 branch_name: &str,
1015 bypass_rules: Option<bool>,
1016) -> Result<(), Error<DeleteBranchError>> {
1017 let p_path_repo_ref = repo_ref;
1019 let p_path_branch_name = branch_name;
1020 let p_query_bypass_rules = bypass_rules;
1021
1022 let uri_str = format!(
1023 "{}/repos/{repo_ref}/+/branches/{branch_name}",
1024 configuration.base_path,
1025 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1026 branch_name = crate::apis::urlencode(p_path_branch_name)
1027 );
1028 let mut req_builder = configuration
1029 .client
1030 .request(reqwest::Method::DELETE, &uri_str);
1031
1032 if let Some(ref param_value) = p_query_bypass_rules {
1033 req_builder = req_builder.query(&[("bypass_rules", ¶m_value.to_string())]);
1034 }
1035 if let Some(ref apikey) = configuration.api_key {
1036 let key = apikey.key.clone();
1037 let value = match apikey.prefix {
1038 Some(ref prefix) => format!("{} {}", prefix, key),
1039 None => key,
1040 };
1041 req_builder = req_builder.query(&[("access_token", value)]);
1042 }
1043 if let Some(ref user_agent) = configuration.user_agent {
1044 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1045 }
1046 if let Some(ref auth_conf) = configuration.basic_auth {
1047 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1048 };
1049 if let Some(ref token) = configuration.bearer_access_token {
1050 req_builder = req_builder.bearer_auth(token.to_owned());
1051 };
1052
1053 let req = req_builder.build()?;
1054 let resp = configuration.client.execute(req).await?;
1055
1056 let status = resp.status();
1057
1058 if !status.is_client_error() && !status.is_server_error() {
1059 Ok(())
1060 } else {
1061 let content = resp.text().await?;
1062 let entity: Option<DeleteBranchError> = serde_json::from_str(&content).ok();
1063 Err(Error::ResponseError(ResponseContent {
1064 status,
1065 content,
1066 entity,
1067 }))
1068 }
1069}
1070
1071pub async fn delete_release(
1072 configuration: &configuration::Configuration,
1073 repo_ref: &str,
1074 tag_ref: &str,
1075 bypass_rules: Option<bool>,
1076) -> Result<(), Error<DeleteReleaseError>> {
1077 let p_path_repo_ref = repo_ref;
1079 let p_path_tag_ref = tag_ref;
1080 let p_query_bypass_rules = bypass_rules;
1081
1082 let uri_str = format!(
1083 "{}/repos/{repo_ref}/+/releases/{tag_ref}",
1084 configuration.base_path,
1085 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1086 tag_ref = crate::apis::urlencode(p_path_tag_ref)
1087 );
1088 let mut req_builder = configuration
1089 .client
1090 .request(reqwest::Method::DELETE, &uri_str);
1091
1092 if let Some(ref param_value) = p_query_bypass_rules {
1093 req_builder = req_builder.query(&[("bypass_rules", ¶m_value.to_string())]);
1094 }
1095 if let Some(ref apikey) = configuration.api_key {
1096 let key = apikey.key.clone();
1097 let value = match apikey.prefix {
1098 Some(ref prefix) => format!("{} {}", prefix, key),
1099 None => key,
1100 };
1101 req_builder = req_builder.query(&[("access_token", value)]);
1102 }
1103 if let Some(ref user_agent) = configuration.user_agent {
1104 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1105 }
1106 if let Some(ref auth_conf) = configuration.basic_auth {
1107 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1108 };
1109 if let Some(ref token) = configuration.bearer_access_token {
1110 req_builder = req_builder.bearer_auth(token.to_owned());
1111 };
1112
1113 let req = req_builder.build()?;
1114 let resp = configuration.client.execute(req).await?;
1115
1116 let status = resp.status();
1117
1118 if !status.is_client_error() && !status.is_server_error() {
1119 Ok(())
1120 } else {
1121 let content = resp.text().await?;
1122 let entity: Option<DeleteReleaseError> = serde_json::from_str(&content).ok();
1123 Err(Error::ResponseError(ResponseContent {
1124 status,
1125 content,
1126 entity,
1127 }))
1128 }
1129}
1130
1131pub async fn delete_repository_runner(
1132 configuration: &configuration::Configuration,
1133 repo_ref: &str,
1134 runner_uuid: &str,
1135) -> Result<(), Error<DeleteRepositoryRunnerError>> {
1136 let p_path_repo_ref = repo_ref;
1138 let p_path_runner_uuid = runner_uuid;
1139
1140 let uri_str = format!(
1141 "{}/repos/{repo_ref}/+/runners/{runner_uuid}",
1142 configuration.base_path,
1143 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1144 runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
1145 );
1146 let mut req_builder = configuration
1147 .client
1148 .request(reqwest::Method::DELETE, &uri_str);
1149
1150 if let Some(ref apikey) = configuration.api_key {
1151 let key = apikey.key.clone();
1152 let value = match apikey.prefix {
1153 Some(ref prefix) => format!("{} {}", prefix, key),
1154 None => key,
1155 };
1156 req_builder = req_builder.query(&[("access_token", value)]);
1157 }
1158 if let Some(ref user_agent) = configuration.user_agent {
1159 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1160 }
1161 if let Some(ref auth_conf) = configuration.basic_auth {
1162 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1163 };
1164 if let Some(ref token) = configuration.bearer_access_token {
1165 req_builder = req_builder.bearer_auth(token.to_owned());
1166 };
1167
1168 let req = req_builder.build()?;
1169 let resp = configuration.client.execute(req).await?;
1170
1171 let status = resp.status();
1172
1173 if !status.is_client_error() && !status.is_server_error() {
1174 Ok(())
1175 } else {
1176 let content = resp.text().await?;
1177 let entity: Option<DeleteRepositoryRunnerError> = serde_json::from_str(&content).ok();
1178 Err(Error::ResponseError(ResponseContent {
1179 status,
1180 content,
1181 entity,
1182 }))
1183 }
1184}
1185
1186pub async fn delete_repository_variable(
1187 configuration: &configuration::Configuration,
1188 repo_ref: &str,
1189 variable_identifier: &str,
1190) -> Result<(), Error<DeleteRepositoryVariableError>> {
1191 let p_path_repo_ref = repo_ref;
1193 let p_path_variable_identifier = variable_identifier;
1194
1195 let uri_str = format!(
1196 "{}/repos/{repo_ref}/+/variables/{variable_identifier}",
1197 configuration.base_path,
1198 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1199 variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
1200 );
1201 let mut req_builder = configuration
1202 .client
1203 .request(reqwest::Method::DELETE, &uri_str);
1204
1205 if let Some(ref apikey) = configuration.api_key {
1206 let key = apikey.key.clone();
1207 let value = match apikey.prefix {
1208 Some(ref prefix) => format!("{} {}", prefix, key),
1209 None => key,
1210 };
1211 req_builder = req_builder.query(&[("access_token", value)]);
1212 }
1213 if let Some(ref user_agent) = configuration.user_agent {
1214 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1215 }
1216 if let Some(ref auth_conf) = configuration.basic_auth {
1217 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1218 };
1219 if let Some(ref token) = configuration.bearer_access_token {
1220 req_builder = req_builder.bearer_auth(token.to_owned());
1221 };
1222
1223 let req = req_builder.build()?;
1224 let resp = configuration.client.execute(req).await?;
1225
1226 let status = resp.status();
1227
1228 if !status.is_client_error() && !status.is_server_error() {
1229 Ok(())
1230 } else {
1231 let content = resp.text().await?;
1232 let entity: Option<DeleteRepositoryVariableError> = serde_json::from_str(&content).ok();
1233 Err(Error::ResponseError(ResponseContent {
1234 status,
1235 content,
1236 entity,
1237 }))
1238 }
1239}
1240
1241pub async fn delete_tag(
1242 configuration: &configuration::Configuration,
1243 repo_ref: &str,
1244 tag_name: &str,
1245 bypass_rules: Option<bool>,
1246) -> Result<(), Error<DeleteTagError>> {
1247 let p_path_repo_ref = repo_ref;
1249 let p_path_tag_name = tag_name;
1250 let p_query_bypass_rules = bypass_rules;
1251
1252 let uri_str = format!(
1253 "{}/repos/{repo_ref}/+/tags/{tag_name}",
1254 configuration.base_path,
1255 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1256 tag_name = crate::apis::urlencode(p_path_tag_name)
1257 );
1258 let mut req_builder = configuration
1259 .client
1260 .request(reqwest::Method::DELETE, &uri_str);
1261
1262 if let Some(ref param_value) = p_query_bypass_rules {
1263 req_builder = req_builder.query(&[("bypass_rules", ¶m_value.to_string())]);
1264 }
1265 if let Some(ref apikey) = configuration.api_key {
1266 let key = apikey.key.clone();
1267 let value = match apikey.prefix {
1268 Some(ref prefix) => format!("{} {}", prefix, key),
1269 None => key,
1270 };
1271 req_builder = req_builder.query(&[("access_token", value)]);
1272 }
1273 if let Some(ref user_agent) = configuration.user_agent {
1274 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1275 }
1276 if let Some(ref auth_conf) = configuration.basic_auth {
1277 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1278 };
1279 if let Some(ref token) = configuration.bearer_access_token {
1280 req_builder = req_builder.bearer_auth(token.to_owned());
1281 };
1282
1283 let req = req_builder.build()?;
1284 let resp = configuration.client.execute(req).await?;
1285
1286 let status = resp.status();
1287
1288 if !status.is_client_error() && !status.is_server_error() {
1289 Ok(())
1290 } else {
1291 let content = resp.text().await?;
1292 let entity: Option<DeleteTagError> = serde_json::from_str(&content).ok();
1293 Err(Error::ResponseError(ResponseContent {
1294 status,
1295 content,
1296 entity,
1297 }))
1298 }
1299}
1300
1301pub async fn general_update(
1302 configuration: &configuration::Configuration,
1303 repo_ref: &str,
1304 general_settings: models::GeneralSettings,
1305) -> Result<models::GeneralSettings, Error<GeneralUpdateError>> {
1306 let p_path_repo_ref = repo_ref;
1308 let p_body_general_settings = general_settings;
1309
1310 let uri_str = format!(
1311 "{}/repos/{repo_ref}/+/settings/general",
1312 configuration.base_path,
1313 repo_ref = crate::apis::urlencode(p_path_repo_ref)
1314 );
1315 let mut req_builder = configuration
1316 .client
1317 .request(reqwest::Method::PATCH, &uri_str);
1318
1319 if let Some(ref apikey) = configuration.api_key {
1320 let key = apikey.key.clone();
1321 let value = match apikey.prefix {
1322 Some(ref prefix) => format!("{} {}", prefix, key),
1323 None => key,
1324 };
1325 req_builder = req_builder.query(&[("access_token", value)]);
1326 }
1327 if let Some(ref user_agent) = configuration.user_agent {
1328 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1329 }
1330 if let Some(ref auth_conf) = configuration.basic_auth {
1331 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1332 };
1333 if let Some(ref token) = configuration.bearer_access_token {
1334 req_builder = req_builder.bearer_auth(token.to_owned());
1335 };
1336 req_builder = req_builder.json(&p_body_general_settings);
1337
1338 let req = req_builder.build()?;
1339 let resp = configuration.client.execute(req).await?;
1340
1341 let status = resp.status();
1342 let content_type = resp
1343 .headers()
1344 .get("content-type")
1345 .and_then(|v| v.to_str().ok())
1346 .unwrap_or("application/octet-stream");
1347 let content_type = super::ContentType::from(content_type);
1348
1349 if !status.is_client_error() && !status.is_server_error() {
1350 let content = resp.text().await?;
1351 match content_type {
1352 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1353 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralSettings`"))),
1354 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeneralSettings`")))),
1355 }
1356 } else {
1357 let content = resp.text().await?;
1358 let entity: Option<GeneralUpdateError> = serde_json::from_str(&content).ok();
1359 Err(Error::ResponseError(ResponseContent {
1360 status,
1361 content,
1362 entity,
1363 }))
1364 }
1365}
1366
1367pub async fn get_archive(
1368 configuration: &configuration::Configuration,
1369 repo_ref: &str,
1370 archive_ref: &str,
1371 prefix: Option<&str>,
1372 attributes: Option<models::ArchiveAttribute>,
1373 paths: Option<Vec<String>>,
1374 timestamp: Option<i64>,
1375 compression: Option<i32>,
1376) -> Result<Vec<i32>, Error<GetArchiveError>> {
1377 let p_path_repo_ref = repo_ref;
1379 let p_path_archive_ref = archive_ref;
1380 let p_query_prefix = prefix;
1381 let p_query_attributes = attributes;
1382 let p_query_paths = paths;
1383 let p_query_timestamp = timestamp;
1384 let p_query_compression = compression;
1385
1386 let uri_str = format!(
1387 "{}/repos/{repo_ref}/+/archive/{archive_ref}",
1388 configuration.base_path,
1389 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1390 archive_ref = crate::apis::urlencode(p_path_archive_ref)
1391 );
1392 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1393
1394 if let Some(ref param_value) = p_query_prefix {
1395 req_builder = req_builder.query(&[("prefix", ¶m_value.to_string())]);
1396 }
1397 if let Some(ref param_value) = p_query_attributes {
1398 req_builder = req_builder.query(&[("attributes", ¶m_value.to_string())]);
1399 }
1400 if let Some(ref param_value) = p_query_paths {
1401 req_builder = match "multi" {
1402 "multi" => req_builder.query(
1403 ¶m_value
1404 .iter()
1405 .map(|p| ("paths".to_owned(), p.to_string()))
1406 .collect::<Vec<(std::string::String, std::string::String)>>(),
1407 ),
1408 _ => req_builder.query(&[(
1409 "paths",
1410 ¶m_value
1411 .iter()
1412 .map(|p| p.to_string())
1413 .collect::<Vec<String>>()
1414 .join(",")
1415 .to_string(),
1416 )]),
1417 };
1418 }
1419 if let Some(ref param_value) = p_query_timestamp {
1420 req_builder = req_builder.query(&[("timestamp", ¶m_value.to_string())]);
1421 }
1422 if let Some(ref param_value) = p_query_compression {
1423 req_builder = req_builder.query(&[("compression", ¶m_value.to_string())]);
1424 }
1425 if let Some(ref apikey) = configuration.api_key {
1426 let key = apikey.key.clone();
1427 let value = match apikey.prefix {
1428 Some(ref prefix) => format!("{} {}", prefix, key),
1429 None => key,
1430 };
1431 req_builder = req_builder.query(&[("access_token", value)]);
1432 }
1433 if let Some(ref user_agent) = configuration.user_agent {
1434 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1435 }
1436 if let Some(ref auth_conf) = configuration.basic_auth {
1437 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1438 };
1439 if let Some(ref token) = configuration.bearer_access_token {
1440 req_builder = req_builder.bearer_auth(token.to_owned());
1441 };
1442
1443 let req = req_builder.build()?;
1444 let resp = configuration.client.execute(req).await?;
1445
1446 let status = resp.status();
1447 let content_type = resp
1448 .headers()
1449 .get("content-type")
1450 .and_then(|v| v.to_str().ok())
1451 .unwrap_or("application/octet-stream");
1452 let content_type = super::ContentType::from(content_type);
1453
1454 if !status.is_client_error() && !status.is_server_error() {
1455 let content = resp.text().await?;
1456 match content_type {
1457 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1458 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<i32>`"))),
1459 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<i32>`")))),
1460 }
1461 } else {
1462 let content = resp.text().await?;
1463 let entity: Option<GetArchiveError> = serde_json::from_str(&content).ok();
1464 Err(Error::ResponseError(ResponseContent {
1465 status,
1466 content,
1467 entity,
1468 }))
1469 }
1470}
1471
1472pub async fn get_blame(
1473 configuration: &configuration::Configuration,
1474 repo_ref: &str,
1475 path: &str,
1476 git_ref: Option<&str>,
1477 line_from: Option<i64>,
1478 line_to: Option<i64>,
1479) -> Result<Vec<models::BlamePart>, Error<GetBlameError>> {
1480 let p_path_repo_ref = repo_ref;
1482 let p_path_path = path;
1483 let p_query_git_ref = git_ref;
1484 let p_query_line_from = line_from;
1485 let p_query_line_to = line_to;
1486
1487 let uri_str = format!(
1488 "{}/repos/{repo_ref}/+/blame/{path}",
1489 configuration.base_path,
1490 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1491 path = crate::apis::urlencode(p_path_path)
1492 );
1493 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1494
1495 if let Some(ref param_value) = p_query_git_ref {
1496 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
1497 }
1498 if let Some(ref param_value) = p_query_line_from {
1499 req_builder = req_builder.query(&[("line_from", ¶m_value.to_string())]);
1500 }
1501 if let Some(ref param_value) = p_query_line_to {
1502 req_builder = req_builder.query(&[("line_to", ¶m_value.to_string())]);
1503 }
1504 if let Some(ref apikey) = configuration.api_key {
1505 let key = apikey.key.clone();
1506 let value = match apikey.prefix {
1507 Some(ref prefix) => format!("{} {}", prefix, key),
1508 None => key,
1509 };
1510 req_builder = req_builder.query(&[("access_token", value)]);
1511 }
1512 if let Some(ref user_agent) = configuration.user_agent {
1513 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1514 }
1515 if let Some(ref auth_conf) = configuration.basic_auth {
1516 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1517 };
1518 if let Some(ref token) = configuration.bearer_access_token {
1519 req_builder = req_builder.bearer_auth(token.to_owned());
1520 };
1521
1522 let req = req_builder.build()?;
1523 let resp = configuration.client.execute(req).await?;
1524
1525 let status = resp.status();
1526 let content_type = resp
1527 .headers()
1528 .get("content-type")
1529 .and_then(|v| v.to_str().ok())
1530 .unwrap_or("application/octet-stream");
1531 let content_type = super::ContentType::from(content_type);
1532
1533 if !status.is_client_error() && !status.is_server_error() {
1534 let content = resp.text().await?;
1535 match content_type {
1536 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1537 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::BlamePart>`"))),
1538 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::BlamePart>`")))),
1539 }
1540 } else {
1541 let content = resp.text().await?;
1542 let entity: Option<GetBlameError> = serde_json::from_str(&content).ok();
1543 Err(Error::ResponseError(ResponseContent {
1544 status,
1545 content,
1546 entity,
1547 }))
1548 }
1549}
1550
1551pub async fn get_branch(
1552 configuration: &configuration::Configuration,
1553 repo_ref: &str,
1554 branch_name: &str,
1555) -> Result<models::CommitBranch, Error<GetBranchError>> {
1556 let p_path_repo_ref = repo_ref;
1558 let p_path_branch_name = branch_name;
1559
1560 let uri_str = format!(
1561 "{}/repos/{repo_ref}/+/branches/{branch_name}",
1562 configuration.base_path,
1563 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1564 branch_name = crate::apis::urlencode(p_path_branch_name)
1565 );
1566 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1567
1568 if let Some(ref apikey) = configuration.api_key {
1569 let key = apikey.key.clone();
1570 let value = match apikey.prefix {
1571 Some(ref prefix) => format!("{} {}", prefix, key),
1572 None => key,
1573 };
1574 req_builder = req_builder.query(&[("access_token", value)]);
1575 }
1576 if let Some(ref user_agent) = configuration.user_agent {
1577 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1578 }
1579 if let Some(ref auth_conf) = configuration.basic_auth {
1580 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1581 };
1582 if let Some(ref token) = configuration.bearer_access_token {
1583 req_builder = req_builder.bearer_auth(token.to_owned());
1584 };
1585
1586 let req = req_builder.build()?;
1587 let resp = configuration.client.execute(req).await?;
1588
1589 let status = resp.status();
1590 let content_type = resp
1591 .headers()
1592 .get("content-type")
1593 .and_then(|v| v.to_str().ok())
1594 .unwrap_or("application/octet-stream");
1595 let content_type = super::ContentType::from(content_type);
1596
1597 if !status.is_client_error() && !status.is_server_error() {
1598 let content = resp.text().await?;
1599 match content_type {
1600 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1601 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitBranch`"))),
1602 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitBranch`")))),
1603 }
1604 } else {
1605 let content = resp.text().await?;
1606 let entity: Option<GetBranchError> = serde_json::from_str(&content).ok();
1607 Err(Error::ResponseError(ResponseContent {
1608 status,
1609 content,
1610 entity,
1611 }))
1612 }
1613}
1614
1615pub async fn get_branches(
1616 configuration: &configuration::Configuration,
1617 repo_ref: &str,
1618 page: Option<i64>,
1619 size: Option<i64>,
1620 query: Option<&str>,
1621 include_commit: Option<bool>,
1622) -> Result<Vec<models::CommitBranch>, Error<GetBranchesError>> {
1623 let p_path_repo_ref = repo_ref;
1625 let p_query_page = page;
1626 let p_query_size = size;
1627 let p_query_query = query;
1628 let p_query_include_commit = include_commit;
1629
1630 let uri_str = format!(
1631 "{}/repos/{repo_ref}/+/branches",
1632 configuration.base_path,
1633 repo_ref = crate::apis::urlencode(p_path_repo_ref)
1634 );
1635 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1636
1637 if let Some(ref param_value) = p_query_page {
1638 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1639 }
1640 if let Some(ref param_value) = p_query_size {
1641 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
1642 }
1643 if let Some(ref param_value) = p_query_query {
1644 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
1645 }
1646 if let Some(ref param_value) = p_query_include_commit {
1647 req_builder = req_builder.query(&[("include_commit", ¶m_value.to_string())]);
1648 }
1649 if let Some(ref apikey) = configuration.api_key {
1650 let key = apikey.key.clone();
1651 let value = match apikey.prefix {
1652 Some(ref prefix) => format!("{} {}", prefix, key),
1653 None => key,
1654 };
1655 req_builder = req_builder.query(&[("access_token", value)]);
1656 }
1657 if let Some(ref user_agent) = configuration.user_agent {
1658 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1659 }
1660 if let Some(ref auth_conf) = configuration.basic_auth {
1661 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1662 };
1663 if let Some(ref token) = configuration.bearer_access_token {
1664 req_builder = req_builder.bearer_auth(token.to_owned());
1665 };
1666
1667 let req = req_builder.build()?;
1668 let resp = configuration.client.execute(req).await?;
1669
1670 let status = resp.status();
1671 let content_type = resp
1672 .headers()
1673 .get("content-type")
1674 .and_then(|v| v.to_str().ok())
1675 .unwrap_or("application/octet-stream");
1676 let content_type = super::ContentType::from(content_type);
1677
1678 if !status.is_client_error() && !status.is_server_error() {
1679 let content = resp.text().await?;
1680 match content_type {
1681 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1682 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CommitBranch>`"))),
1683 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CommitBranch>`")))),
1684 }
1685 } else {
1686 let content = resp.text().await?;
1687 let entity: Option<GetBranchesError> = serde_json::from_str(&content).ok();
1688 Err(Error::ResponseError(ResponseContent {
1689 status,
1690 content,
1691 entity,
1692 }))
1693 }
1694}
1695
1696pub async fn get_codeowners_validate(
1697 configuration: &configuration::Configuration,
1698 repo_ref: &str,
1699 git_ref: Option<&str>,
1700) -> Result<models::CodeOwnersValidation, Error<GetCodeownersValidateError>> {
1701 let p_path_repo_ref = repo_ref;
1703 let p_query_git_ref = git_ref;
1704
1705 let uri_str = format!(
1706 "{}/repos/{repo_ref}/+/codeowners/validate",
1707 configuration.base_path,
1708 repo_ref = crate::apis::urlencode(p_path_repo_ref)
1709 );
1710 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1711
1712 if let Some(ref param_value) = p_query_git_ref {
1713 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
1714 }
1715 if let Some(ref apikey) = configuration.api_key {
1716 let key = apikey.key.clone();
1717 let value = match apikey.prefix {
1718 Some(ref prefix) => format!("{} {}", prefix, key),
1719 None => key,
1720 };
1721 req_builder = req_builder.query(&[("access_token", value)]);
1722 }
1723 if let Some(ref user_agent) = configuration.user_agent {
1724 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1725 }
1726 if let Some(ref auth_conf) = configuration.basic_auth {
1727 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1728 };
1729 if let Some(ref token) = configuration.bearer_access_token {
1730 req_builder = req_builder.bearer_auth(token.to_owned());
1731 };
1732
1733 let req = req_builder.build()?;
1734 let resp = configuration.client.execute(req).await?;
1735
1736 let status = resp.status();
1737 let content_type = resp
1738 .headers()
1739 .get("content-type")
1740 .and_then(|v| v.to_str().ok())
1741 .unwrap_or("application/octet-stream");
1742 let content_type = super::ContentType::from(content_type);
1743
1744 if !status.is_client_error() && !status.is_server_error() {
1745 let content = resp.text().await?;
1746 match content_type {
1747 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1748 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CodeOwnersValidation`"))),
1749 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CodeOwnersValidation`")))),
1750 }
1751 } else {
1752 let content = resp.text().await?;
1753 let entity: Option<GetCodeownersValidateError> = serde_json::from_str(&content).ok();
1754 Err(Error::ResponseError(ResponseContent {
1755 status,
1756 content,
1757 entity,
1758 }))
1759 }
1760}
1761
1762pub async fn get_commit(
1763 configuration: &configuration::Configuration,
1764 repo_ref: &str,
1765 commit_sha: &str,
1766) -> Result<models::Commit, Error<GetCommitError>> {
1767 let p_path_repo_ref = repo_ref;
1769 let p_path_commit_sha = commit_sha;
1770
1771 let uri_str = format!(
1772 "{}/repos/{repo_ref}/+/commits/{commit_sha}",
1773 configuration.base_path,
1774 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1775 commit_sha = crate::apis::urlencode(p_path_commit_sha)
1776 );
1777 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1778
1779 if let Some(ref apikey) = configuration.api_key {
1780 let key = apikey.key.clone();
1781 let value = match apikey.prefix {
1782 Some(ref prefix) => format!("{} {}", prefix, key),
1783 None => key,
1784 };
1785 req_builder = req_builder.query(&[("access_token", value)]);
1786 }
1787 if let Some(ref user_agent) = configuration.user_agent {
1788 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1789 }
1790 if let Some(ref auth_conf) = configuration.basic_auth {
1791 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1792 };
1793 if let Some(ref token) = configuration.bearer_access_token {
1794 req_builder = req_builder.bearer_auth(token.to_owned());
1795 };
1796
1797 let req = req_builder.build()?;
1798 let resp = configuration.client.execute(req).await?;
1799
1800 let status = resp.status();
1801 let content_type = resp
1802 .headers()
1803 .get("content-type")
1804 .and_then(|v| v.to_str().ok())
1805 .unwrap_or("application/octet-stream");
1806 let content_type = super::ContentType::from(content_type);
1807
1808 if !status.is_client_error() && !status.is_server_error() {
1809 let content = resp.text().await?;
1810 match content_type {
1811 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1812 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Commit`"))),
1813 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Commit`")))),
1814 }
1815 } else {
1816 let content = resp.text().await?;
1817 let entity: Option<GetCommitError> = serde_json::from_str(&content).ok();
1818 Err(Error::ResponseError(ResponseContent {
1819 status,
1820 content,
1821 entity,
1822 }))
1823 }
1824}
1825
1826pub async fn get_commit_diff(
1827 configuration: &configuration::Configuration,
1828 repo_ref: &str,
1829 commit_sha: &str,
1830) -> Result<String, Error<GetCommitDiffError>> {
1831 let p_path_repo_ref = repo_ref;
1833 let p_path_commit_sha = commit_sha;
1834
1835 let uri_str = format!(
1836 "{}/repos/{repo_ref}/+/commits/{commit_sha}/diff",
1837 configuration.base_path,
1838 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1839 commit_sha = crate::apis::urlencode(p_path_commit_sha)
1840 );
1841 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1842
1843 if let Some(ref apikey) = configuration.api_key {
1844 let key = apikey.key.clone();
1845 let value = match apikey.prefix {
1846 Some(ref prefix) => format!("{} {}", prefix, key),
1847 None => key,
1848 };
1849 req_builder = req_builder.query(&[("access_token", value)]);
1850 }
1851 if let Some(ref user_agent) = configuration.user_agent {
1852 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1853 }
1854 if let Some(ref auth_conf) = configuration.basic_auth {
1855 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1856 };
1857 if let Some(ref token) = configuration.bearer_access_token {
1858 req_builder = req_builder.bearer_auth(token.to_owned());
1859 };
1860
1861 let req = req_builder.build()?;
1862 let resp = configuration.client.execute(req).await?;
1863
1864 let status = resp.status();
1865 let content_type = resp
1866 .headers()
1867 .get("content-type")
1868 .and_then(|v| v.to_str().ok())
1869 .unwrap_or("application/octet-stream");
1870 let content_type = super::ContentType::from(content_type);
1871
1872 if !status.is_client_error() && !status.is_server_error() {
1873 let content = resp.text().await?;
1874 match content_type {
1875 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1876 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))),
1877 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))),
1878 }
1879 } else {
1880 let content = resp.text().await?;
1881 let entity: Option<GetCommitDiffError> = serde_json::from_str(&content).ok();
1882 Err(Error::ResponseError(ResponseContent {
1883 status,
1884 content,
1885 entity,
1886 }))
1887 }
1888}
1889
1890pub async fn get_commit_file_content(
1891 configuration: &configuration::Configuration,
1892 repo_ref: &str,
1893 commit_sha: &str,
1894 file_path: &str,
1895 hunk_header: &str,
1896 expand_up: bool,
1897 size: Option<i32>,
1898) -> Result<models::DiffFileContent, Error<GetCommitFileContentError>> {
1899 let p_path_repo_ref = repo_ref;
1901 let p_path_commit_sha = commit_sha;
1902 let p_query_file_path = file_path;
1903 let p_query_hunk_header = hunk_header;
1904 let p_query_expand_up = expand_up;
1905 let p_query_size = size;
1906
1907 let uri_str = format!(
1908 "{}/repos/{repo_ref}/+/commits/{commit_sha}/content",
1909 configuration.base_path,
1910 repo_ref = crate::apis::urlencode(p_path_repo_ref),
1911 commit_sha = crate::apis::urlencode(p_path_commit_sha)
1912 );
1913 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1914
1915 req_builder = req_builder.query(&[("file_path", &p_query_file_path.to_string())]);
1916 req_builder = req_builder.query(&[("hunk_header", &p_query_hunk_header.to_string())]);
1917 if let Some(ref param_value) = p_query_size {
1918 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
1919 }
1920 req_builder = req_builder.query(&[("expand_up", &p_query_expand_up.to_string())]);
1921 if let Some(ref apikey) = configuration.api_key {
1922 let key = apikey.key.clone();
1923 let value = match apikey.prefix {
1924 Some(ref prefix) => format!("{} {}", prefix, key),
1925 None => key,
1926 };
1927 req_builder = req_builder.query(&[("access_token", value)]);
1928 }
1929 if let Some(ref user_agent) = configuration.user_agent {
1930 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1931 }
1932 if let Some(ref auth_conf) = configuration.basic_auth {
1933 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1934 };
1935 if let Some(ref token) = configuration.bearer_access_token {
1936 req_builder = req_builder.bearer_auth(token.to_owned());
1937 };
1938
1939 let req = req_builder.build()?;
1940 let resp = configuration.client.execute(req).await?;
1941
1942 let status = resp.status();
1943 let content_type = resp
1944 .headers()
1945 .get("content-type")
1946 .and_then(|v| v.to_str().ok())
1947 .unwrap_or("application/octet-stream");
1948 let content_type = super::ContentType::from(content_type);
1949
1950 if !status.is_client_error() && !status.is_server_error() {
1951 let content = resp.text().await?;
1952 match content_type {
1953 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1954 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DiffFileContent`"))),
1955 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DiffFileContent`")))),
1956 }
1957 } else {
1958 let content = resp.text().await?;
1959 let entity: Option<GetCommitFileContentError> = serde_json::from_str(&content).ok();
1960 Err(Error::ResponseError(ResponseContent {
1961 status,
1962 content,
1963 entity,
1964 }))
1965 }
1966}
1967
1968pub async fn get_commits(
1969 configuration: &configuration::Configuration,
1970 repo_ref: &str,
1971 git_ref: Option<&str>,
1972 page: Option<i64>,
1973 size: Option<i64>,
1974 after: Option<&str>,
1975 path: Option<&str>,
1976 since: Option<i64>,
1977 until: Option<i64>,
1978 author: Option<&str>,
1979 include_stats: Option<bool>,
1980) -> Result<Vec<models::CommitWithPathRenameDetails>, Error<GetCommitsError>> {
1981 let p_path_repo_ref = repo_ref;
1983 let p_query_git_ref = git_ref;
1984 let p_query_page = page;
1985 let p_query_size = size;
1986 let p_query_after = after;
1987 let p_query_path = path;
1988 let p_query_since = since;
1989 let p_query_until = until;
1990 let p_query_author = author;
1991 let p_query_include_stats = include_stats;
1992
1993 let uri_str = format!(
1994 "{}/repos/{repo_ref}/+/commits",
1995 configuration.base_path,
1996 repo_ref = crate::apis::urlencode(p_path_repo_ref)
1997 );
1998 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1999
2000 if let Some(ref param_value) = p_query_git_ref {
2001 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
2002 }
2003 if let Some(ref param_value) = p_query_page {
2004 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2005 }
2006 if let Some(ref param_value) = p_query_size {
2007 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
2008 }
2009 if let Some(ref param_value) = p_query_after {
2010 req_builder = req_builder.query(&[("after", ¶m_value.to_string())]);
2011 }
2012 if let Some(ref param_value) = p_query_path {
2013 req_builder = req_builder.query(&[("path", ¶m_value.to_string())]);
2014 }
2015 if let Some(ref param_value) = p_query_since {
2016 req_builder = req_builder.query(&[("since", ¶m_value.to_string())]);
2017 }
2018 if let Some(ref param_value) = p_query_until {
2019 req_builder = req_builder.query(&[("until", ¶m_value.to_string())]);
2020 }
2021 if let Some(ref param_value) = p_query_author {
2022 req_builder = req_builder.query(&[("author", ¶m_value.to_string())]);
2023 }
2024 if let Some(ref param_value) = p_query_include_stats {
2025 req_builder = req_builder.query(&[("include_stats", ¶m_value.to_string())]);
2026 }
2027 if let Some(ref apikey) = configuration.api_key {
2028 let key = apikey.key.clone();
2029 let value = match apikey.prefix {
2030 Some(ref prefix) => format!("{} {}", prefix, key),
2031 None => key,
2032 };
2033 req_builder = req_builder.query(&[("access_token", value)]);
2034 }
2035 if let Some(ref user_agent) = configuration.user_agent {
2036 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2037 }
2038 if let Some(ref auth_conf) = configuration.basic_auth {
2039 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2040 };
2041 if let Some(ref token) = configuration.bearer_access_token {
2042 req_builder = req_builder.bearer_auth(token.to_owned());
2043 };
2044
2045 let req = req_builder.build()?;
2046 let resp = configuration.client.execute(req).await?;
2047
2048 let status = resp.status();
2049 let content_type = resp
2050 .headers()
2051 .get("content-type")
2052 .and_then(|v| v.to_str().ok())
2053 .unwrap_or("application/octet-stream");
2054 let content_type = super::ContentType::from(content_type);
2055
2056 if !status.is_client_error() && !status.is_server_error() {
2057 let content = resp.text().await?;
2058 match content_type {
2059 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2060 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CommitWithPathRenameDetails>`"))),
2061 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CommitWithPathRenameDetails>`")))),
2062 }
2063 } else {
2064 let content = resp.text().await?;
2065 let entity: Option<GetCommitsError> = serde_json::from_str(&content).ok();
2066 Err(Error::ResponseError(ResponseContent {
2067 status,
2068 content,
2069 entity,
2070 }))
2071 }
2072}
2073
2074pub async fn get_content(
2075 configuration: &configuration::Configuration,
2076 repo_ref: &str,
2077 path: &str,
2078 git_ref: Option<&str>,
2079 include_commit: Option<bool>,
2080) -> Result<models::RepoContentOutput, Error<GetContentError>> {
2081 let p_path_repo_ref = repo_ref;
2083 let p_path_path = path;
2084 let p_query_git_ref = git_ref;
2085 let p_query_include_commit = include_commit;
2086
2087 let uri_str = format!(
2088 "{}/repos/{repo_ref}/+/content/{path}",
2089 configuration.base_path,
2090 repo_ref = crate::apis::urlencode(p_path_repo_ref),
2091 path = crate::apis::urlencode(p_path_path)
2092 );
2093 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2094
2095 if let Some(ref param_value) = p_query_git_ref {
2096 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
2097 }
2098 if let Some(ref param_value) = p_query_include_commit {
2099 req_builder = req_builder.query(&[("include_commit", ¶m_value.to_string())]);
2100 }
2101 if let Some(ref apikey) = configuration.api_key {
2102 let key = apikey.key.clone();
2103 let value = match apikey.prefix {
2104 Some(ref prefix) => format!("{} {}", prefix, key),
2105 None => key,
2106 };
2107 req_builder = req_builder.query(&[("access_token", value)]);
2108 }
2109 if let Some(ref user_agent) = configuration.user_agent {
2110 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2111 }
2112 if let Some(ref auth_conf) = configuration.basic_auth {
2113 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2114 };
2115 if let Some(ref token) = configuration.bearer_access_token {
2116 req_builder = req_builder.bearer_auth(token.to_owned());
2117 };
2118
2119 let req = req_builder.build()?;
2120 let resp = configuration.client.execute(req).await?;
2121
2122 let status = resp.status();
2123 let content_type = resp
2124 .headers()
2125 .get("content-type")
2126 .and_then(|v| v.to_str().ok())
2127 .unwrap_or("application/octet-stream");
2128 let content_type = super::ContentType::from(content_type);
2129
2130 if !status.is_client_error() && !status.is_server_error() {
2131 let content = resp.text().await?;
2132 match content_type {
2133 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2134 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoContentOutput`"))),
2135 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoContentOutput`")))),
2136 }
2137 } else {
2138 let content = resp.text().await?;
2139 let entity: Option<GetContentError> = serde_json::from_str(&content).ok();
2140 Err(Error::ResponseError(ResponseContent {
2141 status,
2142 content,
2143 entity,
2144 }))
2145 }
2146}
2147
2148pub async fn get_contributors(
2149 configuration: &configuration::Configuration,
2150 repo_ref: &str,
2151 git_ref: Option<&str>,
2152 since: Option<i64>,
2153 until: Option<i64>,
2154) -> Result<Vec<models::Contributor>, Error<GetContributorsError>> {
2155 let p_path_repo_ref = repo_ref;
2157 let p_query_git_ref = git_ref;
2158 let p_query_since = since;
2159 let p_query_until = until;
2160
2161 let uri_str = format!(
2162 "{}/repos/{repo_ref}/+/contributors",
2163 configuration.base_path,
2164 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2165 );
2166 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2167
2168 if let Some(ref param_value) = p_query_git_ref {
2169 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
2170 }
2171 if let Some(ref param_value) = p_query_since {
2172 req_builder = req_builder.query(&[("since", ¶m_value.to_string())]);
2173 }
2174 if let Some(ref param_value) = p_query_until {
2175 req_builder = req_builder.query(&[("until", ¶m_value.to_string())]);
2176 }
2177 if let Some(ref apikey) = configuration.api_key {
2178 let key = apikey.key.clone();
2179 let value = match apikey.prefix {
2180 Some(ref prefix) => format!("{} {}", prefix, key),
2181 None => key,
2182 };
2183 req_builder = req_builder.query(&[("access_token", value)]);
2184 }
2185 if let Some(ref user_agent) = configuration.user_agent {
2186 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2187 }
2188 if let Some(ref auth_conf) = configuration.basic_auth {
2189 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2190 };
2191 if let Some(ref token) = configuration.bearer_access_token {
2192 req_builder = req_builder.bearer_auth(token.to_owned());
2193 };
2194
2195 let req = req_builder.build()?;
2196 let resp = configuration.client.execute(req).await?;
2197
2198 let status = resp.status();
2199 let content_type = resp
2200 .headers()
2201 .get("content-type")
2202 .and_then(|v| v.to_str().ok())
2203 .unwrap_or("application/octet-stream");
2204 let content_type = super::ContentType::from(content_type);
2205
2206 if !status.is_client_error() && !status.is_server_error() {
2207 let content = resp.text().await?;
2208 match content_type {
2209 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2210 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Contributor>`"))),
2211 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Contributor>`")))),
2212 }
2213 } else {
2214 let content = resp.text().await?;
2215 let entity: Option<GetContributorsError> = serde_json::from_str(&content).ok();
2216 Err(Error::ResponseError(ResponseContent {
2217 status,
2218 content,
2219 entity,
2220 }))
2221 }
2222}
2223
2224pub async fn get_diff_stats(
2225 configuration: &configuration::Configuration,
2226 repo_ref: &str,
2227 path: &str,
2228) -> Result<models::DiffStats, Error<GetDiffStatsError>> {
2229 let p_path_repo_ref = repo_ref;
2231 let p_path_path = path;
2232
2233 let uri_str = format!(
2234 "{}/repos/{repo_ref}/+/diff-stats/{path}",
2235 configuration.base_path,
2236 repo_ref = crate::apis::urlencode(p_path_repo_ref),
2237 path = crate::apis::urlencode(p_path_path)
2238 );
2239 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2240
2241 if let Some(ref apikey) = configuration.api_key {
2242 let key = apikey.key.clone();
2243 let value = match apikey.prefix {
2244 Some(ref prefix) => format!("{} {}", prefix, key),
2245 None => key,
2246 };
2247 req_builder = req_builder.query(&[("access_token", value)]);
2248 }
2249 if let Some(ref user_agent) = configuration.user_agent {
2250 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2251 }
2252 if let Some(ref auth_conf) = configuration.basic_auth {
2253 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2254 };
2255 if let Some(ref token) = configuration.bearer_access_token {
2256 req_builder = req_builder.bearer_auth(token.to_owned());
2257 };
2258
2259 let req = req_builder.build()?;
2260 let resp = configuration.client.execute(req).await?;
2261
2262 let status = resp.status();
2263 let content_type = resp
2264 .headers()
2265 .get("content-type")
2266 .and_then(|v| v.to_str().ok())
2267 .unwrap_or("application/octet-stream");
2268 let content_type = super::ContentType::from(content_type);
2269
2270 if !status.is_client_error() && !status.is_server_error() {
2271 let content = resp.text().await?;
2272 match content_type {
2273 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2274 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DiffStats`"))),
2275 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DiffStats`")))),
2276 }
2277 } else {
2278 let content = resp.text().await?;
2279 let entity: Option<GetDiffStatsError> = serde_json::from_str(&content).ok();
2280 Err(Error::ResponseError(ResponseContent {
2281 status,
2282 content,
2283 entity,
2284 }))
2285 }
2286}
2287
2288pub async fn get_diffs(
2289 configuration: &configuration::Configuration,
2290 repo_ref: &str,
2291 path: &str,
2292) -> Result<String, Error<GetDiffsError>> {
2293 let p_path_repo_ref = repo_ref;
2295 let p_path_path = path;
2296
2297 let uri_str = format!(
2298 "{}/repos/{repo_ref}/+/diff/{path}",
2299 configuration.base_path,
2300 repo_ref = crate::apis::urlencode(p_path_repo_ref),
2301 path = crate::apis::urlencode(p_path_path)
2302 );
2303 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2304
2305 if let Some(ref apikey) = configuration.api_key {
2306 let key = apikey.key.clone();
2307 let value = match apikey.prefix {
2308 Some(ref prefix) => format!("{} {}", prefix, key),
2309 None => key,
2310 };
2311 req_builder = req_builder.query(&[("access_token", value)]);
2312 }
2313 if let Some(ref user_agent) = configuration.user_agent {
2314 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2315 }
2316 if let Some(ref auth_conf) = configuration.basic_auth {
2317 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2318 };
2319 if let Some(ref token) = configuration.bearer_access_token {
2320 req_builder = req_builder.bearer_auth(token.to_owned());
2321 };
2322
2323 let req = req_builder.build()?;
2324 let resp = configuration.client.execute(req).await?;
2325
2326 let status = resp.status();
2327 let content_type = resp
2328 .headers()
2329 .get("content-type")
2330 .and_then(|v| v.to_str().ok())
2331 .unwrap_or("application/octet-stream");
2332 let content_type = super::ContentType::from(content_type);
2333
2334 if !status.is_client_error() && !status.is_server_error() {
2335 let content = resp.text().await?;
2336 match content_type {
2337 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2338 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))),
2339 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))),
2340 }
2341 } else {
2342 let content = resp.text().await?;
2343 let entity: Option<GetDiffsError> = serde_json::from_str(&content).ok();
2344 Err(Error::ResponseError(ResponseContent {
2345 status,
2346 content,
2347 entity,
2348 }))
2349 }
2350}
2351
2352pub async fn get_forks(
2353 configuration: &configuration::Configuration,
2354 repo_ref: &str,
2355 page: Option<i64>,
2356 size: Option<i64>,
2357 query: Option<&str>,
2358 sort: Option<models::RepoSort>,
2359 order: Option<models::OrderOption>,
2360) -> Result<Vec<models::RepositoryModel>, Error<GetForksError>> {
2361 let p_path_repo_ref = repo_ref;
2363 let p_query_page = page;
2364 let p_query_size = size;
2365 let p_query_query = query;
2366 let p_query_sort = sort;
2367 let p_query_order = order;
2368
2369 let uri_str = format!(
2370 "{}/repos/{repo_ref}/+/forks",
2371 configuration.base_path,
2372 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2373 );
2374 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2375
2376 if let Some(ref param_value) = p_query_page {
2377 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2378 }
2379 if let Some(ref param_value) = p_query_size {
2380 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
2381 }
2382 if let Some(ref param_value) = p_query_query {
2383 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
2384 }
2385 if let Some(ref param_value) = p_query_sort {
2386 req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]);
2387 }
2388 if let Some(ref param_value) = p_query_order {
2389 req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
2390 }
2391 if let Some(ref apikey) = configuration.api_key {
2392 let key = apikey.key.clone();
2393 let value = match apikey.prefix {
2394 Some(ref prefix) => format!("{} {}", prefix, key),
2395 None => key,
2396 };
2397 req_builder = req_builder.query(&[("access_token", value)]);
2398 }
2399 if let Some(ref user_agent) = configuration.user_agent {
2400 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2401 }
2402 if let Some(ref auth_conf) = configuration.basic_auth {
2403 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2404 };
2405 if let Some(ref token) = configuration.bearer_access_token {
2406 req_builder = req_builder.bearer_auth(token.to_owned());
2407 };
2408
2409 let req = req_builder.build()?;
2410 let resp = configuration.client.execute(req).await?;
2411
2412 let status = resp.status();
2413 let content_type = resp
2414 .headers()
2415 .get("content-type")
2416 .and_then(|v| v.to_str().ok())
2417 .unwrap_or("application/octet-stream");
2418 let content_type = super::ContentType::from(content_type);
2419
2420 if !status.is_client_error() && !status.is_server_error() {
2421 let content = resp.text().await?;
2422 match content_type {
2423 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2424 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::RepositoryModel>`"))),
2425 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::RepositoryModel>`")))),
2426 }
2427 } else {
2428 let content = resp.text().await?;
2429 let entity: Option<GetForksError> = serde_json::from_str(&content).ok();
2430 Err(Error::ResponseError(ResponseContent {
2431 status,
2432 content,
2433 entity,
2434 }))
2435 }
2436}
2437
2438pub async fn get_general(
2439 configuration: &configuration::Configuration,
2440 repo_ref: &str,
2441) -> Result<models::GeneralSettings, Error<GetGeneralError>> {
2442 let p_path_repo_ref = repo_ref;
2444
2445 let uri_str = format!(
2446 "{}/repos/{repo_ref}/+/settings/general",
2447 configuration.base_path,
2448 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2449 );
2450 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2451
2452 if let Some(ref apikey) = configuration.api_key {
2453 let key = apikey.key.clone();
2454 let value = match apikey.prefix {
2455 Some(ref prefix) => format!("{} {}", prefix, key),
2456 None => key,
2457 };
2458 req_builder = req_builder.query(&[("access_token", value)]);
2459 }
2460 if let Some(ref user_agent) = configuration.user_agent {
2461 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2462 }
2463 if let Some(ref auth_conf) = configuration.basic_auth {
2464 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2465 };
2466 if let Some(ref token) = configuration.bearer_access_token {
2467 req_builder = req_builder.bearer_auth(token.to_owned());
2468 };
2469
2470 let req = req_builder.build()?;
2471 let resp = configuration.client.execute(req).await?;
2472
2473 let status = resp.status();
2474 let content_type = resp
2475 .headers()
2476 .get("content-type")
2477 .and_then(|v| v.to_str().ok())
2478 .unwrap_or("application/octet-stream");
2479 let content_type = super::ContentType::from(content_type);
2480
2481 if !status.is_client_error() && !status.is_server_error() {
2482 let content = resp.text().await?;
2483 match content_type {
2484 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2485 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralSettings`"))),
2486 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeneralSettings`")))),
2487 }
2488 } else {
2489 let content = resp.text().await?;
2490 let entity: Option<GetGeneralError> = serde_json::from_str(&content).ok();
2491 Err(Error::ResponseError(ResponseContent {
2492 status,
2493 content,
2494 entity,
2495 }))
2496 }
2497}
2498
2499pub async fn get_has_starred(
2500 configuration: &configuration::Configuration,
2501 repo_ref: &str,
2502) -> Result<models::RepositoryStarModel, Error<GetHasStarredError>> {
2503 let p_path_repo_ref = repo_ref;
2505
2506 let uri_str = format!(
2507 "{}/repos/{repo_ref}/+/stars/has_starred",
2508 configuration.base_path,
2509 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2510 );
2511 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2512
2513 if let Some(ref apikey) = configuration.api_key {
2514 let key = apikey.key.clone();
2515 let value = match apikey.prefix {
2516 Some(ref prefix) => format!("{} {}", prefix, key),
2517 None => key,
2518 };
2519 req_builder = req_builder.query(&[("access_token", value)]);
2520 }
2521 if let Some(ref user_agent) = configuration.user_agent {
2522 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2523 }
2524 if let Some(ref auth_conf) = configuration.basic_auth {
2525 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2526 };
2527 if let Some(ref token) = configuration.bearer_access_token {
2528 req_builder = req_builder.bearer_auth(token.to_owned());
2529 };
2530
2531 let req = req_builder.build()?;
2532 let resp = configuration.client.execute(req).await?;
2533
2534 let status = resp.status();
2535 let content_type = resp
2536 .headers()
2537 .get("content-type")
2538 .and_then(|v| v.to_str().ok())
2539 .unwrap_or("application/octet-stream");
2540 let content_type = super::ContentType::from(content_type);
2541
2542 if !status.is_client_error() && !status.is_server_error() {
2543 let content = resp.text().await?;
2544 match content_type {
2545 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2546 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryStarModel`"))),
2547 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryStarModel`")))),
2548 }
2549 } else {
2550 let content = resp.text().await?;
2551 let entity: Option<GetHasStarredError> = serde_json::from_str(&content).ok();
2552 Err(Error::ResponseError(ResponseContent {
2553 status,
2554 content,
2555 entity,
2556 }))
2557 }
2558}
2559
2560pub async fn get_import_progress(
2561 configuration: &configuration::Configuration,
2562 repo_ref: &str,
2563) -> Result<models::JobProgress, Error<GetImportProgressError>> {
2564 let p_path_repo_ref = repo_ref;
2566
2567 let uri_str = format!(
2568 "{}/repos/{repo_ref}/+/import-progress",
2569 configuration.base_path,
2570 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2571 );
2572 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2573
2574 if let Some(ref apikey) = configuration.api_key {
2575 let key = apikey.key.clone();
2576 let value = match apikey.prefix {
2577 Some(ref prefix) => format!("{} {}", prefix, key),
2578 None => key,
2579 };
2580 req_builder = req_builder.query(&[("access_token", value)]);
2581 }
2582 if let Some(ref user_agent) = configuration.user_agent {
2583 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2584 }
2585 if let Some(ref auth_conf) = configuration.basic_auth {
2586 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2587 };
2588 if let Some(ref token) = configuration.bearer_access_token {
2589 req_builder = req_builder.bearer_auth(token.to_owned());
2590 };
2591
2592 let req = req_builder.build()?;
2593 let resp = configuration.client.execute(req).await?;
2594
2595 let status = resp.status();
2596 let content_type = resp
2597 .headers()
2598 .get("content-type")
2599 .and_then(|v| v.to_str().ok())
2600 .unwrap_or("application/octet-stream");
2601 let content_type = super::ContentType::from(content_type);
2602
2603 if !status.is_client_error() && !status.is_server_error() {
2604 let content = resp.text().await?;
2605 match content_type {
2606 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2607 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JobProgress`"))),
2608 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::JobProgress`")))),
2609 }
2610 } else {
2611 let content = resp.text().await?;
2612 let entity: Option<GetImportProgressError> = serde_json::from_str(&content).ok();
2613 Err(Error::ResponseError(ResponseContent {
2614 status,
2615 content,
2616 entity,
2617 }))
2618 }
2619}
2620
2621pub async fn get_paths(
2622 configuration: &configuration::Configuration,
2623 repo_ref: &str,
2624 git_ref: Option<&str>,
2625 include_directories: Option<bool>,
2626) -> Result<models::RepoPathsOutput, Error<GetPathsError>> {
2627 let p_path_repo_ref = repo_ref;
2629 let p_query_git_ref = git_ref;
2630 let p_query_include_directories = include_directories;
2631
2632 let uri_str = format!(
2633 "{}/repos/{repo_ref}/+/paths",
2634 configuration.base_path,
2635 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2636 );
2637 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2638
2639 if let Some(ref param_value) = p_query_git_ref {
2640 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
2641 }
2642 if let Some(ref param_value) = p_query_include_directories {
2643 req_builder = req_builder.query(&[("include_directories", ¶m_value.to_string())]);
2644 }
2645 if let Some(ref apikey) = configuration.api_key {
2646 let key = apikey.key.clone();
2647 let value = match apikey.prefix {
2648 Some(ref prefix) => format!("{} {}", prefix, key),
2649 None => key,
2650 };
2651 req_builder = req_builder.query(&[("access_token", value)]);
2652 }
2653 if let Some(ref user_agent) = configuration.user_agent {
2654 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2655 }
2656 if let Some(ref auth_conf) = configuration.basic_auth {
2657 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2658 };
2659 if let Some(ref token) = configuration.bearer_access_token {
2660 req_builder = req_builder.bearer_auth(token.to_owned());
2661 };
2662
2663 let req = req_builder.build()?;
2664 let resp = configuration.client.execute(req).await?;
2665
2666 let status = resp.status();
2667 let content_type = resp
2668 .headers()
2669 .get("content-type")
2670 .and_then(|v| v.to_str().ok())
2671 .unwrap_or("application/octet-stream");
2672 let content_type = super::ContentType::from(content_type);
2673
2674 if !status.is_client_error() && !status.is_server_error() {
2675 let content = resp.text().await?;
2676 match content_type {
2677 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2678 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoPathsOutput`"))),
2679 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoPathsOutput`")))),
2680 }
2681 } else {
2682 let content = resp.text().await?;
2683 let entity: Option<GetPathsError> = serde_json::from_str(&content).ok();
2684 Err(Error::ResponseError(ResponseContent {
2685 status,
2686 content,
2687 entity,
2688 }))
2689 }
2690}
2691
2692pub async fn get_raw(
2693 configuration: &configuration::Configuration,
2694 repo_ref: &str,
2695 path: &str,
2696 git_ref: Option<&str>,
2697) -> Result<Vec<i32>, Error<GetRawError>> {
2698 let p_path_repo_ref = repo_ref;
2700 let p_path_path = path;
2701 let p_query_git_ref = git_ref;
2702
2703 let uri_str = format!(
2704 "{}/repos/{repo_ref}/+/raw/{path}",
2705 configuration.base_path,
2706 repo_ref = crate::apis::urlencode(p_path_repo_ref),
2707 path = crate::apis::urlencode(p_path_path)
2708 );
2709 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2710
2711 if let Some(ref param_value) = p_query_git_ref {
2712 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
2713 }
2714 if let Some(ref apikey) = configuration.api_key {
2715 let key = apikey.key.clone();
2716 let value = match apikey.prefix {
2717 Some(ref prefix) => format!("{} {}", prefix, key),
2718 None => key,
2719 };
2720 req_builder = req_builder.query(&[("access_token", value)]);
2721 }
2722 if let Some(ref user_agent) = configuration.user_agent {
2723 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2724 }
2725 if let Some(ref auth_conf) = configuration.basic_auth {
2726 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2727 };
2728 if let Some(ref token) = configuration.bearer_access_token {
2729 req_builder = req_builder.bearer_auth(token.to_owned());
2730 };
2731
2732 let req = req_builder.build()?;
2733 let resp = configuration.client.execute(req).await?;
2734
2735 let status = resp.status();
2736 let content_type = resp
2737 .headers()
2738 .get("content-type")
2739 .and_then(|v| v.to_str().ok())
2740 .unwrap_or("application/octet-stream");
2741 let content_type = super::ContentType::from(content_type);
2742
2743 if !status.is_client_error() && !status.is_server_error() {
2744 let content = resp.text().await?;
2745 match content_type {
2746 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2747 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<i32>`"))),
2748 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<i32>`")))),
2749 }
2750 } else {
2751 let content = resp.text().await?;
2752 let entity: Option<GetRawError> = serde_json::from_str(&content).ok();
2753 Err(Error::ResponseError(ResponseContent {
2754 status,
2755 content,
2756 entity,
2757 }))
2758 }
2759}
2760
2761pub async fn get_release(
2762 configuration: &configuration::Configuration,
2763 repo_ref: &str,
2764 tag_ref: &str,
2765) -> Result<models::ReleaseCreator, Error<GetReleaseError>> {
2766 let p_path_repo_ref = repo_ref;
2768 let p_path_tag_ref = tag_ref;
2769
2770 let uri_str = format!(
2771 "{}/repos/{repo_ref}/+/releases/{tag_ref}",
2772 configuration.base_path,
2773 repo_ref = crate::apis::urlencode(p_path_repo_ref),
2774 tag_ref = crate::apis::urlencode(p_path_tag_ref)
2775 );
2776 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2777
2778 if let Some(ref apikey) = configuration.api_key {
2779 let key = apikey.key.clone();
2780 let value = match apikey.prefix {
2781 Some(ref prefix) => format!("{} {}", prefix, key),
2782 None => key,
2783 };
2784 req_builder = req_builder.query(&[("access_token", value)]);
2785 }
2786 if let Some(ref user_agent) = configuration.user_agent {
2787 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2788 }
2789 if let Some(ref auth_conf) = configuration.basic_auth {
2790 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2791 };
2792 if let Some(ref token) = configuration.bearer_access_token {
2793 req_builder = req_builder.bearer_auth(token.to_owned());
2794 };
2795
2796 let req = req_builder.build()?;
2797 let resp = configuration.client.execute(req).await?;
2798
2799 let status = resp.status();
2800 let content_type = resp
2801 .headers()
2802 .get("content-type")
2803 .and_then(|v| v.to_str().ok())
2804 .unwrap_or("application/octet-stream");
2805 let content_type = super::ContentType::from(content_type);
2806
2807 if !status.is_client_error() && !status.is_server_error() {
2808 let content = resp.text().await?;
2809 match content_type {
2810 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2811 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReleaseCreator`"))),
2812 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ReleaseCreator`")))),
2813 }
2814 } else {
2815 let content = resp.text().await?;
2816 let entity: Option<GetReleaseError> = serde_json::from_str(&content).ok();
2817 Err(Error::ResponseError(ResponseContent {
2818 status,
2819 content,
2820 entity,
2821 }))
2822 }
2823}
2824
2825pub async fn get_releases(
2826 configuration: &configuration::Configuration,
2827 repo_ref: &str,
2828 page: Option<i64>,
2829 size: Option<i64>,
2830 query: Option<&str>,
2831 sort: Option<models::ReleaseSort>,
2832 order: Option<models::OrderOption>,
2833) -> Result<Vec<models::ReleaseCreator>, Error<GetReleasesError>> {
2834 let p_path_repo_ref = repo_ref;
2836 let p_query_page = page;
2837 let p_query_size = size;
2838 let p_query_query = query;
2839 let p_query_sort = sort;
2840 let p_query_order = order;
2841
2842 let uri_str = format!(
2843 "{}/repos/{repo_ref}/+/releases",
2844 configuration.base_path,
2845 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2846 );
2847 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2848
2849 if let Some(ref param_value) = p_query_page {
2850 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2851 }
2852 if let Some(ref param_value) = p_query_size {
2853 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
2854 }
2855 if let Some(ref param_value) = p_query_query {
2856 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
2857 }
2858 if let Some(ref param_value) = p_query_sort {
2859 req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]);
2860 }
2861 if let Some(ref param_value) = p_query_order {
2862 req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
2863 }
2864 if let Some(ref apikey) = configuration.api_key {
2865 let key = apikey.key.clone();
2866 let value = match apikey.prefix {
2867 Some(ref prefix) => format!("{} {}", prefix, key),
2868 None => key,
2869 };
2870 req_builder = req_builder.query(&[("access_token", value)]);
2871 }
2872 if let Some(ref user_agent) = configuration.user_agent {
2873 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2874 }
2875 if let Some(ref auth_conf) = configuration.basic_auth {
2876 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2877 };
2878 if let Some(ref token) = configuration.bearer_access_token {
2879 req_builder = req_builder.bearer_auth(token.to_owned());
2880 };
2881
2882 let req = req_builder.build()?;
2883 let resp = configuration.client.execute(req).await?;
2884
2885 let status = resp.status();
2886 let content_type = resp
2887 .headers()
2888 .get("content-type")
2889 .and_then(|v| v.to_str().ok())
2890 .unwrap_or("application/octet-stream");
2891 let content_type = super::ContentType::from(content_type);
2892
2893 if !status.is_client_error() && !status.is_server_error() {
2894 let content = resp.text().await?;
2895 match content_type {
2896 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2897 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ReleaseCreator>`"))),
2898 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ReleaseCreator>`")))),
2899 }
2900 } else {
2901 let content = resp.text().await?;
2902 let entity: Option<GetReleasesError> = serde_json::from_str(&content).ok();
2903 Err(Error::ResponseError(ResponseContent {
2904 status,
2905 content,
2906 entity,
2907 }))
2908 }
2909}
2910
2911pub async fn get_repo(
2912 configuration: &configuration::Configuration,
2913 repo_ref: &str,
2914) -> Result<models::RepoParent, Error<GetRepoError>> {
2915 let p_path_repo_ref = repo_ref;
2917
2918 let uri_str = format!(
2919 "{}/repos/{repo_ref}/+",
2920 configuration.base_path,
2921 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2922 );
2923 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2924
2925 if let Some(ref apikey) = configuration.api_key {
2926 let key = apikey.key.clone();
2927 let value = match apikey.prefix {
2928 Some(ref prefix) => format!("{} {}", prefix, key),
2929 None => key,
2930 };
2931 req_builder = req_builder.query(&[("access_token", value)]);
2932 }
2933 if let Some(ref user_agent) = configuration.user_agent {
2934 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2935 }
2936 if let Some(ref auth_conf) = configuration.basic_auth {
2937 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2938 };
2939 if let Some(ref token) = configuration.bearer_access_token {
2940 req_builder = req_builder.bearer_auth(token.to_owned());
2941 };
2942
2943 let req = req_builder.build()?;
2944 let resp = configuration.client.execute(req).await?;
2945
2946 let status = resp.status();
2947 let content_type = resp
2948 .headers()
2949 .get("content-type")
2950 .and_then(|v| v.to_str().ok())
2951 .unwrap_or("application/octet-stream");
2952 let content_type = super::ContentType::from(content_type);
2953
2954 if !status.is_client_error() && !status.is_server_error() {
2955 let content = resp.text().await?;
2956 match content_type {
2957 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2958 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoParent`"))),
2959 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoParent`")))),
2960 }
2961 } else {
2962 let content = resp.text().await?;
2963 let entity: Option<GetRepoError> = serde_json::from_str(&content).ok();
2964 Err(Error::ResponseError(ResponseContent {
2965 status,
2966 content,
2967 entity,
2968 }))
2969 }
2970}
2971
2972pub async fn get_repository_reseted_runner_register_token(
2973 configuration: &configuration::Configuration,
2974 repo_ref: &str,
2975) -> Result<models::RegisterTokenModel, Error<GetRepositoryResetedRunnerRegisterTokenError>> {
2976 let p_path_repo_ref = repo_ref;
2978
2979 let uri_str = format!(
2980 "{}/repos/{repo_ref}/+/runners/register_token/reseted",
2981 configuration.base_path,
2982 repo_ref = crate::apis::urlencode(p_path_repo_ref)
2983 );
2984 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2985
2986 if let Some(ref apikey) = configuration.api_key {
2987 let key = apikey.key.clone();
2988 let value = match apikey.prefix {
2989 Some(ref prefix) => format!("{} {}", prefix, key),
2990 None => key,
2991 };
2992 req_builder = req_builder.query(&[("access_token", value)]);
2993 }
2994 if let Some(ref user_agent) = configuration.user_agent {
2995 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2996 }
2997 if let Some(ref auth_conf) = configuration.basic_auth {
2998 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2999 };
3000 if let Some(ref token) = configuration.bearer_access_token {
3001 req_builder = req_builder.bearer_auth(token.to_owned());
3002 };
3003
3004 let req = req_builder.build()?;
3005 let resp = configuration.client.execute(req).await?;
3006
3007 let status = resp.status();
3008 let content_type = resp
3009 .headers()
3010 .get("content-type")
3011 .and_then(|v| v.to_str().ok())
3012 .unwrap_or("application/octet-stream");
3013 let content_type = super::ContentType::from(content_type);
3014
3015 if !status.is_client_error() && !status.is_server_error() {
3016 let content = resp.text().await?;
3017 match content_type {
3018 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3019 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterTokenModel`"))),
3020 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegisterTokenModel`")))),
3021 }
3022 } else {
3023 let content = resp.text().await?;
3024 let entity: Option<GetRepositoryResetedRunnerRegisterTokenError> =
3025 serde_json::from_str(&content).ok();
3026 Err(Error::ResponseError(ResponseContent {
3027 status,
3028 content,
3029 entity,
3030 }))
3031 }
3032}
3033
3034pub async fn get_repository_runner(
3035 configuration: &configuration::Configuration,
3036 repo_ref: &str,
3037 runner_uuid: &str,
3038) -> Result<models::RunnerModel, Error<GetRepositoryRunnerError>> {
3039 let p_path_repo_ref = repo_ref;
3041 let p_path_runner_uuid = runner_uuid;
3042
3043 let uri_str = format!(
3044 "{}/repos/{repo_ref}/+/runners/{runner_uuid}",
3045 configuration.base_path,
3046 repo_ref = crate::apis::urlencode(p_path_repo_ref),
3047 runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
3048 );
3049 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3050
3051 if let Some(ref apikey) = configuration.api_key {
3052 let key = apikey.key.clone();
3053 let value = match apikey.prefix {
3054 Some(ref prefix) => format!("{} {}", prefix, key),
3055 None => key,
3056 };
3057 req_builder = req_builder.query(&[("access_token", value)]);
3058 }
3059 if let Some(ref user_agent) = configuration.user_agent {
3060 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3061 }
3062 if let Some(ref auth_conf) = configuration.basic_auth {
3063 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3064 };
3065 if let Some(ref token) = configuration.bearer_access_token {
3066 req_builder = req_builder.bearer_auth(token.to_owned());
3067 };
3068
3069 let req = req_builder.build()?;
3070 let resp = configuration.client.execute(req).await?;
3071
3072 let status = resp.status();
3073 let content_type = resp
3074 .headers()
3075 .get("content-type")
3076 .and_then(|v| v.to_str().ok())
3077 .unwrap_or("application/octet-stream");
3078 let content_type = super::ContentType::from(content_type);
3079
3080 if !status.is_client_error() && !status.is_server_error() {
3081 let content = resp.text().await?;
3082 match content_type {
3083 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3084 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerModel`"))),
3085 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnerModel`")))),
3086 }
3087 } else {
3088 let content = resp.text().await?;
3089 let entity: Option<GetRepositoryRunnerError> = serde_json::from_str(&content).ok();
3090 Err(Error::ResponseError(ResponseContent {
3091 status,
3092 content,
3093 entity,
3094 }))
3095 }
3096}
3097
3098pub async fn get_repository_runner_register_token(
3099 configuration: &configuration::Configuration,
3100 repo_ref: &str,
3101) -> Result<models::RegisterTokenModel, Error<GetRepositoryRunnerRegisterTokenError>> {
3102 let p_path_repo_ref = repo_ref;
3104
3105 let uri_str = format!(
3106 "{}/repos/{repo_ref}/+/runners/register_token",
3107 configuration.base_path,
3108 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3109 );
3110 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3111
3112 if let Some(ref apikey) = configuration.api_key {
3113 let key = apikey.key.clone();
3114 let value = match apikey.prefix {
3115 Some(ref prefix) => format!("{} {}", prefix, key),
3116 None => key,
3117 };
3118 req_builder = req_builder.query(&[("access_token", value)]);
3119 }
3120 if let Some(ref user_agent) = configuration.user_agent {
3121 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3122 }
3123 if let Some(ref auth_conf) = configuration.basic_auth {
3124 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3125 };
3126 if let Some(ref token) = configuration.bearer_access_token {
3127 req_builder = req_builder.bearer_auth(token.to_owned());
3128 };
3129
3130 let req = req_builder.build()?;
3131 let resp = configuration.client.execute(req).await?;
3132
3133 let status = resp.status();
3134 let content_type = resp
3135 .headers()
3136 .get("content-type")
3137 .and_then(|v| v.to_str().ok())
3138 .unwrap_or("application/octet-stream");
3139 let content_type = super::ContentType::from(content_type);
3140
3141 if !status.is_client_error() && !status.is_server_error() {
3142 let content = resp.text().await?;
3143 match content_type {
3144 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3145 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterTokenModel`"))),
3146 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegisterTokenModel`")))),
3147 }
3148 } else {
3149 let content = resp.text().await?;
3150 let entity: Option<GetRepositoryRunnerRegisterTokenError> =
3151 serde_json::from_str(&content).ok();
3152 Err(Error::ResponseError(ResponseContent {
3153 status,
3154 content,
3155 entity,
3156 }))
3157 }
3158}
3159
3160pub async fn get_repository_runners(
3161 configuration: &configuration::Configuration,
3162 repo_ref: &str,
3163 page: Option<i64>,
3164 size: Option<i64>,
3165 query: Option<&str>,
3166) -> Result<Vec<models::RunnerCreator>, Error<GetRepositoryRunnersError>> {
3167 let p_path_repo_ref = repo_ref;
3169 let p_query_page = page;
3170 let p_query_size = size;
3171 let p_query_query = query;
3172
3173 let uri_str = format!(
3174 "{}/repos/{repo_ref}/+/runners",
3175 configuration.base_path,
3176 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3177 );
3178 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3179
3180 if let Some(ref param_value) = p_query_page {
3181 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3182 }
3183 if let Some(ref param_value) = p_query_size {
3184 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
3185 }
3186 if let Some(ref param_value) = p_query_query {
3187 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
3188 }
3189 if let Some(ref apikey) = configuration.api_key {
3190 let key = apikey.key.clone();
3191 let value = match apikey.prefix {
3192 Some(ref prefix) => format!("{} {}", prefix, key),
3193 None => key,
3194 };
3195 req_builder = req_builder.query(&[("access_token", value)]);
3196 }
3197 if let Some(ref user_agent) = configuration.user_agent {
3198 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3199 }
3200 if let Some(ref auth_conf) = configuration.basic_auth {
3201 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3202 };
3203 if let Some(ref token) = configuration.bearer_access_token {
3204 req_builder = req_builder.bearer_auth(token.to_owned());
3205 };
3206
3207 let req = req_builder.build()?;
3208 let resp = configuration.client.execute(req).await?;
3209
3210 let status = resp.status();
3211 let content_type = resp
3212 .headers()
3213 .get("content-type")
3214 .and_then(|v| v.to_str().ok())
3215 .unwrap_or("application/octet-stream");
3216 let content_type = super::ContentType::from(content_type);
3217
3218 if !status.is_client_error() && !status.is_server_error() {
3219 let content = resp.text().await?;
3220 match content_type {
3221 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3222 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::RunnerCreator>`"))),
3223 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::RunnerCreator>`")))),
3224 }
3225 } else {
3226 let content = resp.text().await?;
3227 let entity: Option<GetRepositoryRunnersError> = serde_json::from_str(&content).ok();
3228 Err(Error::ResponseError(ResponseContent {
3229 status,
3230 content,
3231 entity,
3232 }))
3233 }
3234}
3235
3236pub async fn get_repository_service_accounts(
3237 configuration: &configuration::Configuration,
3238 repo_ref: &str,
3239) -> Result<Vec<models::UserModel>, Error<GetRepositoryServiceAccountsError>> {
3240 let p_path_repo_ref = repo_ref;
3242
3243 let uri_str = format!(
3244 "{}/repos/{repo_ref}/+/service-accounts",
3245 configuration.base_path,
3246 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3247 );
3248 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3249
3250 if let Some(ref apikey) = configuration.api_key {
3251 let key = apikey.key.clone();
3252 let value = match apikey.prefix {
3253 Some(ref prefix) => format!("{} {}", prefix, key),
3254 None => key,
3255 };
3256 req_builder = req_builder.query(&[("access_token", value)]);
3257 }
3258 if let Some(ref user_agent) = configuration.user_agent {
3259 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3260 }
3261 if let Some(ref auth_conf) = configuration.basic_auth {
3262 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3263 };
3264 if let Some(ref token) = configuration.bearer_access_token {
3265 req_builder = req_builder.bearer_auth(token.to_owned());
3266 };
3267
3268 let req = req_builder.build()?;
3269 let resp = configuration.client.execute(req).await?;
3270
3271 let status = resp.status();
3272 let content_type = resp
3273 .headers()
3274 .get("content-type")
3275 .and_then(|v| v.to_str().ok())
3276 .unwrap_or("application/octet-stream");
3277 let content_type = super::ContentType::from(content_type);
3278
3279 if !status.is_client_error() && !status.is_server_error() {
3280 let content = resp.text().await?;
3281 match content_type {
3282 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3283 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserModel>`"))),
3284 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UserModel>`")))),
3285 }
3286 } else {
3287 let content = resp.text().await?;
3288 let entity: Option<GetRepositoryServiceAccountsError> = serde_json::from_str(&content).ok();
3289 Err(Error::ResponseError(ResponseContent {
3290 status,
3291 content,
3292 entity,
3293 }))
3294 }
3295}
3296
3297pub async fn get_repository_stats(
3298 configuration: &configuration::Configuration,
3299 repo_ref: &str,
3300) -> Result<models::RepoStatsOutput, Error<GetRepositoryStatsError>> {
3301 let p_path_repo_ref = repo_ref;
3303
3304 let uri_str = format!(
3305 "{}/repos/{repo_ref}/+/stats",
3306 configuration.base_path,
3307 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3308 );
3309 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3310
3311 if let Some(ref apikey) = configuration.api_key {
3312 let key = apikey.key.clone();
3313 let value = match apikey.prefix {
3314 Some(ref prefix) => format!("{} {}", prefix, key),
3315 None => key,
3316 };
3317 req_builder = req_builder.query(&[("access_token", value)]);
3318 }
3319 if let Some(ref user_agent) = configuration.user_agent {
3320 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3321 }
3322 if let Some(ref auth_conf) = configuration.basic_auth {
3323 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3324 };
3325 if let Some(ref token) = configuration.bearer_access_token {
3326 req_builder = req_builder.bearer_auth(token.to_owned());
3327 };
3328
3329 let req = req_builder.build()?;
3330 let resp = configuration.client.execute(req).await?;
3331
3332 let status = resp.status();
3333 let content_type = resp
3334 .headers()
3335 .get("content-type")
3336 .and_then(|v| v.to_str().ok())
3337 .unwrap_or("application/octet-stream");
3338 let content_type = super::ContentType::from(content_type);
3339
3340 if !status.is_client_error() && !status.is_server_error() {
3341 let content = resp.text().await?;
3342 match content_type {
3343 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3344 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoStatsOutput`"))),
3345 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoStatsOutput`")))),
3346 }
3347 } else {
3348 let content = resp.text().await?;
3349 let entity: Option<GetRepositoryStatsError> = serde_json::from_str(&content).ok();
3350 Err(Error::ResponseError(ResponseContent {
3351 status,
3352 content,
3353 entity,
3354 }))
3355 }
3356}
3357
3358pub async fn get_repository_variable(
3359 configuration: &configuration::Configuration,
3360 repo_ref: &str,
3361 variable_identifier: &str,
3362) -> Result<models::VariableModel, Error<GetRepositoryVariableError>> {
3363 let p_path_repo_ref = repo_ref;
3365 let p_path_variable_identifier = variable_identifier;
3366
3367 let uri_str = format!(
3368 "{}/repos/{repo_ref}/+/variables/{variable_identifier}",
3369 configuration.base_path,
3370 repo_ref = crate::apis::urlencode(p_path_repo_ref),
3371 variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
3372 );
3373 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3374
3375 if let Some(ref apikey) = configuration.api_key {
3376 let key = apikey.key.clone();
3377 let value = match apikey.prefix {
3378 Some(ref prefix) => format!("{} {}", prefix, key),
3379 None => key,
3380 };
3381 req_builder = req_builder.query(&[("access_token", value)]);
3382 }
3383 if let Some(ref user_agent) = configuration.user_agent {
3384 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3385 }
3386 if let Some(ref auth_conf) = configuration.basic_auth {
3387 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3388 };
3389 if let Some(ref token) = configuration.bearer_access_token {
3390 req_builder = req_builder.bearer_auth(token.to_owned());
3391 };
3392
3393 let req = req_builder.build()?;
3394 let resp = configuration.client.execute(req).await?;
3395
3396 let status = resp.status();
3397 let content_type = resp
3398 .headers()
3399 .get("content-type")
3400 .and_then(|v| v.to_str().ok())
3401 .unwrap_or("application/octet-stream");
3402 let content_type = super::ContentType::from(content_type);
3403
3404 if !status.is_client_error() && !status.is_server_error() {
3405 let content = resp.text().await?;
3406 match content_type {
3407 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3408 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
3409 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VariableModel`")))),
3410 }
3411 } else {
3412 let content = resp.text().await?;
3413 let entity: Option<GetRepositoryVariableError> = serde_json::from_str(&content).ok();
3414 Err(Error::ResponseError(ResponseContent {
3415 status,
3416 content,
3417 entity,
3418 }))
3419 }
3420}
3421
3422pub async fn get_repository_variables(
3423 configuration: &configuration::Configuration,
3424 repo_ref: &str,
3425 page: Option<i64>,
3426 size: Option<i64>,
3427 query: Option<&str>,
3428 types: Option<Vec<models::VariableType>>,
3429 sort: Option<models::VariableSort>,
3430 order: Option<models::OrderOption>,
3431) -> Result<Vec<models::VariableGroup>, Error<GetRepositoryVariablesError>> {
3432 let p_path_repo_ref = repo_ref;
3434 let p_query_page = page;
3435 let p_query_size = size;
3436 let p_query_query = query;
3437 let p_query_types = types;
3438 let p_query_sort = sort;
3439 let p_query_order = order;
3440
3441 let uri_str = format!(
3442 "{}/repos/{repo_ref}/+/variables",
3443 configuration.base_path,
3444 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3445 );
3446 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3447
3448 if let Some(ref param_value) = p_query_page {
3449 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3450 }
3451 if let Some(ref param_value) = p_query_size {
3452 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
3453 }
3454 if let Some(ref param_value) = p_query_query {
3455 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
3456 }
3457 if let Some(ref param_value) = p_query_types {
3458 req_builder = match "multi" {
3459 "multi" => req_builder.query(
3460 ¶m_value
3461 .iter()
3462 .map(|p| ("types".to_owned(), p.to_string()))
3463 .collect::<Vec<(std::string::String, std::string::String)>>(),
3464 ),
3465 _ => req_builder.query(&[(
3466 "types",
3467 ¶m_value
3468 .iter()
3469 .map(|p| p.to_string())
3470 .collect::<Vec<String>>()
3471 .join(",")
3472 .to_string(),
3473 )]),
3474 };
3475 }
3476 if let Some(ref param_value) = p_query_sort {
3477 req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]);
3478 }
3479 if let Some(ref param_value) = p_query_order {
3480 req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
3481 }
3482 if let Some(ref apikey) = configuration.api_key {
3483 let key = apikey.key.clone();
3484 let value = match apikey.prefix {
3485 Some(ref prefix) => format!("{} {}", prefix, key),
3486 None => key,
3487 };
3488 req_builder = req_builder.query(&[("access_token", value)]);
3489 }
3490 if let Some(ref user_agent) = configuration.user_agent {
3491 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3492 }
3493 if let Some(ref auth_conf) = configuration.basic_auth {
3494 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3495 };
3496 if let Some(ref token) = configuration.bearer_access_token {
3497 req_builder = req_builder.bearer_auth(token.to_owned());
3498 };
3499
3500 let req = req_builder.build()?;
3501 let resp = configuration.client.execute(req).await?;
3502
3503 let status = resp.status();
3504 let content_type = resp
3505 .headers()
3506 .get("content-type")
3507 .and_then(|v| v.to_str().ok())
3508 .unwrap_or("application/octet-stream");
3509 let content_type = super::ContentType::from(content_type);
3510
3511 if !status.is_client_error() && !status.is_server_error() {
3512 let content = resp.text().await?;
3513 match content_type {
3514 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3515 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::VariableGroup>`"))),
3516 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::VariableGroup>`")))),
3517 }
3518 } else {
3519 let content = resp.text().await?;
3520 let entity: Option<GetRepositoryVariablesError> = serde_json::from_str(&content).ok();
3521 Err(Error::ResponseError(ResponseContent {
3522 status,
3523 content,
3524 entity,
3525 }))
3526 }
3527}
3528
3529pub async fn get_security(
3530 configuration: &configuration::Configuration,
3531 repo_ref: &str,
3532) -> Result<models::SecuritySettings, Error<GetSecurityError>> {
3533 let p_path_repo_ref = repo_ref;
3535
3536 let uri_str = format!(
3537 "{}/repos/{repo_ref}/+/settings/security",
3538 configuration.base_path,
3539 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3540 );
3541 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3542
3543 if let Some(ref apikey) = configuration.api_key {
3544 let key = apikey.key.clone();
3545 let value = match apikey.prefix {
3546 Some(ref prefix) => format!("{} {}", prefix, key),
3547 None => key,
3548 };
3549 req_builder = req_builder.query(&[("access_token", value)]);
3550 }
3551 if let Some(ref user_agent) = configuration.user_agent {
3552 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3553 }
3554 if let Some(ref auth_conf) = configuration.basic_auth {
3555 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3556 };
3557 if let Some(ref token) = configuration.bearer_access_token {
3558 req_builder = req_builder.bearer_auth(token.to_owned());
3559 };
3560
3561 let req = req_builder.build()?;
3562 let resp = configuration.client.execute(req).await?;
3563
3564 let status = resp.status();
3565 let content_type = resp
3566 .headers()
3567 .get("content-type")
3568 .and_then(|v| v.to_str().ok())
3569 .unwrap_or("application/octet-stream");
3570 let content_type = super::ContentType::from(content_type);
3571
3572 if !status.is_client_error() && !status.is_server_error() {
3573 let content = resp.text().await?;
3574 match content_type {
3575 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3576 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecuritySettings`"))),
3577 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecuritySettings`")))),
3578 }
3579 } else {
3580 let content = resp.text().await?;
3581 let entity: Option<GetSecurityError> = serde_json::from_str(&content).ok();
3582 Err(Error::ResponseError(ResponseContent {
3583 status,
3584 content,
3585 entity,
3586 }))
3587 }
3588}
3589
3590pub async fn get_stars(
3591 configuration: &configuration::Configuration,
3592 repo_ref: &str,
3593 page: Option<i64>,
3594 size: Option<i64>,
3595 query: Option<&str>,
3596 sort: Option<models::UserSort>,
3597 order: Option<models::OrderOption>,
3598) -> Result<Vec<models::UserModel>, Error<GetStarsError>> {
3599 let p_path_repo_ref = repo_ref;
3601 let p_query_page = page;
3602 let p_query_size = size;
3603 let p_query_query = query;
3604 let p_query_sort = sort;
3605 let p_query_order = order;
3606
3607 let uri_str = format!(
3608 "{}/repos/{repo_ref}/+/stars",
3609 configuration.base_path,
3610 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3611 );
3612 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3613
3614 if let Some(ref param_value) = p_query_page {
3615 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3616 }
3617 if let Some(ref param_value) = p_query_size {
3618 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
3619 }
3620 if let Some(ref param_value) = p_query_query {
3621 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
3622 }
3623 if let Some(ref param_value) = p_query_sort {
3624 req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]);
3625 }
3626 if let Some(ref param_value) = p_query_order {
3627 req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
3628 }
3629 if let Some(ref apikey) = configuration.api_key {
3630 let key = apikey.key.clone();
3631 let value = match apikey.prefix {
3632 Some(ref prefix) => format!("{} {}", prefix, key),
3633 None => key,
3634 };
3635 req_builder = req_builder.query(&[("access_token", value)]);
3636 }
3637 if let Some(ref user_agent) = configuration.user_agent {
3638 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3639 }
3640 if let Some(ref auth_conf) = configuration.basic_auth {
3641 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3642 };
3643 if let Some(ref token) = configuration.bearer_access_token {
3644 req_builder = req_builder.bearer_auth(token.to_owned());
3645 };
3646
3647 let req = req_builder.build()?;
3648 let resp = configuration.client.execute(req).await?;
3649
3650 let status = resp.status();
3651 let content_type = resp
3652 .headers()
3653 .get("content-type")
3654 .and_then(|v| v.to_str().ok())
3655 .unwrap_or("application/octet-stream");
3656 let content_type = super::ContentType::from(content_type);
3657
3658 if !status.is_client_error() && !status.is_server_error() {
3659 let content = resp.text().await?;
3660 match content_type {
3661 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3662 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserModel>`"))),
3663 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UserModel>`")))),
3664 }
3665 } else {
3666 let content = resp.text().await?;
3667 let entity: Option<GetStarsError> = serde_json::from_str(&content).ok();
3668 Err(Error::ResponseError(ResponseContent {
3669 status,
3670 content,
3671 entity,
3672 }))
3673 }
3674}
3675
3676pub async fn get_tags(
3677 configuration: &configuration::Configuration,
3678 repo_ref: &str,
3679 page: Option<i64>,
3680 size: Option<i64>,
3681 query: Option<&str>,
3682 include_commit: Option<bool>,
3683) -> Result<Vec<models::CommitTag>, Error<GetTagsError>> {
3684 let p_path_repo_ref = repo_ref;
3686 let p_query_page = page;
3687 let p_query_size = size;
3688 let p_query_query = query;
3689 let p_query_include_commit = include_commit;
3690
3691 let uri_str = format!(
3692 "{}/repos/{repo_ref}/+/tags",
3693 configuration.base_path,
3694 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3695 );
3696 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3697
3698 if let Some(ref param_value) = p_query_page {
3699 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3700 }
3701 if let Some(ref param_value) = p_query_size {
3702 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
3703 }
3704 if let Some(ref param_value) = p_query_query {
3705 req_builder = req_builder.query(&[("query", ¶m_value.to_string())]);
3706 }
3707 if let Some(ref param_value) = p_query_include_commit {
3708 req_builder = req_builder.query(&[("include_commit", ¶m_value.to_string())]);
3709 }
3710 if let Some(ref apikey) = configuration.api_key {
3711 let key = apikey.key.clone();
3712 let value = match apikey.prefix {
3713 Some(ref prefix) => format!("{} {}", prefix, key),
3714 None => key,
3715 };
3716 req_builder = req_builder.query(&[("access_token", value)]);
3717 }
3718 if let Some(ref user_agent) = configuration.user_agent {
3719 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3720 }
3721 if let Some(ref auth_conf) = configuration.basic_auth {
3722 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3723 };
3724 if let Some(ref token) = configuration.bearer_access_token {
3725 req_builder = req_builder.bearer_auth(token.to_owned());
3726 };
3727
3728 let req = req_builder.build()?;
3729 let resp = configuration.client.execute(req).await?;
3730
3731 let status = resp.status();
3732 let content_type = resp
3733 .headers()
3734 .get("content-type")
3735 .and_then(|v| v.to_str().ok())
3736 .unwrap_or("application/octet-stream");
3737 let content_type = super::ContentType::from(content_type);
3738
3739 if !status.is_client_error() && !status.is_server_error() {
3740 let content = resp.text().await?;
3741 match content_type {
3742 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3743 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CommitTag>`"))),
3744 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CommitTag>`")))),
3745 }
3746 } else {
3747 let content = resp.text().await?;
3748 let entity: Option<GetTagsError> = serde_json::from_str(&content).ok();
3749 Err(Error::ResponseError(ResponseContent {
3750 status,
3751 content,
3752 entity,
3753 }))
3754 }
3755}
3756
3757pub async fn patch_repo(
3758 configuration: &configuration::Configuration,
3759 repo_ref: &str,
3760 repo_update_input: models::RepoUpdateInput,
3761) -> Result<models::RepositoryModel, Error<PatchRepoError>> {
3762 let p_path_repo_ref = repo_ref;
3764 let p_body_repo_update_input = repo_update_input;
3765
3766 let uri_str = format!(
3767 "{}/repos/{repo_ref}/+",
3768 configuration.base_path,
3769 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3770 );
3771 let mut req_builder = configuration
3772 .client
3773 .request(reqwest::Method::PATCH, &uri_str);
3774
3775 if let Some(ref apikey) = configuration.api_key {
3776 let key = apikey.key.clone();
3777 let value = match apikey.prefix {
3778 Some(ref prefix) => format!("{} {}", prefix, key),
3779 None => key,
3780 };
3781 req_builder = req_builder.query(&[("access_token", value)]);
3782 }
3783 if let Some(ref user_agent) = configuration.user_agent {
3784 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3785 }
3786 if let Some(ref auth_conf) = configuration.basic_auth {
3787 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3788 };
3789 if let Some(ref token) = configuration.bearer_access_token {
3790 req_builder = req_builder.bearer_auth(token.to_owned());
3791 };
3792 req_builder = req_builder.json(&p_body_repo_update_input);
3793
3794 let req = req_builder.build()?;
3795 let resp = configuration.client.execute(req).await?;
3796
3797 let status = resp.status();
3798 let content_type = resp
3799 .headers()
3800 .get("content-type")
3801 .and_then(|v| v.to_str().ok())
3802 .unwrap_or("application/octet-stream");
3803 let content_type = super::ContentType::from(content_type);
3804
3805 if !status.is_client_error() && !status.is_server_error() {
3806 let content = resp.text().await?;
3807 match content_type {
3808 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3809 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
3810 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
3811 }
3812 } else {
3813 let content = resp.text().await?;
3814 let entity: Option<PatchRepoError> = serde_json::from_str(&content).ok();
3815 Err(Error::ResponseError(ResponseContent {
3816 status,
3817 content,
3818 entity,
3819 }))
3820 }
3821}
3822
3823pub async fn patch_repository_runner(
3824 configuration: &configuration::Configuration,
3825 repo_ref: &str,
3826 runner_uuid: &str,
3827 runner_patch_input: models::RunnerPatchInput,
3828) -> Result<models::RunnerModel, Error<PatchRepositoryRunnerError>> {
3829 let p_path_repo_ref = repo_ref;
3831 let p_path_runner_uuid = runner_uuid;
3832 let p_body_runner_patch_input = runner_patch_input;
3833
3834 let uri_str = format!(
3835 "{}/repos/{repo_ref}/+/runners/{runner_uuid}",
3836 configuration.base_path,
3837 repo_ref = crate::apis::urlencode(p_path_repo_ref),
3838 runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
3839 );
3840 let mut req_builder = configuration
3841 .client
3842 .request(reqwest::Method::PATCH, &uri_str);
3843
3844 if let Some(ref apikey) = configuration.api_key {
3845 let key = apikey.key.clone();
3846 let value = match apikey.prefix {
3847 Some(ref prefix) => format!("{} {}", prefix, key),
3848 None => key,
3849 };
3850 req_builder = req_builder.query(&[("access_token", value)]);
3851 }
3852 if let Some(ref user_agent) = configuration.user_agent {
3853 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3854 }
3855 if let Some(ref auth_conf) = configuration.basic_auth {
3856 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3857 };
3858 if let Some(ref token) = configuration.bearer_access_token {
3859 req_builder = req_builder.bearer_auth(token.to_owned());
3860 };
3861 req_builder = req_builder.json(&p_body_runner_patch_input);
3862
3863 let req = req_builder.build()?;
3864 let resp = configuration.client.execute(req).await?;
3865
3866 let status = resp.status();
3867 let content_type = resp
3868 .headers()
3869 .get("content-type")
3870 .and_then(|v| v.to_str().ok())
3871 .unwrap_or("application/octet-stream");
3872 let content_type = super::ContentType::from(content_type);
3873
3874 if !status.is_client_error() && !status.is_server_error() {
3875 let content = resp.text().await?;
3876 match content_type {
3877 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3878 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerModel`"))),
3879 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnerModel`")))),
3880 }
3881 } else {
3882 let content = resp.text().await?;
3883 let entity: Option<PatchRepositoryRunnerError> = serde_json::from_str(&content).ok();
3884 Err(Error::ResponseError(ResponseContent {
3885 status,
3886 content,
3887 entity,
3888 }))
3889 }
3890}
3891
3892pub async fn patch_repository_variable(
3893 configuration: &configuration::Configuration,
3894 repo_ref: &str,
3895 variable_identifier: &str,
3896 variable_patch_input: models::VariablePatchInput,
3897) -> Result<models::VariableModel, Error<PatchRepositoryVariableError>> {
3898 let p_path_repo_ref = repo_ref;
3900 let p_path_variable_identifier = variable_identifier;
3901 let p_body_variable_patch_input = variable_patch_input;
3902
3903 let uri_str = format!(
3904 "{}/repos/{repo_ref}/+/variables/{variable_identifier}",
3905 configuration.base_path,
3906 repo_ref = crate::apis::urlencode(p_path_repo_ref),
3907 variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
3908 );
3909 let mut req_builder = configuration
3910 .client
3911 .request(reqwest::Method::PATCH, &uri_str);
3912
3913 if let Some(ref apikey) = configuration.api_key {
3914 let key = apikey.key.clone();
3915 let value = match apikey.prefix {
3916 Some(ref prefix) => format!("{} {}", prefix, key),
3917 None => key,
3918 };
3919 req_builder = req_builder.query(&[("access_token", value)]);
3920 }
3921 if let Some(ref user_agent) = configuration.user_agent {
3922 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3923 }
3924 if let Some(ref auth_conf) = configuration.basic_auth {
3925 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3926 };
3927 if let Some(ref token) = configuration.bearer_access_token {
3928 req_builder = req_builder.bearer_auth(token.to_owned());
3929 };
3930 req_builder = req_builder.json(&p_body_variable_patch_input);
3931
3932 let req = req_builder.build()?;
3933 let resp = configuration.client.execute(req).await?;
3934
3935 let status = resp.status();
3936 let content_type = resp
3937 .headers()
3938 .get("content-type")
3939 .and_then(|v| v.to_str().ok())
3940 .unwrap_or("application/octet-stream");
3941 let content_type = super::ContentType::from(content_type);
3942
3943 if !status.is_client_error() && !status.is_server_error() {
3944 let content = resp.text().await?;
3945 match content_type {
3946 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3947 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
3948 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VariableModel`")))),
3949 }
3950 } else {
3951 let content = resp.text().await?;
3952 let entity: Option<PatchRepositoryVariableError> = serde_json::from_str(&content).ok();
3953 Err(Error::ResponseError(ResponseContent {
3954 status,
3955 content,
3956 entity,
3957 }))
3958 }
3959}
3960
3961pub async fn patch_security(
3962 configuration: &configuration::Configuration,
3963 repo_ref: &str,
3964 security_settings: models::SecuritySettings,
3965) -> Result<models::SecuritySettings, Error<PatchSecurityError>> {
3966 let p_path_repo_ref = repo_ref;
3968 let p_body_security_settings = security_settings;
3969
3970 let uri_str = format!(
3971 "{}/repos/{repo_ref}/+/settings/security",
3972 configuration.base_path,
3973 repo_ref = crate::apis::urlencode(p_path_repo_ref)
3974 );
3975 let mut req_builder = configuration
3976 .client
3977 .request(reqwest::Method::PATCH, &uri_str);
3978
3979 if let Some(ref apikey) = configuration.api_key {
3980 let key = apikey.key.clone();
3981 let value = match apikey.prefix {
3982 Some(ref prefix) => format!("{} {}", prefix, key),
3983 None => key,
3984 };
3985 req_builder = req_builder.query(&[("access_token", value)]);
3986 }
3987 if let Some(ref user_agent) = configuration.user_agent {
3988 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3989 }
3990 if let Some(ref auth_conf) = configuration.basic_auth {
3991 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3992 };
3993 if let Some(ref token) = configuration.bearer_access_token {
3994 req_builder = req_builder.bearer_auth(token.to_owned());
3995 };
3996 req_builder = req_builder.json(&p_body_security_settings);
3997
3998 let req = req_builder.build()?;
3999 let resp = configuration.client.execute(req).await?;
4000
4001 let status = resp.status();
4002 let content_type = resp
4003 .headers()
4004 .get("content-type")
4005 .and_then(|v| v.to_str().ok())
4006 .unwrap_or("application/octet-stream");
4007 let content_type = super::ContentType::from(content_type);
4008
4009 if !status.is_client_error() && !status.is_server_error() {
4010 let content = resp.text().await?;
4011 match content_type {
4012 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4013 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecuritySettings`"))),
4014 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecuritySettings`")))),
4015 }
4016 } else {
4017 let content = resp.text().await?;
4018 let entity: Option<PatchSecurityError> = serde_json::from_str(&content).ok();
4019 Err(Error::ResponseError(ResponseContent {
4020 status,
4021 content,
4022 entity,
4023 }))
4024 }
4025}
4026
4027pub async fn patch_stars(
4028 configuration: &configuration::Configuration,
4029 repo_ref: &str,
4030 repo_stars_input: models::RepoStarsInput,
4031) -> Result<models::RepositoryModel, Error<PatchStarsError>> {
4032 let p_path_repo_ref = repo_ref;
4034 let p_body_repo_stars_input = repo_stars_input;
4035
4036 let uri_str = format!(
4037 "{}/repos/{repo_ref}/+/stars",
4038 configuration.base_path,
4039 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4040 );
4041 let mut req_builder = configuration
4042 .client
4043 .request(reqwest::Method::PATCH, &uri_str);
4044
4045 if let Some(ref apikey) = configuration.api_key {
4046 let key = apikey.key.clone();
4047 let value = match apikey.prefix {
4048 Some(ref prefix) => format!("{} {}", prefix, key),
4049 None => key,
4050 };
4051 req_builder = req_builder.query(&[("access_token", value)]);
4052 }
4053 if let Some(ref user_agent) = configuration.user_agent {
4054 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4055 }
4056 if let Some(ref auth_conf) = configuration.basic_auth {
4057 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4058 };
4059 if let Some(ref token) = configuration.bearer_access_token {
4060 req_builder = req_builder.bearer_auth(token.to_owned());
4061 };
4062 req_builder = req_builder.json(&p_body_repo_stars_input);
4063
4064 let req = req_builder.build()?;
4065 let resp = configuration.client.execute(req).await?;
4066
4067 let status = resp.status();
4068 let content_type = resp
4069 .headers()
4070 .get("content-type")
4071 .and_then(|v| v.to_str().ok())
4072 .unwrap_or("application/octet-stream");
4073 let content_type = super::ContentType::from(content_type);
4074
4075 if !status.is_client_error() && !status.is_server_error() {
4076 let content = resp.text().await?;
4077 match content_type {
4078 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4079 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4080 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
4081 }
4082 } else {
4083 let content = resp.text().await?;
4084 let entity: Option<PatchStarsError> = serde_json::from_str(&content).ok();
4085 Err(Error::ResponseError(ResponseContent {
4086 status,
4087 content,
4088 entity,
4089 }))
4090 }
4091}
4092
4093pub async fn post_branch(
4094 configuration: &configuration::Configuration,
4095 repo_ref: &str,
4096 branch_create_input: models::BranchCreateInput,
4097) -> Result<models::CommitBranch, Error<PostBranchError>> {
4098 let p_path_repo_ref = repo_ref;
4100 let p_body_branch_create_input = branch_create_input;
4101
4102 let uri_str = format!(
4103 "{}/repos/{repo_ref}/+/branches",
4104 configuration.base_path,
4105 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4106 );
4107 let mut req_builder = configuration
4108 .client
4109 .request(reqwest::Method::POST, &uri_str);
4110
4111 if let Some(ref apikey) = configuration.api_key {
4112 let key = apikey.key.clone();
4113 let value = match apikey.prefix {
4114 Some(ref prefix) => format!("{} {}", prefix, key),
4115 None => key,
4116 };
4117 req_builder = req_builder.query(&[("access_token", value)]);
4118 }
4119 if let Some(ref user_agent) = configuration.user_agent {
4120 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4121 }
4122 if let Some(ref auth_conf) = configuration.basic_auth {
4123 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4124 };
4125 if let Some(ref token) = configuration.bearer_access_token {
4126 req_builder = req_builder.bearer_auth(token.to_owned());
4127 };
4128 req_builder = req_builder.json(&p_body_branch_create_input);
4129
4130 let req = req_builder.build()?;
4131 let resp = configuration.client.execute(req).await?;
4132
4133 let status = resp.status();
4134 let content_type = resp
4135 .headers()
4136 .get("content-type")
4137 .and_then(|v| v.to_str().ok())
4138 .unwrap_or("application/octet-stream");
4139 let content_type = super::ContentType::from(content_type);
4140
4141 if !status.is_client_error() && !status.is_server_error() {
4142 let content = resp.text().await?;
4143 match content_type {
4144 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4145 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitBranch`"))),
4146 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitBranch`")))),
4147 }
4148 } else {
4149 let content = resp.text().await?;
4150 let entity: Option<PostBranchError> = serde_json::from_str(&content).ok();
4151 Err(Error::ResponseError(ResponseContent {
4152 status,
4153 content,
4154 entity,
4155 }))
4156 }
4157}
4158
4159pub async fn post_default_branch(
4160 configuration: &configuration::Configuration,
4161 repo_ref: &str,
4162 repo_update_default_branch_input: models::RepoUpdateDefaultBranchInput,
4163) -> Result<models::RepositoryModel, Error<PostDefaultBranchError>> {
4164 let p_path_repo_ref = repo_ref;
4166 let p_body_repo_update_default_branch_input = repo_update_default_branch_input;
4167
4168 let uri_str = format!(
4169 "{}/repos/{repo_ref}/+/default-branch",
4170 configuration.base_path,
4171 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4172 );
4173 let mut req_builder = configuration
4174 .client
4175 .request(reqwest::Method::POST, &uri_str);
4176
4177 if let Some(ref apikey) = configuration.api_key {
4178 let key = apikey.key.clone();
4179 let value = match apikey.prefix {
4180 Some(ref prefix) => format!("{} {}", prefix, key),
4181 None => key,
4182 };
4183 req_builder = req_builder.query(&[("access_token", value)]);
4184 }
4185 if let Some(ref user_agent) = configuration.user_agent {
4186 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4187 }
4188 if let Some(ref auth_conf) = configuration.basic_auth {
4189 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4190 };
4191 if let Some(ref token) = configuration.bearer_access_token {
4192 req_builder = req_builder.bearer_auth(token.to_owned());
4193 };
4194 req_builder = req_builder.json(&p_body_repo_update_default_branch_input);
4195
4196 let req = req_builder.build()?;
4197 let resp = configuration.client.execute(req).await?;
4198
4199 let status = resp.status();
4200 let content_type = resp
4201 .headers()
4202 .get("content-type")
4203 .and_then(|v| v.to_str().ok())
4204 .unwrap_or("application/octet-stream");
4205 let content_type = super::ContentType::from(content_type);
4206
4207 if !status.is_client_error() && !status.is_server_error() {
4208 let content = resp.text().await?;
4209 match content_type {
4210 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4211 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4212 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
4213 }
4214 } else {
4215 let content = resp.text().await?;
4216 let entity: Option<PostDefaultBranchError> = serde_json::from_str(&content).ok();
4217 Err(Error::ResponseError(ResponseContent {
4218 status,
4219 content,
4220 entity,
4221 }))
4222 }
4223}
4224
4225pub async fn post_diffs(
4226 configuration: &configuration::Configuration,
4227 repo_ref: &str,
4228 path: &str,
4229 path2: &str,
4230 commit_diff_file: Vec<models::CommitDiffFile>,
4231) -> Result<Vec<i32>, Error<PostDiffsError>> {
4232 let p_path_repo_ref = repo_ref;
4234 let p_query_path = path;
4235 let p_path_path = path2;
4236 let p_body_commit_diff_file = commit_diff_file;
4237
4238 let uri_str = format!(
4239 "{}/repos/{repo_ref}/+/diff/{path}",
4240 configuration.base_path,
4241 repo_ref = crate::apis::urlencode(p_path_repo_ref),
4242 path = crate::apis::urlencode(p_path_path)
4243 );
4244 let mut req_builder = configuration
4245 .client
4246 .request(reqwest::Method::POST, &uri_str);
4247
4248 req_builder = req_builder.query(&[("path", &p_query_path.to_string())]);
4249 if let Some(ref apikey) = configuration.api_key {
4250 let key = apikey.key.clone();
4251 let value = match apikey.prefix {
4252 Some(ref prefix) => format!("{} {}", prefix, key),
4253 None => key,
4254 };
4255 req_builder = req_builder.query(&[("access_token", value)]);
4256 }
4257 if let Some(ref user_agent) = configuration.user_agent {
4258 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4259 }
4260 if let Some(ref auth_conf) = configuration.basic_auth {
4261 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4262 };
4263 if let Some(ref token) = configuration.bearer_access_token {
4264 req_builder = req_builder.bearer_auth(token.to_owned());
4265 };
4266 req_builder = req_builder.json(&p_body_commit_diff_file);
4267
4268 let req = req_builder.build()?;
4269 let resp = configuration.client.execute(req).await?;
4270
4271 let status = resp.status();
4272 let content_type = resp
4273 .headers()
4274 .get("content-type")
4275 .and_then(|v| v.to_str().ok())
4276 .unwrap_or("application/octet-stream");
4277 let content_type = super::ContentType::from(content_type);
4278
4279 if !status.is_client_error() && !status.is_server_error() {
4280 let content = resp.text().await?;
4281 match content_type {
4282 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4283 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<i32>`"))),
4284 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<i32>`")))),
4285 }
4286 } else {
4287 let content = resp.text().await?;
4288 let entity: Option<PostDiffsError> = serde_json::from_str(&content).ok();
4289 Err(Error::ResponseError(ResponseContent {
4290 status,
4291 content,
4292 entity,
4293 }))
4294 }
4295}
4296
4297pub async fn post_merge_check(
4298 configuration: &configuration::Configuration,
4299 repo_ref: &str,
4300 path: &str,
4301 repo_merge_check_input: models::RepoMergeCheckInput,
4302) -> Result<models::RepoMergeCheckOutput, Error<PostMergeCheckError>> {
4303 let p_path_repo_ref = repo_ref;
4305 let p_path_path = path;
4306 let p_body_repo_merge_check_input = repo_merge_check_input;
4307
4308 let uri_str = format!(
4309 "{}/repos/{repo_ref}/+/merge-check/{path}",
4310 configuration.base_path,
4311 repo_ref = crate::apis::urlencode(p_path_repo_ref),
4312 path = crate::apis::urlencode(p_path_path)
4313 );
4314 let mut req_builder = configuration
4315 .client
4316 .request(reqwest::Method::POST, &uri_str);
4317
4318 if let Some(ref apikey) = configuration.api_key {
4319 let key = apikey.key.clone();
4320 let value = match apikey.prefix {
4321 Some(ref prefix) => format!("{} {}", prefix, key),
4322 None => key,
4323 };
4324 req_builder = req_builder.query(&[("access_token", value)]);
4325 }
4326 if let Some(ref user_agent) = configuration.user_agent {
4327 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4328 }
4329 if let Some(ref auth_conf) = configuration.basic_auth {
4330 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4331 };
4332 if let Some(ref token) = configuration.bearer_access_token {
4333 req_builder = req_builder.bearer_auth(token.to_owned());
4334 };
4335 req_builder = req_builder.json(&p_body_repo_merge_check_input);
4336
4337 let req = req_builder.build()?;
4338 let resp = configuration.client.execute(req).await?;
4339
4340 let status = resp.status();
4341 let content_type = resp
4342 .headers()
4343 .get("content-type")
4344 .and_then(|v| v.to_str().ok())
4345 .unwrap_or("application/octet-stream");
4346 let content_type = super::ContentType::from(content_type);
4347
4348 if !status.is_client_error() && !status.is_server_error() {
4349 let content = resp.text().await?;
4350 match content_type {
4351 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4352 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoMergeCheckOutput`"))),
4353 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoMergeCheckOutput`")))),
4354 }
4355 } else {
4356 let content = resp.text().await?;
4357 let entity: Option<PostMergeCheckError> = serde_json::from_str(&content).ok();
4358 Err(Error::ResponseError(ResponseContent {
4359 status,
4360 content,
4361 entity,
4362 }))
4363 }
4364}
4365
4366pub async fn post_path_details(
4367 configuration: &configuration::Configuration,
4368 repo_ref: &str,
4369 request_body: Vec<String>,
4370 git_ref: Option<&str>,
4371) -> Result<Vec<models::PathDetails>, Error<PostPathDetailsError>> {
4372 let p_path_repo_ref = repo_ref;
4374 let p_body_request_body = request_body;
4375 let p_query_git_ref = git_ref;
4376
4377 let uri_str = format!(
4378 "{}/repos/{repo_ref}/+/path-details",
4379 configuration.base_path,
4380 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4381 );
4382 let mut req_builder = configuration
4383 .client
4384 .request(reqwest::Method::POST, &uri_str);
4385
4386 if let Some(ref param_value) = p_query_git_ref {
4387 req_builder = req_builder.query(&[("git_ref", ¶m_value.to_string())]);
4388 }
4389 if let Some(ref apikey) = configuration.api_key {
4390 let key = apikey.key.clone();
4391 let value = match apikey.prefix {
4392 Some(ref prefix) => format!("{} {}", prefix, key),
4393 None => key,
4394 };
4395 req_builder = req_builder.query(&[("access_token", value)]);
4396 }
4397 if let Some(ref user_agent) = configuration.user_agent {
4398 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4399 }
4400 if let Some(ref auth_conf) = configuration.basic_auth {
4401 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4402 };
4403 if let Some(ref token) = configuration.bearer_access_token {
4404 req_builder = req_builder.bearer_auth(token.to_owned());
4405 };
4406 req_builder = req_builder.json(&p_body_request_body);
4407
4408 let req = req_builder.build()?;
4409 let resp = configuration.client.execute(req).await?;
4410
4411 let status = resp.status();
4412 let content_type = resp
4413 .headers()
4414 .get("content-type")
4415 .and_then(|v| v.to_str().ok())
4416 .unwrap_or("application/octet-stream");
4417 let content_type = super::ContentType::from(content_type);
4418
4419 if !status.is_client_error() && !status.is_server_error() {
4420 let content = resp.text().await?;
4421 match content_type {
4422 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4423 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PathDetails>`"))),
4424 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PathDetails>`")))),
4425 }
4426 } else {
4427 let content = resp.text().await?;
4428 let entity: Option<PostPathDetailsError> = serde_json::from_str(&content).ok();
4429 Err(Error::ResponseError(ResponseContent {
4430 status,
4431 content,
4432 entity,
4433 }))
4434 }
4435}
4436
4437pub async fn post_release(
4438 configuration: &configuration::Configuration,
4439 repo_ref: &str,
4440 release_create_input: models::ReleaseCreateInput,
4441) -> Result<models::ReleaseModel, Error<PostReleaseError>> {
4442 let p_path_repo_ref = repo_ref;
4444 let p_body_release_create_input = release_create_input;
4445
4446 let uri_str = format!(
4447 "{}/repos/{repo_ref}/+/releases",
4448 configuration.base_path,
4449 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4450 );
4451 let mut req_builder = configuration
4452 .client
4453 .request(reqwest::Method::POST, &uri_str);
4454
4455 if let Some(ref apikey) = configuration.api_key {
4456 let key = apikey.key.clone();
4457 let value = match apikey.prefix {
4458 Some(ref prefix) => format!("{} {}", prefix, key),
4459 None => key,
4460 };
4461 req_builder = req_builder.query(&[("access_token", value)]);
4462 }
4463 if let Some(ref user_agent) = configuration.user_agent {
4464 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4465 }
4466 if let Some(ref auth_conf) = configuration.basic_auth {
4467 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4468 };
4469 if let Some(ref token) = configuration.bearer_access_token {
4470 req_builder = req_builder.bearer_auth(token.to_owned());
4471 };
4472 req_builder = req_builder.json(&p_body_release_create_input);
4473
4474 let req = req_builder.build()?;
4475 let resp = configuration.client.execute(req).await?;
4476
4477 let status = resp.status();
4478 let content_type = resp
4479 .headers()
4480 .get("content-type")
4481 .and_then(|v| v.to_str().ok())
4482 .unwrap_or("application/octet-stream");
4483 let content_type = super::ContentType::from(content_type);
4484
4485 if !status.is_client_error() && !status.is_server_error() {
4486 let content = resp.text().await?;
4487 match content_type {
4488 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4489 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReleaseModel`"))),
4490 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ReleaseModel`")))),
4491 }
4492 } else {
4493 let content = resp.text().await?;
4494 let entity: Option<PostReleaseError> = serde_json::from_str(&content).ok();
4495 Err(Error::ResponseError(ResponseContent {
4496 status,
4497 content,
4498 entity,
4499 }))
4500 }
4501}
4502
4503pub async fn post_repo(
4504 configuration: &configuration::Configuration,
4505 repo_create_input: models::RepoCreateInput,
4506) -> Result<models::RepositoryModel, Error<PostRepoError>> {
4507 let p_body_repo_create_input = repo_create_input;
4509
4510 let uri_str = format!("{}/repos", configuration.base_path);
4511 let mut req_builder = configuration
4512 .client
4513 .request(reqwest::Method::POST, &uri_str);
4514
4515 if let Some(ref apikey) = configuration.api_key {
4516 let key = apikey.key.clone();
4517 let value = match apikey.prefix {
4518 Some(ref prefix) => format!("{} {}", prefix, key),
4519 None => key,
4520 };
4521 req_builder = req_builder.query(&[("access_token", value)]);
4522 }
4523 if let Some(ref user_agent) = configuration.user_agent {
4524 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4525 }
4526 if let Some(ref auth_conf) = configuration.basic_auth {
4527 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4528 };
4529 if let Some(ref token) = configuration.bearer_access_token {
4530 req_builder = req_builder.bearer_auth(token.to_owned());
4531 };
4532 req_builder = req_builder.json(&p_body_repo_create_input);
4533
4534 let req = req_builder.build()?;
4535 let resp = configuration.client.execute(req).await?;
4536
4537 let status = resp.status();
4538 let content_type = resp
4539 .headers()
4540 .get("content-type")
4541 .and_then(|v| v.to_str().ok())
4542 .unwrap_or("application/octet-stream");
4543 let content_type = super::ContentType::from(content_type);
4544
4545 if !status.is_client_error() && !status.is_server_error() {
4546 let content = resp.text().await?;
4547 match content_type {
4548 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4549 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4550 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
4551 }
4552 } else {
4553 let content = resp.text().await?;
4554 let entity: Option<PostRepoError> = serde_json::from_str(&content).ok();
4555 Err(Error::ResponseError(ResponseContent {
4556 status,
4557 content,
4558 entity,
4559 }))
4560 }
4561}
4562
4563pub async fn post_repository_import(
4564 configuration: &configuration::Configuration,
4565 repo_import_input: models::RepoImportInput,
4566) -> Result<models::RepositoryModel, Error<PostRepositoryImportError>> {
4567 let p_body_repo_import_input = repo_import_input;
4569
4570 let uri_str = format!("{}/repos/import", configuration.base_path);
4571 let mut req_builder = configuration
4572 .client
4573 .request(reqwest::Method::POST, &uri_str);
4574
4575 if let Some(ref apikey) = configuration.api_key {
4576 let key = apikey.key.clone();
4577 let value = match apikey.prefix {
4578 Some(ref prefix) => format!("{} {}", prefix, key),
4579 None => key,
4580 };
4581 req_builder = req_builder.query(&[("access_token", value)]);
4582 }
4583 if let Some(ref user_agent) = configuration.user_agent {
4584 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4585 }
4586 if let Some(ref auth_conf) = configuration.basic_auth {
4587 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4588 };
4589 if let Some(ref token) = configuration.bearer_access_token {
4590 req_builder = req_builder.bearer_auth(token.to_owned());
4591 };
4592 req_builder = req_builder.json(&p_body_repo_import_input);
4593
4594 let req = req_builder.build()?;
4595 let resp = configuration.client.execute(req).await?;
4596
4597 let status = resp.status();
4598 let content_type = resp
4599 .headers()
4600 .get("content-type")
4601 .and_then(|v| v.to_str().ok())
4602 .unwrap_or("application/octet-stream");
4603 let content_type = super::ContentType::from(content_type);
4604
4605 if !status.is_client_error() && !status.is_server_error() {
4606 let content = resp.text().await?;
4607 match content_type {
4608 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4609 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4610 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
4611 }
4612 } else {
4613 let content = resp.text().await?;
4614 let entity: Option<PostRepositoryImportError> = serde_json::from_str(&content).ok();
4615 Err(Error::ResponseError(ResponseContent {
4616 status,
4617 content,
4618 entity,
4619 }))
4620 }
4621}
4622
4623pub async fn post_repository_move(
4624 configuration: &configuration::Configuration,
4625 repo_ref: &str,
4626 repo_move_input: models::RepoMoveInput,
4627) -> Result<models::RepositoryModel, Error<PostRepositoryMoveError>> {
4628 let p_path_repo_ref = repo_ref;
4630 let p_body_repo_move_input = repo_move_input;
4631
4632 let uri_str = format!(
4633 "{}/repos/{repo_ref}/+/move",
4634 configuration.base_path,
4635 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4636 );
4637 let mut req_builder = configuration
4638 .client
4639 .request(reqwest::Method::POST, &uri_str);
4640
4641 if let Some(ref apikey) = configuration.api_key {
4642 let key = apikey.key.clone();
4643 let value = match apikey.prefix {
4644 Some(ref prefix) => format!("{} {}", prefix, key),
4645 None => key,
4646 };
4647 req_builder = req_builder.query(&[("access_token", value)]);
4648 }
4649 if let Some(ref user_agent) = configuration.user_agent {
4650 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4651 }
4652 if let Some(ref auth_conf) = configuration.basic_auth {
4653 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4654 };
4655 if let Some(ref token) = configuration.bearer_access_token {
4656 req_builder = req_builder.bearer_auth(token.to_owned());
4657 };
4658 req_builder = req_builder.json(&p_body_repo_move_input);
4659
4660 let req = req_builder.build()?;
4661 let resp = configuration.client.execute(req).await?;
4662
4663 let status = resp.status();
4664 let content_type = resp
4665 .headers()
4666 .get("content-type")
4667 .and_then(|v| v.to_str().ok())
4668 .unwrap_or("application/octet-stream");
4669 let content_type = super::ContentType::from(content_type);
4670
4671 if !status.is_client_error() && !status.is_server_error() {
4672 let content = resp.text().await?;
4673 match content_type {
4674 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4675 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4676 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
4677 }
4678 } else {
4679 let content = resp.text().await?;
4680 let entity: Option<PostRepositoryMoveError> = serde_json::from_str(&content).ok();
4681 Err(Error::ResponseError(ResponseContent {
4682 status,
4683 content,
4684 entity,
4685 }))
4686 }
4687}
4688
4689pub async fn post_repository_purge(
4690 configuration: &configuration::Configuration,
4691 repo_ref: &str,
4692) -> Result<(), Error<PostRepositoryPurgeError>> {
4693 let p_path_repo_ref = repo_ref;
4695
4696 let uri_str = format!(
4697 "{}/repos/{repo_ref}/+/purge",
4698 configuration.base_path,
4699 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4700 );
4701 let mut req_builder = configuration
4702 .client
4703 .request(reqwest::Method::POST, &uri_str);
4704
4705 if let Some(ref apikey) = configuration.api_key {
4706 let key = apikey.key.clone();
4707 let value = match apikey.prefix {
4708 Some(ref prefix) => format!("{} {}", prefix, key),
4709 None => key,
4710 };
4711 req_builder = req_builder.query(&[("access_token", value)]);
4712 }
4713 if let Some(ref user_agent) = configuration.user_agent {
4714 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4715 }
4716 if let Some(ref auth_conf) = configuration.basic_auth {
4717 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4718 };
4719 if let Some(ref token) = configuration.bearer_access_token {
4720 req_builder = req_builder.bearer_auth(token.to_owned());
4721 };
4722
4723 let req = req_builder.build()?;
4724 let resp = configuration.client.execute(req).await?;
4725
4726 let status = resp.status();
4727
4728 if !status.is_client_error() && !status.is_server_error() {
4729 Ok(())
4730 } else {
4731 let content = resp.text().await?;
4732 let entity: Option<PostRepositoryPurgeError> = serde_json::from_str(&content).ok();
4733 Err(Error::ResponseError(ResponseContent {
4734 status,
4735 content,
4736 entity,
4737 }))
4738 }
4739}
4740
4741pub async fn post_repository_variable(
4742 configuration: &configuration::Configuration,
4743 repo_ref: &str,
4744 variable_create_input: models::VariableCreateInput,
4745) -> Result<models::VariableModel, Error<PostRepositoryVariableError>> {
4746 let p_path_repo_ref = repo_ref;
4748 let p_body_variable_create_input = variable_create_input;
4749
4750 let uri_str = format!(
4751 "{}/repos/{repo_ref}/+/variables",
4752 configuration.base_path,
4753 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4754 );
4755 let mut req_builder = configuration
4756 .client
4757 .request(reqwest::Method::POST, &uri_str);
4758
4759 if let Some(ref apikey) = configuration.api_key {
4760 let key = apikey.key.clone();
4761 let value = match apikey.prefix {
4762 Some(ref prefix) => format!("{} {}", prefix, key),
4763 None => key,
4764 };
4765 req_builder = req_builder.query(&[("access_token", value)]);
4766 }
4767 if let Some(ref user_agent) = configuration.user_agent {
4768 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4769 }
4770 if let Some(ref auth_conf) = configuration.basic_auth {
4771 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4772 };
4773 if let Some(ref token) = configuration.bearer_access_token {
4774 req_builder = req_builder.bearer_auth(token.to_owned());
4775 };
4776 req_builder = req_builder.json(&p_body_variable_create_input);
4777
4778 let req = req_builder.build()?;
4779 let resp = configuration.client.execute(req).await?;
4780
4781 let status = resp.status();
4782 let content_type = resp
4783 .headers()
4784 .get("content-type")
4785 .and_then(|v| v.to_str().ok())
4786 .unwrap_or("application/octet-stream");
4787 let content_type = super::ContentType::from(content_type);
4788
4789 if !status.is_client_error() && !status.is_server_error() {
4790 let content = resp.text().await?;
4791 match content_type {
4792 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4793 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
4794 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VariableModel`")))),
4795 }
4796 } else {
4797 let content = resp.text().await?;
4798 let entity: Option<PostRepositoryVariableError> = serde_json::from_str(&content).ok();
4799 Err(Error::ResponseError(ResponseContent {
4800 status,
4801 content,
4802 entity,
4803 }))
4804 }
4805}
4806
4807pub async fn post_tag(
4808 configuration: &configuration::Configuration,
4809 repo_ref: &str,
4810 tag_create_input: models::TagCreateInput,
4811) -> Result<models::CommitTag, Error<PostTagError>> {
4812 let p_path_repo_ref = repo_ref;
4814 let p_body_tag_create_input = tag_create_input;
4815
4816 let uri_str = format!(
4817 "{}/repos/{repo_ref}/+/tags",
4818 configuration.base_path,
4819 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4820 );
4821 let mut req_builder = configuration
4822 .client
4823 .request(reqwest::Method::POST, &uri_str);
4824
4825 if let Some(ref apikey) = configuration.api_key {
4826 let key = apikey.key.clone();
4827 let value = match apikey.prefix {
4828 Some(ref prefix) => format!("{} {}", prefix, key),
4829 None => key,
4830 };
4831 req_builder = req_builder.query(&[("access_token", value)]);
4832 }
4833 if let Some(ref user_agent) = configuration.user_agent {
4834 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4835 }
4836 if let Some(ref auth_conf) = configuration.basic_auth {
4837 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4838 };
4839 if let Some(ref token) = configuration.bearer_access_token {
4840 req_builder = req_builder.bearer_auth(token.to_owned());
4841 };
4842 req_builder = req_builder.json(&p_body_tag_create_input);
4843
4844 let req = req_builder.build()?;
4845 let resp = configuration.client.execute(req).await?;
4846
4847 let status = resp.status();
4848 let content_type = resp
4849 .headers()
4850 .get("content-type")
4851 .and_then(|v| v.to_str().ok())
4852 .unwrap_or("application/octet-stream");
4853 let content_type = super::ContentType::from(content_type);
4854
4855 if !status.is_client_error() && !status.is_server_error() {
4856 let content = resp.text().await?;
4857 match content_type {
4858 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4859 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitTag`"))),
4860 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitTag`")))),
4861 }
4862 } else {
4863 let content = resp.text().await?;
4864 let entity: Option<PostTagError> = serde_json::from_str(&content).ok();
4865 Err(Error::ResponseError(ResponseContent {
4866 status,
4867 content,
4868 entity,
4869 }))
4870 }
4871}
4872
4873pub async fn rename_branch(
4874 configuration: &configuration::Configuration,
4875 repo_ref: &str,
4876 branch_rename_input: models::BranchRenameInput,
4877) -> Result<models::CommitBranch, Error<RenameBranchError>> {
4878 let p_path_repo_ref = repo_ref;
4880 let p_body_branch_rename_input = branch_rename_input;
4881
4882 let uri_str = format!(
4883 "{}/repos/{repo_ref}/+/branches",
4884 configuration.base_path,
4885 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4886 );
4887 let mut req_builder = configuration
4888 .client
4889 .request(reqwest::Method::PATCH, &uri_str);
4890
4891 if let Some(ref apikey) = configuration.api_key {
4892 let key = apikey.key.clone();
4893 let value = match apikey.prefix {
4894 Some(ref prefix) => format!("{} {}", prefix, key),
4895 None => key,
4896 };
4897 req_builder = req_builder.query(&[("access_token", value)]);
4898 }
4899 if let Some(ref user_agent) = configuration.user_agent {
4900 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4901 }
4902 if let Some(ref auth_conf) = configuration.basic_auth {
4903 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4904 };
4905 if let Some(ref token) = configuration.bearer_access_token {
4906 req_builder = req_builder.bearer_auth(token.to_owned());
4907 };
4908 req_builder = req_builder.json(&p_body_branch_rename_input);
4909
4910 let req = req_builder.build()?;
4911 let resp = configuration.client.execute(req).await?;
4912
4913 let status = resp.status();
4914 let content_type = resp
4915 .headers()
4916 .get("content-type")
4917 .and_then(|v| v.to_str().ok())
4918 .unwrap_or("application/octet-stream");
4919 let content_type = super::ContentType::from(content_type);
4920
4921 if !status.is_client_error() && !status.is_server_error() {
4922 let content = resp.text().await?;
4923 match content_type {
4924 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4925 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitBranch`"))),
4926 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitBranch`")))),
4927 }
4928 } else {
4929 let content = resp.text().await?;
4930 let entity: Option<RenameBranchError> = serde_json::from_str(&content).ok();
4931 Err(Error::ResponseError(ResponseContent {
4932 status,
4933 content,
4934 entity,
4935 }))
4936 }
4937}
4938
4939pub async fn repo_restore(
4940 configuration: &configuration::Configuration,
4941 repo_ref: &str,
4942 repo_restore_input: models::RepoRestoreInput,
4943) -> Result<models::RepositoryModel, Error<RepoRestoreError>> {
4944 let p_path_repo_ref = repo_ref;
4946 let p_body_repo_restore_input = repo_restore_input;
4947
4948 let uri_str = format!(
4949 "{}/repos/{repo_ref}/+/restore",
4950 configuration.base_path,
4951 repo_ref = crate::apis::urlencode(p_path_repo_ref)
4952 );
4953 let mut req_builder = configuration
4954 .client
4955 .request(reqwest::Method::POST, &uri_str);
4956
4957 if let Some(ref apikey) = configuration.api_key {
4958 let key = apikey.key.clone();
4959 let value = match apikey.prefix {
4960 Some(ref prefix) => format!("{} {}", prefix, key),
4961 None => key,
4962 };
4963 req_builder = req_builder.query(&[("access_token", value)]);
4964 }
4965 if let Some(ref user_agent) = configuration.user_agent {
4966 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4967 }
4968 if let Some(ref auth_conf) = configuration.basic_auth {
4969 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4970 };
4971 if let Some(ref token) = configuration.bearer_access_token {
4972 req_builder = req_builder.bearer_auth(token.to_owned());
4973 };
4974 req_builder = req_builder.json(&p_body_repo_restore_input);
4975
4976 let req = req_builder.build()?;
4977 let resp = configuration.client.execute(req).await?;
4978
4979 let status = resp.status();
4980 let content_type = resp
4981 .headers()
4982 .get("content-type")
4983 .and_then(|v| v.to_str().ok())
4984 .unwrap_or("application/octet-stream");
4985 let content_type = super::ContentType::from(content_type);
4986
4987 if !status.is_client_error() && !status.is_server_error() {
4988 let content = resp.text().await?;
4989 match content_type {
4990 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4991 ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4992 ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepositoryModel`")))),
4993 }
4994 } else {
4995 let content = resp.text().await?;
4996 let entity: Option<RepoRestoreError> = serde_json::from_str(&content).ok();
4997 Err(Error::ResponseError(ResponseContent {
4998 status,
4999 content,
5000 entity,
5001 }))
5002 }
5003}
5004
5005pub async fn soft_repository_delete(
5006 configuration: &configuration::Configuration,
5007 repo_ref: &str,
5008) -> Result<(), Error<SoftRepositoryDeleteError>> {
5009 let p_path_repo_ref = repo_ref;
5011
5012 let uri_str = format!(
5013 "{}/repos/{repo_ref}/+",
5014 configuration.base_path,
5015 repo_ref = crate::apis::urlencode(p_path_repo_ref)
5016 );
5017 let mut req_builder = configuration
5018 .client
5019 .request(reqwest::Method::DELETE, &uri_str);
5020
5021 if let Some(ref apikey) = configuration.api_key {
5022 let key = apikey.key.clone();
5023 let value = match apikey.prefix {
5024 Some(ref prefix) => format!("{} {}", prefix, key),
5025 None => key,
5026 };
5027 req_builder = req_builder.query(&[("access_token", value)]);
5028 }
5029 if let Some(ref user_agent) = configuration.user_agent {
5030 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5031 }
5032 if let Some(ref auth_conf) = configuration.basic_auth {
5033 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
5034 };
5035 if let Some(ref token) = configuration.bearer_access_token {
5036 req_builder = req_builder.bearer_auth(token.to_owned());
5037 };
5038
5039 let req = req_builder.build()?;
5040 let resp = configuration.client.execute(req).await?;
5041
5042 let status = resp.status();
5043
5044 if !status.is_client_error() && !status.is_server_error() {
5045 Ok(())
5046 } else {
5047 let content = resp.text().await?;
5048 let entity: Option<SoftRepositoryDeleteError> = serde_json::from_str(&content).ok();
5049 Err(Error::ResponseError(ResponseContent {
5050 status,
5051 content,
5052 entity,
5053 }))
5054 }
5055}