Skip to main content

gitbundle_sdk/apis/
repository_api.rs

1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.4.1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use reqwest;
12use serde::{de::Error as _, Deserialize, Serialize};
13
14use super::{configuration, ContentType, Error};
15use crate::{apis::ResponseContent, models};
16
17/// struct for typed errors of method [`commit_files`]
18#[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/// struct for typed errors of method [`commits_calculate_divergence`]
33#[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/// struct for typed errors of method [`delete_branch`]
47#[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/// struct for typed errors of method [`delete_release`]
62#[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/// struct for typed errors of method [`delete_repository_runner`]
77#[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/// struct for typed errors of method [`delete_repository_variable`]
91#[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/// struct for typed errors of method [`delete_tag`]
105#[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/// struct for typed errors of method [`general_update`]
120#[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/// struct for typed errors of method [`get_archive`]
134#[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/// struct for typed errors of method [`get_branch`]
148#[derive(Debug, Clone, Serialize, Deserialize)]
149#[serde(untagged)]
150pub enum GetBranchError {
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/// struct for typed errors of method [`get_branches`]
162#[derive(Debug, Clone, Serialize, Deserialize)]
163#[serde(untagged)]
164pub enum GetBranchesError {
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/// struct for typed errors of method [`get_codeowners_validate`]
176#[derive(Debug, Clone, Serialize, Deserialize)]
177#[serde(untagged)]
178pub enum GetCodeownersValidateError {
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/// struct for typed errors of method [`get_commit`]
190#[derive(Debug, Clone, Serialize, Deserialize)]
191#[serde(untagged)]
192pub enum GetCommitError {
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/// struct for typed errors of method [`get_commit_diff`]
204#[derive(Debug, Clone, Serialize, Deserialize)]
205#[serde(untagged)]
206pub enum GetCommitDiffError {
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/// struct for typed errors of method [`get_commit_file_content`]
218#[derive(Debug, Clone, Serialize, Deserialize)]
219#[serde(untagged)]
220pub enum GetCommitFileContentError {
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/// struct for typed errors of method [`get_commits`]
232#[derive(Debug, Clone, Serialize, Deserialize)]
233#[serde(untagged)]
234pub enum GetCommitsError {
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/// struct for typed errors of method [`get_contributors`]
246#[derive(Debug, Clone, Serialize, Deserialize)]
247#[serde(untagged)]
248pub enum GetContributorsError {
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/// struct for typed errors of method [`get_forks`]
260#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum GetForksError {
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/// struct for typed errors of method [`get_general`]
274#[derive(Debug, Clone, Serialize, Deserialize)]
275#[serde(untagged)]
276pub enum GetGeneralError {
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/// struct for typed errors of method [`get_has_starred`]
288#[derive(Debug, Clone, Serialize, Deserialize)]
289#[serde(untagged)]
290pub enum GetHasStarredError {
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/// struct for typed errors of method [`get_import_progress`]
302#[derive(Debug, Clone, Serialize, Deserialize)]
303#[serde(untagged)]
304pub enum GetImportProgressError {
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/// struct for typed errors of method [`get_raw`]
316#[derive(Debug, Clone, Serialize, Deserialize)]
317#[serde(untagged)]
318pub enum GetRawError {
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/// struct for typed errors of method [`get_release`]
330#[derive(Debug, Clone, Serialize, Deserialize)]
331#[serde(untagged)]
332pub enum GetReleaseError {
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/// struct for typed errors of method [`get_releases`]
344#[derive(Debug, Clone, Serialize, Deserialize)]
345#[serde(untagged)]
346pub enum GetReleasesError {
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/// struct for typed errors of method [`get_repo`]
358#[derive(Debug, Clone, Serialize, Deserialize)]
359#[serde(untagged)]
360pub enum GetRepoError {
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/// struct for typed errors of method [`get_repository_reseted_runner_register_token`]
372#[derive(Debug, Clone, Serialize, Deserialize)]
373#[serde(untagged)]
374pub enum GetRepositoryResetedRunnerRegisterTokenError {
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/// struct for typed errors of method [`get_repository_runner`]
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum GetRepositoryRunnerError {
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/// struct for typed errors of method [`get_repository_runner_register_token`]
400#[derive(Debug, Clone, Serialize, Deserialize)]
401#[serde(untagged)]
402pub enum GetRepositoryRunnerRegisterTokenError {
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/// struct for typed errors of method [`get_repository_runners`]
414#[derive(Debug, Clone, Serialize, Deserialize)]
415#[serde(untagged)]
416pub enum GetRepositoryRunnersError {
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/// struct for typed errors of method [`get_repository_service_accounts`]
428#[derive(Debug, Clone, Serialize, Deserialize)]
429#[serde(untagged)]
430pub enum GetRepositoryServiceAccountsError {
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/// struct for typed errors of method [`get_repository_stats`]
442#[derive(Debug, Clone, Serialize, Deserialize)]
443#[serde(untagged)]
444pub enum GetRepositoryStatsError {
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/// struct for typed errors of method [`get_repository_variable`]
456#[derive(Debug, Clone, Serialize, Deserialize)]
457#[serde(untagged)]
458pub enum GetRepositoryVariableError {
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/// struct for typed errors of method [`get_repository_variables`]
470#[derive(Debug, Clone, Serialize, Deserialize)]
471#[serde(untagged)]
472pub enum GetRepositoryVariablesError {
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/// struct for typed errors of method [`get_security`]
484#[derive(Debug, Clone, Serialize, Deserialize)]
485#[serde(untagged)]
486pub enum GetSecurityError {
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/// struct for typed errors of method [`get_stars`]
498#[derive(Debug, Clone, Serialize, Deserialize)]
499#[serde(untagged)]
500pub enum GetStarsError {
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/// struct for typed errors of method [`get_tags`]
512#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum GetTagsError {
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/// struct for typed errors of method [`patch_repo`]
526#[derive(Debug, Clone, Serialize, Deserialize)]
527#[serde(untagged)]
528pub enum PatchRepoError {
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/// struct for typed errors of method [`patch_repository_runner`]
540#[derive(Debug, Clone, Serialize, Deserialize)]
541#[serde(untagged)]
542pub enum PatchRepositoryRunnerError {
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/// struct for typed errors of method [`patch_repository_variable`]
554#[derive(Debug, Clone, Serialize, Deserialize)]
555#[serde(untagged)]
556pub enum PatchRepositoryVariableError {
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/// struct for typed errors of method [`patch_security`]
568#[derive(Debug, Clone, Serialize, Deserialize)]
569#[serde(untagged)]
570pub enum PatchSecurityError {
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/// struct for typed errors of method [`patch_stars`]
582#[derive(Debug, Clone, Serialize, Deserialize)]
583#[serde(untagged)]
584pub enum PatchStarsError {
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/// struct for typed errors of method [`post_branch`]
596#[derive(Debug, Clone, Serialize, Deserialize)]
597#[serde(untagged)]
598pub enum PostBranchError {
599    Status400(models::JsonErrorResponseNull),
600    Status401(models::JsonErrorResponseNull),
601    Status403(models::JsonErrorResponseNull),
602    Status404(models::JsonErrorResponseNull),
603    Status409(models::JsonErrorResponseNull),
604    Status422(models::RuleCheckOutput),
605    Status429(models::JsonErrorResponseNull),
606    Status500(models::JsonErrorResponseNull),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`post_default_branch`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum PostDefaultBranchError {
614    Status400(models::JsonErrorResponseNull),
615    Status401(models::JsonErrorResponseNull),
616    Status403(models::JsonErrorResponseNull),
617    Status404(models::JsonErrorResponseNull),
618    Status409(models::JsonErrorResponseNull),
619    Status429(models::JsonErrorResponseNull),
620    Status500(models::JsonErrorResponseNull),
621    UnknownValue(serde_json::Value),
622}
623
624/// struct for typed errors of method [`post_merge_check`]
625#[derive(Debug, Clone, Serialize, Deserialize)]
626#[serde(untagged)]
627pub enum PostMergeCheckError {
628    Status400(models::JsonErrorResponseNull),
629    Status401(models::JsonErrorResponseNull),
630    Status403(models::JsonErrorResponseNull),
631    Status404(models::JsonErrorResponseNull),
632    Status409(models::JsonErrorResponseNull),
633    Status429(models::JsonErrorResponseNull),
634    Status500(models::JsonErrorResponseNull),
635    UnknownValue(serde_json::Value),
636}
637
638/// struct for typed errors of method [`post_release`]
639#[derive(Debug, Clone, Serialize, Deserialize)]
640#[serde(untagged)]
641pub enum PostReleaseError {
642    Status400(models::JsonErrorResponseNull),
643    Status401(models::JsonErrorResponseNull),
644    Status403(models::JsonErrorResponseNull),
645    Status404(models::JsonErrorResponseNull),
646    Status409(models::JsonErrorResponseNull),
647    Status422(models::RuleCheckOutput),
648    Status429(models::JsonErrorResponseNull),
649    Status500(models::JsonErrorResponseNull),
650    UnknownValue(serde_json::Value),
651}
652
653/// struct for typed errors of method [`post_repo`]
654#[derive(Debug, Clone, Serialize, Deserialize)]
655#[serde(untagged)]
656pub enum PostRepoError {
657    Status400(models::JsonErrorResponseNull),
658    Status401(models::JsonErrorResponseNull),
659    Status403(models::JsonErrorResponseNull),
660    Status404(models::JsonErrorResponseNull),
661    Status409(models::JsonErrorResponseNull),
662    Status429(models::JsonErrorResponseNull),
663    Status500(models::JsonErrorResponseNull),
664    UnknownValue(serde_json::Value),
665}
666
667/// struct for typed errors of method [`post_repository_import`]
668#[derive(Debug, Clone, Serialize, Deserialize)]
669#[serde(untagged)]
670pub enum PostRepositoryImportError {
671    Status400(models::JsonErrorResponseNull),
672    Status401(models::JsonErrorResponseNull),
673    Status403(models::JsonErrorResponseNull),
674    Status404(models::JsonErrorResponseNull),
675    Status409(models::JsonErrorResponseNull),
676    Status429(models::JsonErrorResponseNull),
677    Status500(models::JsonErrorResponseNull),
678    UnknownValue(serde_json::Value),
679}
680
681/// struct for typed errors of method [`post_repository_move`]
682#[derive(Debug, Clone, Serialize, Deserialize)]
683#[serde(untagged)]
684pub enum PostRepositoryMoveError {
685    Status400(models::JsonErrorResponseNull),
686    Status401(models::JsonErrorResponseNull),
687    Status403(models::JsonErrorResponseNull),
688    Status404(models::JsonErrorResponseNull),
689    Status409(models::JsonErrorResponseNull),
690    Status429(models::JsonErrorResponseNull),
691    Status500(models::JsonErrorResponseNull),
692    UnknownValue(serde_json::Value),
693}
694
695/// struct for typed errors of method [`post_repository_purge`]
696#[derive(Debug, Clone, Serialize, Deserialize)]
697#[serde(untagged)]
698pub enum PostRepositoryPurgeError {
699    Status400(models::JsonErrorResponseNull),
700    Status401(models::JsonErrorResponseNull),
701    Status403(models::JsonErrorResponseNull),
702    Status404(models::JsonErrorResponseNull),
703    Status409(models::JsonErrorResponseNull),
704    Status429(models::JsonErrorResponseNull),
705    Status500(models::JsonErrorResponseNull),
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`post_repository_variable`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum PostRepositoryVariableError {
713    Status400(models::JsonErrorResponseNull),
714    Status401(models::JsonErrorResponseNull),
715    Status403(models::JsonErrorResponseNull),
716    Status404(models::JsonErrorResponseNull),
717    Status409(models::JsonErrorResponseNull),
718    Status429(models::JsonErrorResponseNull),
719    Status500(models::JsonErrorResponseNull),
720    UnknownValue(serde_json::Value),
721}
722
723/// struct for typed errors of method [`post_tag`]
724#[derive(Debug, Clone, Serialize, Deserialize)]
725#[serde(untagged)]
726pub enum PostTagError {
727    Status400(models::JsonErrorResponseNull),
728    Status401(models::JsonErrorResponseNull),
729    Status403(models::JsonErrorResponseNull),
730    Status404(models::JsonErrorResponseNull),
731    Status409(models::JsonErrorResponseNull),
732    Status422(models::RuleCheckOutput),
733    Status429(models::JsonErrorResponseNull),
734    Status500(models::JsonErrorResponseNull),
735    UnknownValue(serde_json::Value),
736}
737
738/// struct for typed errors of method [`rename_branch`]
739#[derive(Debug, Clone, Serialize, Deserialize)]
740#[serde(untagged)]
741pub enum RenameBranchError {
742    Status400(models::JsonErrorResponseNull),
743    Status401(models::JsonErrorResponseNull),
744    Status403(models::JsonErrorResponseNull),
745    Status404(models::JsonErrorResponseNull),
746    Status409(models::JsonErrorResponseNull),
747    Status422(models::RuleCheckOutput),
748    Status429(models::JsonErrorResponseNull),
749    Status500(models::JsonErrorResponseNull),
750    UnknownValue(serde_json::Value),
751}
752
753/// struct for typed errors of method [`repo_restore`]
754#[derive(Debug, Clone, Serialize, Deserialize)]
755#[serde(untagged)]
756pub enum RepoRestoreError {
757    Status400(models::JsonErrorResponseNull),
758    Status401(models::JsonErrorResponseNull),
759    Status403(models::JsonErrorResponseNull),
760    Status404(models::JsonErrorResponseNull),
761    Status409(models::JsonErrorResponseNull),
762    Status429(models::JsonErrorResponseNull),
763    Status500(models::JsonErrorResponseNull),
764    UnknownValue(serde_json::Value),
765}
766
767/// struct for typed errors of method [`soft_repository_delete`]
768#[derive(Debug, Clone, Serialize, Deserialize)]
769#[serde(untagged)]
770pub enum SoftRepositoryDeleteError {
771    Status400(models::JsonErrorResponseNull),
772    Status401(models::JsonErrorResponseNull),
773    Status403(models::JsonErrorResponseNull),
774    Status404(models::JsonErrorResponseNull),
775    Status409(models::JsonErrorResponseNull),
776    Status429(models::JsonErrorResponseNull),
777    Status500(models::JsonErrorResponseNull),
778    UnknownValue(serde_json::Value),
779}
780
781pub async fn commit_files(
782    configuration: &configuration::Configuration,
783    repo_ref: &str,
784    commit_files_input: models::CommitFilesInput,
785) -> Result<models::CommitFilesOutput, Error<CommitFilesError>> {
786    // add a prefix to parameters to efficiently prevent name collisions
787    let p_path_repo_ref = repo_ref;
788    let p_body_commit_files_input = commit_files_input;
789
790    let uri_str = format!(
791        "{}/repos/{repo_ref}/+/commits",
792        configuration.base_path,
793        repo_ref = crate::apis::urlencode(p_path_repo_ref)
794    );
795    let mut req_builder = configuration
796        .client
797        .request(reqwest::Method::POST, &uri_str);
798
799    if let Some(ref apikey) = configuration.api_key {
800        let key = apikey.key.clone();
801        let value = match apikey.prefix {
802            Some(ref prefix) => format!("{} {}", prefix, key),
803            None => key,
804        };
805        req_builder = req_builder.query(&[("access_token", value)]);
806    }
807    if let Some(ref user_agent) = configuration.user_agent {
808        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
809    }
810    if let Some(ref auth_conf) = configuration.basic_auth {
811        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
812    };
813    if let Some(ref token) = configuration.bearer_access_token {
814        req_builder = req_builder.bearer_auth(token.to_owned());
815    };
816    req_builder = req_builder.json(&p_body_commit_files_input);
817
818    let req = req_builder.build()?;
819    let resp = configuration.client.execute(req).await?;
820
821    let status = resp.status();
822    let content_type = resp
823        .headers()
824        .get("content-type")
825        .and_then(|v| v.to_str().ok())
826        .unwrap_or("application/octet-stream");
827    let content_type = super::ContentType::from(content_type);
828
829    if !status.is_client_error() && !status.is_server_error() {
830        let content = resp.text().await?;
831        match content_type {
832            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
833            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitFilesOutput`"))),
834            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`")))),
835        }
836    } else {
837        let content = resp.text().await?;
838        let entity: Option<CommitFilesError> = serde_json::from_str(&content).ok();
839        Err(Error::ResponseError(ResponseContent {
840            status,
841            content,
842            entity,
843        }))
844    }
845}
846
847pub async fn commits_calculate_divergence(
848    configuration: &configuration::Configuration,
849    repo_ref: &str,
850    repo_commit_divergences_input: models::RepoCommitDivergencesInput,
851) -> Result<Vec<models::CommitDivergence>, Error<CommitsCalculateDivergenceError>> {
852    // add a prefix to parameters to efficiently prevent name collisions
853    let p_path_repo_ref = repo_ref;
854    let p_body_repo_commit_divergences_input = repo_commit_divergences_input;
855
856    let uri_str = format!(
857        "{}/repos/{repo_ref}/+/commits/calculate-divergence",
858        configuration.base_path,
859        repo_ref = crate::apis::urlencode(p_path_repo_ref)
860    );
861    let mut req_builder = configuration
862        .client
863        .request(reqwest::Method::POST, &uri_str);
864
865    if let Some(ref apikey) = configuration.api_key {
866        let key = apikey.key.clone();
867        let value = match apikey.prefix {
868            Some(ref prefix) => format!("{} {}", prefix, key),
869            None => key,
870        };
871        req_builder = req_builder.query(&[("access_token", value)]);
872    }
873    if let Some(ref user_agent) = configuration.user_agent {
874        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
875    }
876    if let Some(ref auth_conf) = configuration.basic_auth {
877        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
878    };
879    if let Some(ref token) = configuration.bearer_access_token {
880        req_builder = req_builder.bearer_auth(token.to_owned());
881    };
882    req_builder = req_builder.json(&p_body_repo_commit_divergences_input);
883
884    let req = req_builder.build()?;
885    let resp = configuration.client.execute(req).await?;
886
887    let status = resp.status();
888    let content_type = resp
889        .headers()
890        .get("content-type")
891        .and_then(|v| v.to_str().ok())
892        .unwrap_or("application/octet-stream");
893    let content_type = super::ContentType::from(content_type);
894
895    if !status.is_client_error() && !status.is_server_error() {
896        let content = resp.text().await?;
897        match content_type {
898            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
899            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::CommitDivergence&gt;`"))),
900            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::CommitDivergence&gt;`")))),
901        }
902    } else {
903        let content = resp.text().await?;
904        let entity: Option<CommitsCalculateDivergenceError> = serde_json::from_str(&content).ok();
905        Err(Error::ResponseError(ResponseContent {
906            status,
907            content,
908            entity,
909        }))
910    }
911}
912
913pub async fn delete_branch(
914    configuration: &configuration::Configuration,
915    repo_ref: &str,
916    branch_name: &str,
917    bypass_rules: Option<bool>,
918) -> Result<(), Error<DeleteBranchError>> {
919    // add a prefix to parameters to efficiently prevent name collisions
920    let p_path_repo_ref = repo_ref;
921    let p_path_branch_name = branch_name;
922    let p_query_bypass_rules = bypass_rules;
923
924    let uri_str = format!(
925        "{}/repos/{repo_ref}/+/branches/{branch_name}",
926        configuration.base_path,
927        repo_ref = crate::apis::urlencode(p_path_repo_ref),
928        branch_name = crate::apis::urlencode(p_path_branch_name)
929    );
930    let mut req_builder = configuration
931        .client
932        .request(reqwest::Method::DELETE, &uri_str);
933
934    if let Some(ref param_value) = p_query_bypass_rules {
935        req_builder = req_builder.query(&[("bypass_rules", &param_value.to_string())]);
936    }
937    if let Some(ref apikey) = configuration.api_key {
938        let key = apikey.key.clone();
939        let value = match apikey.prefix {
940            Some(ref prefix) => format!("{} {}", prefix, key),
941            None => key,
942        };
943        req_builder = req_builder.query(&[("access_token", value)]);
944    }
945    if let Some(ref user_agent) = configuration.user_agent {
946        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
947    }
948    if let Some(ref auth_conf) = configuration.basic_auth {
949        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
950    };
951    if let Some(ref token) = configuration.bearer_access_token {
952        req_builder = req_builder.bearer_auth(token.to_owned());
953    };
954
955    let req = req_builder.build()?;
956    let resp = configuration.client.execute(req).await?;
957
958    let status = resp.status();
959
960    if !status.is_client_error() && !status.is_server_error() {
961        Ok(())
962    } else {
963        let content = resp.text().await?;
964        let entity: Option<DeleteBranchError> = serde_json::from_str(&content).ok();
965        Err(Error::ResponseError(ResponseContent {
966            status,
967            content,
968            entity,
969        }))
970    }
971}
972
973pub async fn delete_release(
974    configuration: &configuration::Configuration,
975    repo_ref: &str,
976    tag_ref: &str,
977    bypass_rules: Option<bool>,
978) -> Result<(), Error<DeleteReleaseError>> {
979    // add a prefix to parameters to efficiently prevent name collisions
980    let p_path_repo_ref = repo_ref;
981    let p_path_tag_ref = tag_ref;
982    let p_query_bypass_rules = bypass_rules;
983
984    let uri_str = format!(
985        "{}/repos/{repo_ref}/+/releases/{tag_ref}",
986        configuration.base_path,
987        repo_ref = crate::apis::urlencode(p_path_repo_ref),
988        tag_ref = crate::apis::urlencode(p_path_tag_ref)
989    );
990    let mut req_builder = configuration
991        .client
992        .request(reqwest::Method::DELETE, &uri_str);
993
994    if let Some(ref param_value) = p_query_bypass_rules {
995        req_builder = req_builder.query(&[("bypass_rules", &param_value.to_string())]);
996    }
997    if let Some(ref apikey) = configuration.api_key {
998        let key = apikey.key.clone();
999        let value = match apikey.prefix {
1000            Some(ref prefix) => format!("{} {}", prefix, key),
1001            None => key,
1002        };
1003        req_builder = req_builder.query(&[("access_token", value)]);
1004    }
1005    if let Some(ref user_agent) = configuration.user_agent {
1006        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1007    }
1008    if let Some(ref auth_conf) = configuration.basic_auth {
1009        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1010    };
1011    if let Some(ref token) = configuration.bearer_access_token {
1012        req_builder = req_builder.bearer_auth(token.to_owned());
1013    };
1014
1015    let req = req_builder.build()?;
1016    let resp = configuration.client.execute(req).await?;
1017
1018    let status = resp.status();
1019
1020    if !status.is_client_error() && !status.is_server_error() {
1021        Ok(())
1022    } else {
1023        let content = resp.text().await?;
1024        let entity: Option<DeleteReleaseError> = serde_json::from_str(&content).ok();
1025        Err(Error::ResponseError(ResponseContent {
1026            status,
1027            content,
1028            entity,
1029        }))
1030    }
1031}
1032
1033pub async fn delete_repository_runner(
1034    configuration: &configuration::Configuration,
1035    repo_ref: &str,
1036    runner_uuid: &str,
1037) -> Result<(), Error<DeleteRepositoryRunnerError>> {
1038    // add a prefix to parameters to efficiently prevent name collisions
1039    let p_path_repo_ref = repo_ref;
1040    let p_path_runner_uuid = runner_uuid;
1041
1042    let uri_str = format!(
1043        "{}/repos/{repo_ref}/+/runners/{runner_uuid}",
1044        configuration.base_path,
1045        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1046        runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
1047    );
1048    let mut req_builder = configuration
1049        .client
1050        .request(reqwest::Method::DELETE, &uri_str);
1051
1052    if let Some(ref apikey) = configuration.api_key {
1053        let key = apikey.key.clone();
1054        let value = match apikey.prefix {
1055            Some(ref prefix) => format!("{} {}", prefix, key),
1056            None => key,
1057        };
1058        req_builder = req_builder.query(&[("access_token", value)]);
1059    }
1060    if let Some(ref user_agent) = configuration.user_agent {
1061        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1062    }
1063    if let Some(ref auth_conf) = configuration.basic_auth {
1064        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1065    };
1066    if let Some(ref token) = configuration.bearer_access_token {
1067        req_builder = req_builder.bearer_auth(token.to_owned());
1068    };
1069
1070    let req = req_builder.build()?;
1071    let resp = configuration.client.execute(req).await?;
1072
1073    let status = resp.status();
1074
1075    if !status.is_client_error() && !status.is_server_error() {
1076        Ok(())
1077    } else {
1078        let content = resp.text().await?;
1079        let entity: Option<DeleteRepositoryRunnerError> = serde_json::from_str(&content).ok();
1080        Err(Error::ResponseError(ResponseContent {
1081            status,
1082            content,
1083            entity,
1084        }))
1085    }
1086}
1087
1088pub async fn delete_repository_variable(
1089    configuration: &configuration::Configuration,
1090    repo_ref: &str,
1091    variable_identifier: &str,
1092) -> Result<(), Error<DeleteRepositoryVariableError>> {
1093    // add a prefix to parameters to efficiently prevent name collisions
1094    let p_path_repo_ref = repo_ref;
1095    let p_path_variable_identifier = variable_identifier;
1096
1097    let uri_str = format!(
1098        "{}/repos/{repo_ref}/+/variables/{variable_identifier}",
1099        configuration.base_path,
1100        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1101        variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
1102    );
1103    let mut req_builder = configuration
1104        .client
1105        .request(reqwest::Method::DELETE, &uri_str);
1106
1107    if let Some(ref apikey) = configuration.api_key {
1108        let key = apikey.key.clone();
1109        let value = match apikey.prefix {
1110            Some(ref prefix) => format!("{} {}", prefix, key),
1111            None => key,
1112        };
1113        req_builder = req_builder.query(&[("access_token", value)]);
1114    }
1115    if let Some(ref user_agent) = configuration.user_agent {
1116        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1117    }
1118    if let Some(ref auth_conf) = configuration.basic_auth {
1119        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1120    };
1121    if let Some(ref token) = configuration.bearer_access_token {
1122        req_builder = req_builder.bearer_auth(token.to_owned());
1123    };
1124
1125    let req = req_builder.build()?;
1126    let resp = configuration.client.execute(req).await?;
1127
1128    let status = resp.status();
1129
1130    if !status.is_client_error() && !status.is_server_error() {
1131        Ok(())
1132    } else {
1133        let content = resp.text().await?;
1134        let entity: Option<DeleteRepositoryVariableError> = serde_json::from_str(&content).ok();
1135        Err(Error::ResponseError(ResponseContent {
1136            status,
1137            content,
1138            entity,
1139        }))
1140    }
1141}
1142
1143pub async fn delete_tag(
1144    configuration: &configuration::Configuration,
1145    repo_ref: &str,
1146    tag_name: &str,
1147    bypass_rules: Option<bool>,
1148) -> Result<(), Error<DeleteTagError>> {
1149    // add a prefix to parameters to efficiently prevent name collisions
1150    let p_path_repo_ref = repo_ref;
1151    let p_path_tag_name = tag_name;
1152    let p_query_bypass_rules = bypass_rules;
1153
1154    let uri_str = format!(
1155        "{}/repos/{repo_ref}/+/tags/{tag_name}",
1156        configuration.base_path,
1157        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1158        tag_name = crate::apis::urlencode(p_path_tag_name)
1159    );
1160    let mut req_builder = configuration
1161        .client
1162        .request(reqwest::Method::DELETE, &uri_str);
1163
1164    if let Some(ref param_value) = p_query_bypass_rules {
1165        req_builder = req_builder.query(&[("bypass_rules", &param_value.to_string())]);
1166    }
1167    if let Some(ref apikey) = configuration.api_key {
1168        let key = apikey.key.clone();
1169        let value = match apikey.prefix {
1170            Some(ref prefix) => format!("{} {}", prefix, key),
1171            None => key,
1172        };
1173        req_builder = req_builder.query(&[("access_token", value)]);
1174    }
1175    if let Some(ref user_agent) = configuration.user_agent {
1176        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1177    }
1178    if let Some(ref auth_conf) = configuration.basic_auth {
1179        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1180    };
1181    if let Some(ref token) = configuration.bearer_access_token {
1182        req_builder = req_builder.bearer_auth(token.to_owned());
1183    };
1184
1185    let req = req_builder.build()?;
1186    let resp = configuration.client.execute(req).await?;
1187
1188    let status = resp.status();
1189
1190    if !status.is_client_error() && !status.is_server_error() {
1191        Ok(())
1192    } else {
1193        let content = resp.text().await?;
1194        let entity: Option<DeleteTagError> = serde_json::from_str(&content).ok();
1195        Err(Error::ResponseError(ResponseContent {
1196            status,
1197            content,
1198            entity,
1199        }))
1200    }
1201}
1202
1203pub async fn general_update(
1204    configuration: &configuration::Configuration,
1205    repo_ref: &str,
1206    general_settings: models::GeneralSettings,
1207) -> Result<models::GeneralSettings, Error<GeneralUpdateError>> {
1208    // add a prefix to parameters to efficiently prevent name collisions
1209    let p_path_repo_ref = repo_ref;
1210    let p_body_general_settings = general_settings;
1211
1212    let uri_str = format!(
1213        "{}/repos/{repo_ref}/+/settings/general",
1214        configuration.base_path,
1215        repo_ref = crate::apis::urlencode(p_path_repo_ref)
1216    );
1217    let mut req_builder = configuration
1218        .client
1219        .request(reqwest::Method::PATCH, &uri_str);
1220
1221    if let Some(ref apikey) = configuration.api_key {
1222        let key = apikey.key.clone();
1223        let value = match apikey.prefix {
1224            Some(ref prefix) => format!("{} {}", prefix, key),
1225            None => key,
1226        };
1227        req_builder = req_builder.query(&[("access_token", value)]);
1228    }
1229    if let Some(ref user_agent) = configuration.user_agent {
1230        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1231    }
1232    if let Some(ref auth_conf) = configuration.basic_auth {
1233        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1234    };
1235    if let Some(ref token) = configuration.bearer_access_token {
1236        req_builder = req_builder.bearer_auth(token.to_owned());
1237    };
1238    req_builder = req_builder.json(&p_body_general_settings);
1239
1240    let req = req_builder.build()?;
1241    let resp = configuration.client.execute(req).await?;
1242
1243    let status = resp.status();
1244    let content_type = resp
1245        .headers()
1246        .get("content-type")
1247        .and_then(|v| v.to_str().ok())
1248        .unwrap_or("application/octet-stream");
1249    let content_type = super::ContentType::from(content_type);
1250
1251    if !status.is_client_error() && !status.is_server_error() {
1252        let content = resp.text().await?;
1253        match content_type {
1254            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1255            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralSettings`"))),
1256            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`")))),
1257        }
1258    } else {
1259        let content = resp.text().await?;
1260        let entity: Option<GeneralUpdateError> = serde_json::from_str(&content).ok();
1261        Err(Error::ResponseError(ResponseContent {
1262            status,
1263            content,
1264            entity,
1265        }))
1266    }
1267}
1268
1269pub async fn get_archive(
1270    configuration: &configuration::Configuration,
1271    repo_ref: &str,
1272    archive_ref: &str,
1273    prefix: Option<&str>,
1274    attributes: Option<models::ArchiveAttribute>,
1275    paths: Option<Vec<String>>,
1276    timestamp: Option<i64>,
1277    compression: Option<i32>,
1278) -> Result<Vec<i32>, Error<GetArchiveError>> {
1279    // add a prefix to parameters to efficiently prevent name collisions
1280    let p_path_repo_ref = repo_ref;
1281    let p_path_archive_ref = archive_ref;
1282    let p_query_prefix = prefix;
1283    let p_query_attributes = attributes;
1284    let p_query_paths = paths;
1285    let p_query_timestamp = timestamp;
1286    let p_query_compression = compression;
1287
1288    let uri_str = format!(
1289        "{}/repos/{repo_ref}/+/archive/{archive_ref}",
1290        configuration.base_path,
1291        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1292        archive_ref = crate::apis::urlencode(p_path_archive_ref)
1293    );
1294    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1295
1296    if let Some(ref param_value) = p_query_prefix {
1297        req_builder = req_builder.query(&[("prefix", &param_value.to_string())]);
1298    }
1299    if let Some(ref param_value) = p_query_attributes {
1300        req_builder = req_builder.query(&[("attributes", &param_value.to_string())]);
1301    }
1302    if let Some(ref param_value) = p_query_paths {
1303        req_builder = match "multi" {
1304            "multi" => req_builder.query(
1305                &param_value
1306                    .iter()
1307                    .map(|p| ("paths".to_owned(), p.to_string()))
1308                    .collect::<Vec<(std::string::String, std::string::String)>>(),
1309            ),
1310            _ => req_builder.query(&[(
1311                "paths",
1312                &param_value
1313                    .iter()
1314                    .map(|p| p.to_string())
1315                    .collect::<Vec<String>>()
1316                    .join(",")
1317                    .to_string(),
1318            )]),
1319        };
1320    }
1321    if let Some(ref param_value) = p_query_timestamp {
1322        req_builder = req_builder.query(&[("timestamp", &param_value.to_string())]);
1323    }
1324    if let Some(ref param_value) = p_query_compression {
1325        req_builder = req_builder.query(&[("compression", &param_value.to_string())]);
1326    }
1327    if let Some(ref apikey) = configuration.api_key {
1328        let key = apikey.key.clone();
1329        let value = match apikey.prefix {
1330            Some(ref prefix) => format!("{} {}", prefix, key),
1331            None => key,
1332        };
1333        req_builder = req_builder.query(&[("access_token", value)]);
1334    }
1335    if let Some(ref user_agent) = configuration.user_agent {
1336        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1337    }
1338    if let Some(ref auth_conf) = configuration.basic_auth {
1339        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1340    };
1341    if let Some(ref token) = configuration.bearer_access_token {
1342        req_builder = req_builder.bearer_auth(token.to_owned());
1343    };
1344
1345    let req = req_builder.build()?;
1346    let resp = configuration.client.execute(req).await?;
1347
1348    let status = resp.status();
1349    let content_type = resp
1350        .headers()
1351        .get("content-type")
1352        .and_then(|v| v.to_str().ok())
1353        .unwrap_or("application/octet-stream");
1354    let content_type = super::ContentType::from(content_type);
1355
1356    if !status.is_client_error() && !status.is_server_error() {
1357        let content = resp.text().await?;
1358        match content_type {
1359            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1360            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;i32&gt;`"))),
1361            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;i32&gt;`")))),
1362        }
1363    } else {
1364        let content = resp.text().await?;
1365        let entity: Option<GetArchiveError> = serde_json::from_str(&content).ok();
1366        Err(Error::ResponseError(ResponseContent {
1367            status,
1368            content,
1369            entity,
1370        }))
1371    }
1372}
1373
1374pub async fn get_branch(
1375    configuration: &configuration::Configuration,
1376    repo_ref: &str,
1377    branch_name: &str,
1378) -> Result<models::CommitBranch, Error<GetBranchError>> {
1379    // add a prefix to parameters to efficiently prevent name collisions
1380    let p_path_repo_ref = repo_ref;
1381    let p_path_branch_name = branch_name;
1382
1383    let uri_str = format!(
1384        "{}/repos/{repo_ref}/+/branches/{branch_name}",
1385        configuration.base_path,
1386        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1387        branch_name = crate::apis::urlencode(p_path_branch_name)
1388    );
1389    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1390
1391    if let Some(ref apikey) = configuration.api_key {
1392        let key = apikey.key.clone();
1393        let value = match apikey.prefix {
1394            Some(ref prefix) => format!("{} {}", prefix, key),
1395            None => key,
1396        };
1397        req_builder = req_builder.query(&[("access_token", value)]);
1398    }
1399    if let Some(ref user_agent) = configuration.user_agent {
1400        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1401    }
1402    if let Some(ref auth_conf) = configuration.basic_auth {
1403        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1404    };
1405    if let Some(ref token) = configuration.bearer_access_token {
1406        req_builder = req_builder.bearer_auth(token.to_owned());
1407    };
1408
1409    let req = req_builder.build()?;
1410    let resp = configuration.client.execute(req).await?;
1411
1412    let status = resp.status();
1413    let content_type = resp
1414        .headers()
1415        .get("content-type")
1416        .and_then(|v| v.to_str().ok())
1417        .unwrap_or("application/octet-stream");
1418    let content_type = super::ContentType::from(content_type);
1419
1420    if !status.is_client_error() && !status.is_server_error() {
1421        let content = resp.text().await?;
1422        match content_type {
1423            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1424            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitBranch`"))),
1425            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`")))),
1426        }
1427    } else {
1428        let content = resp.text().await?;
1429        let entity: Option<GetBranchError> = serde_json::from_str(&content).ok();
1430        Err(Error::ResponseError(ResponseContent {
1431            status,
1432            content,
1433            entity,
1434        }))
1435    }
1436}
1437
1438pub async fn get_branches(
1439    configuration: &configuration::Configuration,
1440    repo_ref: &str,
1441    page: Option<i64>,
1442    size: Option<i64>,
1443    query: Option<&str>,
1444    include_commit: Option<bool>,
1445) -> Result<Vec<models::CommitBranch>, Error<GetBranchesError>> {
1446    // add a prefix to parameters to efficiently prevent name collisions
1447    let p_path_repo_ref = repo_ref;
1448    let p_query_page = page;
1449    let p_query_size = size;
1450    let p_query_query = query;
1451    let p_query_include_commit = include_commit;
1452
1453    let uri_str = format!(
1454        "{}/repos/{repo_ref}/+/branches",
1455        configuration.base_path,
1456        repo_ref = crate::apis::urlencode(p_path_repo_ref)
1457    );
1458    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1459
1460    if let Some(ref param_value) = p_query_page {
1461        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1462    }
1463    if let Some(ref param_value) = p_query_size {
1464        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1465    }
1466    if let Some(ref param_value) = p_query_query {
1467        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1468    }
1469    if let Some(ref param_value) = p_query_include_commit {
1470        req_builder = req_builder.query(&[("include_commit", &param_value.to_string())]);
1471    }
1472    if let Some(ref apikey) = configuration.api_key {
1473        let key = apikey.key.clone();
1474        let value = match apikey.prefix {
1475            Some(ref prefix) => format!("{} {}", prefix, key),
1476            None => key,
1477        };
1478        req_builder = req_builder.query(&[("access_token", value)]);
1479    }
1480    if let Some(ref user_agent) = configuration.user_agent {
1481        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1482    }
1483    if let Some(ref auth_conf) = configuration.basic_auth {
1484        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1485    };
1486    if let Some(ref token) = configuration.bearer_access_token {
1487        req_builder = req_builder.bearer_auth(token.to_owned());
1488    };
1489
1490    let req = req_builder.build()?;
1491    let resp = configuration.client.execute(req).await?;
1492
1493    let status = resp.status();
1494    let content_type = resp
1495        .headers()
1496        .get("content-type")
1497        .and_then(|v| v.to_str().ok())
1498        .unwrap_or("application/octet-stream");
1499    let content_type = super::ContentType::from(content_type);
1500
1501    if !status.is_client_error() && !status.is_server_error() {
1502        let content = resp.text().await?;
1503        match content_type {
1504            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1505            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::CommitBranch&gt;`"))),
1506            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::CommitBranch&gt;`")))),
1507        }
1508    } else {
1509        let content = resp.text().await?;
1510        let entity: Option<GetBranchesError> = serde_json::from_str(&content).ok();
1511        Err(Error::ResponseError(ResponseContent {
1512            status,
1513            content,
1514            entity,
1515        }))
1516    }
1517}
1518
1519pub async fn get_codeowners_validate(
1520    configuration: &configuration::Configuration,
1521    repo_ref: &str,
1522    git_ref: Option<&str>,
1523) -> Result<models::CodeOwnersValidation, Error<GetCodeownersValidateError>> {
1524    // add a prefix to parameters to efficiently prevent name collisions
1525    let p_path_repo_ref = repo_ref;
1526    let p_query_git_ref = git_ref;
1527
1528    let uri_str = format!(
1529        "{}/repos/{repo_ref}/+/codeowners/validate",
1530        configuration.base_path,
1531        repo_ref = crate::apis::urlencode(p_path_repo_ref)
1532    );
1533    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1534
1535    if let Some(ref param_value) = p_query_git_ref {
1536        req_builder = req_builder.query(&[("git_ref", &param_value.to_string())]);
1537    }
1538    if let Some(ref apikey) = configuration.api_key {
1539        let key = apikey.key.clone();
1540        let value = match apikey.prefix {
1541            Some(ref prefix) => format!("{} {}", prefix, key),
1542            None => key,
1543        };
1544        req_builder = req_builder.query(&[("access_token", value)]);
1545    }
1546    if let Some(ref user_agent) = configuration.user_agent {
1547        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1548    }
1549    if let Some(ref auth_conf) = configuration.basic_auth {
1550        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1551    };
1552    if let Some(ref token) = configuration.bearer_access_token {
1553        req_builder = req_builder.bearer_auth(token.to_owned());
1554    };
1555
1556    let req = req_builder.build()?;
1557    let resp = configuration.client.execute(req).await?;
1558
1559    let status = resp.status();
1560    let content_type = resp
1561        .headers()
1562        .get("content-type")
1563        .and_then(|v| v.to_str().ok())
1564        .unwrap_or("application/octet-stream");
1565    let content_type = super::ContentType::from(content_type);
1566
1567    if !status.is_client_error() && !status.is_server_error() {
1568        let content = resp.text().await?;
1569        match content_type {
1570            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1571            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CodeOwnersValidation`"))),
1572            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`")))),
1573        }
1574    } else {
1575        let content = resp.text().await?;
1576        let entity: Option<GetCodeownersValidateError> = serde_json::from_str(&content).ok();
1577        Err(Error::ResponseError(ResponseContent {
1578            status,
1579            content,
1580            entity,
1581        }))
1582    }
1583}
1584
1585pub async fn get_commit(
1586    configuration: &configuration::Configuration,
1587    repo_ref: &str,
1588    commit_sha: &str,
1589) -> Result<models::Commit, Error<GetCommitError>> {
1590    // add a prefix to parameters to efficiently prevent name collisions
1591    let p_path_repo_ref = repo_ref;
1592    let p_path_commit_sha = commit_sha;
1593
1594    let uri_str = format!(
1595        "{}/repos/{repo_ref}/+/commits/{commit_sha}",
1596        configuration.base_path,
1597        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1598        commit_sha = crate::apis::urlencode(p_path_commit_sha)
1599    );
1600    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1601
1602    if let Some(ref apikey) = configuration.api_key {
1603        let key = apikey.key.clone();
1604        let value = match apikey.prefix {
1605            Some(ref prefix) => format!("{} {}", prefix, key),
1606            None => key,
1607        };
1608        req_builder = req_builder.query(&[("access_token", value)]);
1609    }
1610    if let Some(ref user_agent) = configuration.user_agent {
1611        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1612    }
1613    if let Some(ref auth_conf) = configuration.basic_auth {
1614        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1615    };
1616    if let Some(ref token) = configuration.bearer_access_token {
1617        req_builder = req_builder.bearer_auth(token.to_owned());
1618    };
1619
1620    let req = req_builder.build()?;
1621    let resp = configuration.client.execute(req).await?;
1622
1623    let status = resp.status();
1624    let content_type = resp
1625        .headers()
1626        .get("content-type")
1627        .and_then(|v| v.to_str().ok())
1628        .unwrap_or("application/octet-stream");
1629    let content_type = super::ContentType::from(content_type);
1630
1631    if !status.is_client_error() && !status.is_server_error() {
1632        let content = resp.text().await?;
1633        match content_type {
1634            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1635            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Commit`"))),
1636            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`")))),
1637        }
1638    } else {
1639        let content = resp.text().await?;
1640        let entity: Option<GetCommitError> = serde_json::from_str(&content).ok();
1641        Err(Error::ResponseError(ResponseContent {
1642            status,
1643            content,
1644            entity,
1645        }))
1646    }
1647}
1648
1649pub async fn get_commit_diff(
1650    configuration: &configuration::Configuration,
1651    repo_ref: &str,
1652    commit_sha: &str,
1653) -> Result<String, Error<GetCommitDiffError>> {
1654    // add a prefix to parameters to efficiently prevent name collisions
1655    let p_path_repo_ref = repo_ref;
1656    let p_path_commit_sha = commit_sha;
1657
1658    let uri_str = format!(
1659        "{}/repos/{repo_ref}/+/commits/{commit_sha}/diff",
1660        configuration.base_path,
1661        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1662        commit_sha = crate::apis::urlencode(p_path_commit_sha)
1663    );
1664    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1665
1666    if let Some(ref apikey) = configuration.api_key {
1667        let key = apikey.key.clone();
1668        let value = match apikey.prefix {
1669            Some(ref prefix) => format!("{} {}", prefix, key),
1670            None => key,
1671        };
1672        req_builder = req_builder.query(&[("access_token", value)]);
1673    }
1674    if let Some(ref user_agent) = configuration.user_agent {
1675        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1676    }
1677    if let Some(ref auth_conf) = configuration.basic_auth {
1678        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1679    };
1680    if let Some(ref token) = configuration.bearer_access_token {
1681        req_builder = req_builder.bearer_auth(token.to_owned());
1682    };
1683
1684    let req = req_builder.build()?;
1685    let resp = configuration.client.execute(req).await?;
1686
1687    let status = resp.status();
1688    let content_type = resp
1689        .headers()
1690        .get("content-type")
1691        .and_then(|v| v.to_str().ok())
1692        .unwrap_or("application/octet-stream");
1693    let content_type = super::ContentType::from(content_type);
1694
1695    if !status.is_client_error() && !status.is_server_error() {
1696        let content = resp.text().await?;
1697        match content_type {
1698            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1699            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))),
1700            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))),
1701        }
1702    } else {
1703        let content = resp.text().await?;
1704        let entity: Option<GetCommitDiffError> = serde_json::from_str(&content).ok();
1705        Err(Error::ResponseError(ResponseContent {
1706            status,
1707            content,
1708            entity,
1709        }))
1710    }
1711}
1712
1713pub async fn get_commit_file_content(
1714    configuration: &configuration::Configuration,
1715    repo_ref: &str,
1716    commit_sha: &str,
1717    file_path: &str,
1718    hunk_header: &str,
1719    expand_up: bool,
1720    size: Option<i32>,
1721) -> Result<models::DiffFileContent, Error<GetCommitFileContentError>> {
1722    // add a prefix to parameters to efficiently prevent name collisions
1723    let p_path_repo_ref = repo_ref;
1724    let p_path_commit_sha = commit_sha;
1725    let p_query_file_path = file_path;
1726    let p_query_hunk_header = hunk_header;
1727    let p_query_expand_up = expand_up;
1728    let p_query_size = size;
1729
1730    let uri_str = format!(
1731        "{}/repos/{repo_ref}/+/commits/{commit_sha}/content",
1732        configuration.base_path,
1733        repo_ref = crate::apis::urlencode(p_path_repo_ref),
1734        commit_sha = crate::apis::urlencode(p_path_commit_sha)
1735    );
1736    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1737
1738    req_builder = req_builder.query(&[("file_path", &p_query_file_path.to_string())]);
1739    req_builder = req_builder.query(&[("hunk_header", &p_query_hunk_header.to_string())]);
1740    if let Some(ref param_value) = p_query_size {
1741        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1742    }
1743    req_builder = req_builder.query(&[("expand_up", &p_query_expand_up.to_string())]);
1744    if let Some(ref apikey) = configuration.api_key {
1745        let key = apikey.key.clone();
1746        let value = match apikey.prefix {
1747            Some(ref prefix) => format!("{} {}", prefix, key),
1748            None => key,
1749        };
1750        req_builder = req_builder.query(&[("access_token", value)]);
1751    }
1752    if let Some(ref user_agent) = configuration.user_agent {
1753        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1754    }
1755    if let Some(ref auth_conf) = configuration.basic_auth {
1756        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1757    };
1758    if let Some(ref token) = configuration.bearer_access_token {
1759        req_builder = req_builder.bearer_auth(token.to_owned());
1760    };
1761
1762    let req = req_builder.build()?;
1763    let resp = configuration.client.execute(req).await?;
1764
1765    let status = resp.status();
1766    let content_type = resp
1767        .headers()
1768        .get("content-type")
1769        .and_then(|v| v.to_str().ok())
1770        .unwrap_or("application/octet-stream");
1771    let content_type = super::ContentType::from(content_type);
1772
1773    if !status.is_client_error() && !status.is_server_error() {
1774        let content = resp.text().await?;
1775        match content_type {
1776            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1777            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DiffFileContent`"))),
1778            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`")))),
1779        }
1780    } else {
1781        let content = resp.text().await?;
1782        let entity: Option<GetCommitFileContentError> = serde_json::from_str(&content).ok();
1783        Err(Error::ResponseError(ResponseContent {
1784            status,
1785            content,
1786            entity,
1787        }))
1788    }
1789}
1790
1791pub async fn get_commits(
1792    configuration: &configuration::Configuration,
1793    repo_ref: &str,
1794    git_ref: Option<&str>,
1795    page: Option<i64>,
1796    size: Option<i64>,
1797    after: Option<&str>,
1798    path: Option<&str>,
1799    since: Option<i64>,
1800    until: Option<i64>,
1801    author: Option<&str>,
1802    include_stats: Option<bool>,
1803) -> Result<Vec<models::CommitWithPathRenameDetails>, Error<GetCommitsError>> {
1804    // add a prefix to parameters to efficiently prevent name collisions
1805    let p_path_repo_ref = repo_ref;
1806    let p_query_git_ref = git_ref;
1807    let p_query_page = page;
1808    let p_query_size = size;
1809    let p_query_after = after;
1810    let p_query_path = path;
1811    let p_query_since = since;
1812    let p_query_until = until;
1813    let p_query_author = author;
1814    let p_query_include_stats = include_stats;
1815
1816    let uri_str = format!(
1817        "{}/repos/{repo_ref}/+/commits",
1818        configuration.base_path,
1819        repo_ref = crate::apis::urlencode(p_path_repo_ref)
1820    );
1821    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1822
1823    if let Some(ref param_value) = p_query_git_ref {
1824        req_builder = req_builder.query(&[("git_ref", &param_value.to_string())]);
1825    }
1826    if let Some(ref param_value) = p_query_page {
1827        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1828    }
1829    if let Some(ref param_value) = p_query_size {
1830        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1831    }
1832    if let Some(ref param_value) = p_query_after {
1833        req_builder = req_builder.query(&[("after", &param_value.to_string())]);
1834    }
1835    if let Some(ref param_value) = p_query_path {
1836        req_builder = req_builder.query(&[("path", &param_value.to_string())]);
1837    }
1838    if let Some(ref param_value) = p_query_since {
1839        req_builder = req_builder.query(&[("since", &param_value.to_string())]);
1840    }
1841    if let Some(ref param_value) = p_query_until {
1842        req_builder = req_builder.query(&[("until", &param_value.to_string())]);
1843    }
1844    if let Some(ref param_value) = p_query_author {
1845        req_builder = req_builder.query(&[("author", &param_value.to_string())]);
1846    }
1847    if let Some(ref param_value) = p_query_include_stats {
1848        req_builder = req_builder.query(&[("include_stats", &param_value.to_string())]);
1849    }
1850    if let Some(ref apikey) = configuration.api_key {
1851        let key = apikey.key.clone();
1852        let value = match apikey.prefix {
1853            Some(ref prefix) => format!("{} {}", prefix, key),
1854            None => key,
1855        };
1856        req_builder = req_builder.query(&[("access_token", value)]);
1857    }
1858    if let Some(ref user_agent) = configuration.user_agent {
1859        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1860    }
1861    if let Some(ref auth_conf) = configuration.basic_auth {
1862        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1863    };
1864    if let Some(ref token) = configuration.bearer_access_token {
1865        req_builder = req_builder.bearer_auth(token.to_owned());
1866    };
1867
1868    let req = req_builder.build()?;
1869    let resp = configuration.client.execute(req).await?;
1870
1871    let status = resp.status();
1872    let content_type = resp
1873        .headers()
1874        .get("content-type")
1875        .and_then(|v| v.to_str().ok())
1876        .unwrap_or("application/octet-stream");
1877    let content_type = super::ContentType::from(content_type);
1878
1879    if !status.is_client_error() && !status.is_server_error() {
1880        let content = resp.text().await?;
1881        match content_type {
1882            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1883            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::CommitWithPathRenameDetails&gt;`"))),
1884            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::CommitWithPathRenameDetails&gt;`")))),
1885        }
1886    } else {
1887        let content = resp.text().await?;
1888        let entity: Option<GetCommitsError> = serde_json::from_str(&content).ok();
1889        Err(Error::ResponseError(ResponseContent {
1890            status,
1891            content,
1892            entity,
1893        }))
1894    }
1895}
1896
1897pub async fn get_contributors(
1898    configuration: &configuration::Configuration,
1899    repo_ref: &str,
1900    git_ref: Option<&str>,
1901    since: Option<i64>,
1902    until: Option<i64>,
1903) -> Result<Vec<models::Contributor>, Error<GetContributorsError>> {
1904    // add a prefix to parameters to efficiently prevent name collisions
1905    let p_path_repo_ref = repo_ref;
1906    let p_query_git_ref = git_ref;
1907    let p_query_since = since;
1908    let p_query_until = until;
1909
1910    let uri_str = format!(
1911        "{}/repos/{repo_ref}/+/contributors",
1912        configuration.base_path,
1913        repo_ref = crate::apis::urlencode(p_path_repo_ref)
1914    );
1915    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1916
1917    if let Some(ref param_value) = p_query_git_ref {
1918        req_builder = req_builder.query(&[("git_ref", &param_value.to_string())]);
1919    }
1920    if let Some(ref param_value) = p_query_since {
1921        req_builder = req_builder.query(&[("since", &param_value.to_string())]);
1922    }
1923    if let Some(ref param_value) = p_query_until {
1924        req_builder = req_builder.query(&[("until", &param_value.to_string())]);
1925    }
1926    if let Some(ref apikey) = configuration.api_key {
1927        let key = apikey.key.clone();
1928        let value = match apikey.prefix {
1929            Some(ref prefix) => format!("{} {}", prefix, key),
1930            None => key,
1931        };
1932        req_builder = req_builder.query(&[("access_token", value)]);
1933    }
1934    if let Some(ref user_agent) = configuration.user_agent {
1935        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1936    }
1937    if let Some(ref auth_conf) = configuration.basic_auth {
1938        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1939    };
1940    if let Some(ref token) = configuration.bearer_access_token {
1941        req_builder = req_builder.bearer_auth(token.to_owned());
1942    };
1943
1944    let req = req_builder.build()?;
1945    let resp = configuration.client.execute(req).await?;
1946
1947    let status = resp.status();
1948    let content_type = resp
1949        .headers()
1950        .get("content-type")
1951        .and_then(|v| v.to_str().ok())
1952        .unwrap_or("application/octet-stream");
1953    let content_type = super::ContentType::from(content_type);
1954
1955    if !status.is_client_error() && !status.is_server_error() {
1956        let content = resp.text().await?;
1957        match content_type {
1958            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1959            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::Contributor&gt;`"))),
1960            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::Contributor&gt;`")))),
1961        }
1962    } else {
1963        let content = resp.text().await?;
1964        let entity: Option<GetContributorsError> = serde_json::from_str(&content).ok();
1965        Err(Error::ResponseError(ResponseContent {
1966            status,
1967            content,
1968            entity,
1969        }))
1970    }
1971}
1972
1973pub async fn get_forks(
1974    configuration: &configuration::Configuration,
1975    repo_ref: &str,
1976    page: Option<i64>,
1977    size: Option<i64>,
1978    query: Option<&str>,
1979    sort: Option<models::RepoSort>,
1980    order: Option<models::OrderOption>,
1981) -> Result<Vec<models::RepositoryModel>, Error<GetForksError>> {
1982    // add a prefix to parameters to efficiently prevent name collisions
1983    let p_path_repo_ref = repo_ref;
1984    let p_query_page = page;
1985    let p_query_size = size;
1986    let p_query_query = query;
1987    let p_query_sort = sort;
1988    let p_query_order = order;
1989
1990    let uri_str = format!(
1991        "{}/repos/{repo_ref}/+/forks",
1992        configuration.base_path,
1993        repo_ref = crate::apis::urlencode(p_path_repo_ref)
1994    );
1995    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1996
1997    if let Some(ref param_value) = p_query_page {
1998        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1999    }
2000    if let Some(ref param_value) = p_query_size {
2001        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
2002    }
2003    if let Some(ref param_value) = p_query_query {
2004        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
2005    }
2006    if let Some(ref param_value) = p_query_sort {
2007        req_builder = req_builder.query(&[("sort", &param_value.to_string())]);
2008    }
2009    if let Some(ref param_value) = p_query_order {
2010        req_builder = req_builder.query(&[("order", &param_value.to_string())]);
2011    }
2012    if let Some(ref apikey) = configuration.api_key {
2013        let key = apikey.key.clone();
2014        let value = match apikey.prefix {
2015            Some(ref prefix) => format!("{} {}", prefix, key),
2016            None => key,
2017        };
2018        req_builder = req_builder.query(&[("access_token", value)]);
2019    }
2020    if let Some(ref user_agent) = configuration.user_agent {
2021        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2022    }
2023    if let Some(ref auth_conf) = configuration.basic_auth {
2024        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2025    };
2026    if let Some(ref token) = configuration.bearer_access_token {
2027        req_builder = req_builder.bearer_auth(token.to_owned());
2028    };
2029
2030    let req = req_builder.build()?;
2031    let resp = configuration.client.execute(req).await?;
2032
2033    let status = resp.status();
2034    let content_type = resp
2035        .headers()
2036        .get("content-type")
2037        .and_then(|v| v.to_str().ok())
2038        .unwrap_or("application/octet-stream");
2039    let content_type = super::ContentType::from(content_type);
2040
2041    if !status.is_client_error() && !status.is_server_error() {
2042        let content = resp.text().await?;
2043        match content_type {
2044            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2045            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::RepositoryModel&gt;`"))),
2046            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::RepositoryModel&gt;`")))),
2047        }
2048    } else {
2049        let content = resp.text().await?;
2050        let entity: Option<GetForksError> = serde_json::from_str(&content).ok();
2051        Err(Error::ResponseError(ResponseContent {
2052            status,
2053            content,
2054            entity,
2055        }))
2056    }
2057}
2058
2059pub async fn get_general(
2060    configuration: &configuration::Configuration,
2061    repo_ref: &str,
2062) -> Result<models::GeneralSettings, Error<GetGeneralError>> {
2063    // add a prefix to parameters to efficiently prevent name collisions
2064    let p_path_repo_ref = repo_ref;
2065
2066    let uri_str = format!(
2067        "{}/repos/{repo_ref}/+/settings/general",
2068        configuration.base_path,
2069        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2070    );
2071    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2072
2073    if let Some(ref apikey) = configuration.api_key {
2074        let key = apikey.key.clone();
2075        let value = match apikey.prefix {
2076            Some(ref prefix) => format!("{} {}", prefix, key),
2077            None => key,
2078        };
2079        req_builder = req_builder.query(&[("access_token", value)]);
2080    }
2081    if let Some(ref user_agent) = configuration.user_agent {
2082        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2083    }
2084    if let Some(ref auth_conf) = configuration.basic_auth {
2085        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2086    };
2087    if let Some(ref token) = configuration.bearer_access_token {
2088        req_builder = req_builder.bearer_auth(token.to_owned());
2089    };
2090
2091    let req = req_builder.build()?;
2092    let resp = configuration.client.execute(req).await?;
2093
2094    let status = resp.status();
2095    let content_type = resp
2096        .headers()
2097        .get("content-type")
2098        .and_then(|v| v.to_str().ok())
2099        .unwrap_or("application/octet-stream");
2100    let content_type = super::ContentType::from(content_type);
2101
2102    if !status.is_client_error() && !status.is_server_error() {
2103        let content = resp.text().await?;
2104        match content_type {
2105            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2106            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralSettings`"))),
2107            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`")))),
2108        }
2109    } else {
2110        let content = resp.text().await?;
2111        let entity: Option<GetGeneralError> = serde_json::from_str(&content).ok();
2112        Err(Error::ResponseError(ResponseContent {
2113            status,
2114            content,
2115            entity,
2116        }))
2117    }
2118}
2119
2120pub async fn get_has_starred(
2121    configuration: &configuration::Configuration,
2122    repo_ref: &str,
2123) -> Result<models::RepositoryStarModel, Error<GetHasStarredError>> {
2124    // add a prefix to parameters to efficiently prevent name collisions
2125    let p_path_repo_ref = repo_ref;
2126
2127    let uri_str = format!(
2128        "{}/repos/{repo_ref}/+/stars/has_starred",
2129        configuration.base_path,
2130        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2131    );
2132    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2133
2134    if let Some(ref apikey) = configuration.api_key {
2135        let key = apikey.key.clone();
2136        let value = match apikey.prefix {
2137            Some(ref prefix) => format!("{} {}", prefix, key),
2138            None => key,
2139        };
2140        req_builder = req_builder.query(&[("access_token", value)]);
2141    }
2142    if let Some(ref user_agent) = configuration.user_agent {
2143        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2144    }
2145    if let Some(ref auth_conf) = configuration.basic_auth {
2146        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2147    };
2148    if let Some(ref token) = configuration.bearer_access_token {
2149        req_builder = req_builder.bearer_auth(token.to_owned());
2150    };
2151
2152    let req = req_builder.build()?;
2153    let resp = configuration.client.execute(req).await?;
2154
2155    let status = resp.status();
2156    let content_type = resp
2157        .headers()
2158        .get("content-type")
2159        .and_then(|v| v.to_str().ok())
2160        .unwrap_or("application/octet-stream");
2161    let content_type = super::ContentType::from(content_type);
2162
2163    if !status.is_client_error() && !status.is_server_error() {
2164        let content = resp.text().await?;
2165        match content_type {
2166            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2167            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryStarModel`"))),
2168            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`")))),
2169        }
2170    } else {
2171        let content = resp.text().await?;
2172        let entity: Option<GetHasStarredError> = serde_json::from_str(&content).ok();
2173        Err(Error::ResponseError(ResponseContent {
2174            status,
2175            content,
2176            entity,
2177        }))
2178    }
2179}
2180
2181pub async fn get_import_progress(
2182    configuration: &configuration::Configuration,
2183    repo_ref: &str,
2184) -> Result<models::JobProgress, Error<GetImportProgressError>> {
2185    // add a prefix to parameters to efficiently prevent name collisions
2186    let p_path_repo_ref = repo_ref;
2187
2188    let uri_str = format!(
2189        "{}/repos/{repo_ref}/+/import-progress",
2190        configuration.base_path,
2191        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2192    );
2193    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2194
2195    if let Some(ref apikey) = configuration.api_key {
2196        let key = apikey.key.clone();
2197        let value = match apikey.prefix {
2198            Some(ref prefix) => format!("{} {}", prefix, key),
2199            None => key,
2200        };
2201        req_builder = req_builder.query(&[("access_token", value)]);
2202    }
2203    if let Some(ref user_agent) = configuration.user_agent {
2204        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2205    }
2206    if let Some(ref auth_conf) = configuration.basic_auth {
2207        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2208    };
2209    if let Some(ref token) = configuration.bearer_access_token {
2210        req_builder = req_builder.bearer_auth(token.to_owned());
2211    };
2212
2213    let req = req_builder.build()?;
2214    let resp = configuration.client.execute(req).await?;
2215
2216    let status = resp.status();
2217    let content_type = resp
2218        .headers()
2219        .get("content-type")
2220        .and_then(|v| v.to_str().ok())
2221        .unwrap_or("application/octet-stream");
2222    let content_type = super::ContentType::from(content_type);
2223
2224    if !status.is_client_error() && !status.is_server_error() {
2225        let content = resp.text().await?;
2226        match content_type {
2227            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2228            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JobProgress`"))),
2229            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`")))),
2230        }
2231    } else {
2232        let content = resp.text().await?;
2233        let entity: Option<GetImportProgressError> = serde_json::from_str(&content).ok();
2234        Err(Error::ResponseError(ResponseContent {
2235            status,
2236            content,
2237            entity,
2238        }))
2239    }
2240}
2241
2242pub async fn get_raw(
2243    configuration: &configuration::Configuration,
2244    repo_ref: &str,
2245    path: &str,
2246    git_ref: Option<&str>,
2247) -> Result<Vec<i32>, Error<GetRawError>> {
2248    // add a prefix to parameters to efficiently prevent name collisions
2249    let p_path_repo_ref = repo_ref;
2250    let p_path_path = path;
2251    let p_query_git_ref = git_ref;
2252
2253    let uri_str = format!(
2254        "{}/repos/{repo_ref}/+/raw/{path}",
2255        configuration.base_path,
2256        repo_ref = crate::apis::urlencode(p_path_repo_ref),
2257        path = crate::apis::urlencode(p_path_path)
2258    );
2259    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2260
2261    if let Some(ref param_value) = p_query_git_ref {
2262        req_builder = req_builder.query(&[("git_ref", &param_value.to_string())]);
2263    }
2264    if let Some(ref apikey) = configuration.api_key {
2265        let key = apikey.key.clone();
2266        let value = match apikey.prefix {
2267            Some(ref prefix) => format!("{} {}", prefix, key),
2268            None => key,
2269        };
2270        req_builder = req_builder.query(&[("access_token", value)]);
2271    }
2272    if let Some(ref user_agent) = configuration.user_agent {
2273        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2274    }
2275    if let Some(ref auth_conf) = configuration.basic_auth {
2276        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2277    };
2278    if let Some(ref token) = configuration.bearer_access_token {
2279        req_builder = req_builder.bearer_auth(token.to_owned());
2280    };
2281
2282    let req = req_builder.build()?;
2283    let resp = configuration.client.execute(req).await?;
2284
2285    let status = resp.status();
2286    let content_type = resp
2287        .headers()
2288        .get("content-type")
2289        .and_then(|v| v.to_str().ok())
2290        .unwrap_or("application/octet-stream");
2291    let content_type = super::ContentType::from(content_type);
2292
2293    if !status.is_client_error() && !status.is_server_error() {
2294        let content = resp.text().await?;
2295        match content_type {
2296            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2297            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;i32&gt;`"))),
2298            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;i32&gt;`")))),
2299        }
2300    } else {
2301        let content = resp.text().await?;
2302        let entity: Option<GetRawError> = serde_json::from_str(&content).ok();
2303        Err(Error::ResponseError(ResponseContent {
2304            status,
2305            content,
2306            entity,
2307        }))
2308    }
2309}
2310
2311pub async fn get_release(
2312    configuration: &configuration::Configuration,
2313    repo_ref: &str,
2314    tag_ref: &str,
2315) -> Result<models::ReleaseCreator, Error<GetReleaseError>> {
2316    // add a prefix to parameters to efficiently prevent name collisions
2317    let p_path_repo_ref = repo_ref;
2318    let p_path_tag_ref = tag_ref;
2319
2320    let uri_str = format!(
2321        "{}/repos/{repo_ref}/+/releases/{tag_ref}",
2322        configuration.base_path,
2323        repo_ref = crate::apis::urlencode(p_path_repo_ref),
2324        tag_ref = crate::apis::urlencode(p_path_tag_ref)
2325    );
2326    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2327
2328    if let Some(ref apikey) = configuration.api_key {
2329        let key = apikey.key.clone();
2330        let value = match apikey.prefix {
2331            Some(ref prefix) => format!("{} {}", prefix, key),
2332            None => key,
2333        };
2334        req_builder = req_builder.query(&[("access_token", value)]);
2335    }
2336    if let Some(ref user_agent) = configuration.user_agent {
2337        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2338    }
2339    if let Some(ref auth_conf) = configuration.basic_auth {
2340        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2341    };
2342    if let Some(ref token) = configuration.bearer_access_token {
2343        req_builder = req_builder.bearer_auth(token.to_owned());
2344    };
2345
2346    let req = req_builder.build()?;
2347    let resp = configuration.client.execute(req).await?;
2348
2349    let status = resp.status();
2350    let content_type = resp
2351        .headers()
2352        .get("content-type")
2353        .and_then(|v| v.to_str().ok())
2354        .unwrap_or("application/octet-stream");
2355    let content_type = super::ContentType::from(content_type);
2356
2357    if !status.is_client_error() && !status.is_server_error() {
2358        let content = resp.text().await?;
2359        match content_type {
2360            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2361            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReleaseCreator`"))),
2362            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`")))),
2363        }
2364    } else {
2365        let content = resp.text().await?;
2366        let entity: Option<GetReleaseError> = serde_json::from_str(&content).ok();
2367        Err(Error::ResponseError(ResponseContent {
2368            status,
2369            content,
2370            entity,
2371        }))
2372    }
2373}
2374
2375pub async fn get_releases(
2376    configuration: &configuration::Configuration,
2377    repo_ref: &str,
2378    page: Option<i64>,
2379    size: Option<i64>,
2380    query: Option<&str>,
2381    sort: Option<models::ReleaseSort>,
2382    order: Option<models::OrderOption>,
2383) -> Result<Vec<models::ReleaseCreator>, Error<GetReleasesError>> {
2384    // add a prefix to parameters to efficiently prevent name collisions
2385    let p_path_repo_ref = repo_ref;
2386    let p_query_page = page;
2387    let p_query_size = size;
2388    let p_query_query = query;
2389    let p_query_sort = sort;
2390    let p_query_order = order;
2391
2392    let uri_str = format!(
2393        "{}/repos/{repo_ref}/+/releases",
2394        configuration.base_path,
2395        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2396    );
2397    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2398
2399    if let Some(ref param_value) = p_query_page {
2400        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2401    }
2402    if let Some(ref param_value) = p_query_size {
2403        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
2404    }
2405    if let Some(ref param_value) = p_query_query {
2406        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
2407    }
2408    if let Some(ref param_value) = p_query_sort {
2409        req_builder = req_builder.query(&[("sort", &param_value.to_string())]);
2410    }
2411    if let Some(ref param_value) = p_query_order {
2412        req_builder = req_builder.query(&[("order", &param_value.to_string())]);
2413    }
2414    if let Some(ref apikey) = configuration.api_key {
2415        let key = apikey.key.clone();
2416        let value = match apikey.prefix {
2417            Some(ref prefix) => format!("{} {}", prefix, key),
2418            None => key,
2419        };
2420        req_builder = req_builder.query(&[("access_token", value)]);
2421    }
2422    if let Some(ref user_agent) = configuration.user_agent {
2423        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2424    }
2425    if let Some(ref auth_conf) = configuration.basic_auth {
2426        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2427    };
2428    if let Some(ref token) = configuration.bearer_access_token {
2429        req_builder = req_builder.bearer_auth(token.to_owned());
2430    };
2431
2432    let req = req_builder.build()?;
2433    let resp = configuration.client.execute(req).await?;
2434
2435    let status = resp.status();
2436    let content_type = resp
2437        .headers()
2438        .get("content-type")
2439        .and_then(|v| v.to_str().ok())
2440        .unwrap_or("application/octet-stream");
2441    let content_type = super::ContentType::from(content_type);
2442
2443    if !status.is_client_error() && !status.is_server_error() {
2444        let content = resp.text().await?;
2445        match content_type {
2446            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2447            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ReleaseCreator&gt;`"))),
2448            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::ReleaseCreator&gt;`")))),
2449        }
2450    } else {
2451        let content = resp.text().await?;
2452        let entity: Option<GetReleasesError> = serde_json::from_str(&content).ok();
2453        Err(Error::ResponseError(ResponseContent {
2454            status,
2455            content,
2456            entity,
2457        }))
2458    }
2459}
2460
2461pub async fn get_repo(
2462    configuration: &configuration::Configuration,
2463    repo_ref: &str,
2464) -> Result<models::RepoParent, Error<GetRepoError>> {
2465    // add a prefix to parameters to efficiently prevent name collisions
2466    let p_path_repo_ref = repo_ref;
2467
2468    let uri_str = format!(
2469        "{}/repos/{repo_ref}/+",
2470        configuration.base_path,
2471        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2472    );
2473    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2474
2475    if let Some(ref apikey) = configuration.api_key {
2476        let key = apikey.key.clone();
2477        let value = match apikey.prefix {
2478            Some(ref prefix) => format!("{} {}", prefix, key),
2479            None => key,
2480        };
2481        req_builder = req_builder.query(&[("access_token", value)]);
2482    }
2483    if let Some(ref user_agent) = configuration.user_agent {
2484        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2485    }
2486    if let Some(ref auth_conf) = configuration.basic_auth {
2487        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2488    };
2489    if let Some(ref token) = configuration.bearer_access_token {
2490        req_builder = req_builder.bearer_auth(token.to_owned());
2491    };
2492
2493    let req = req_builder.build()?;
2494    let resp = configuration.client.execute(req).await?;
2495
2496    let status = resp.status();
2497    let content_type = resp
2498        .headers()
2499        .get("content-type")
2500        .and_then(|v| v.to_str().ok())
2501        .unwrap_or("application/octet-stream");
2502    let content_type = super::ContentType::from(content_type);
2503
2504    if !status.is_client_error() && !status.is_server_error() {
2505        let content = resp.text().await?;
2506        match content_type {
2507            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2508            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoParent`"))),
2509            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`")))),
2510        }
2511    } else {
2512        let content = resp.text().await?;
2513        let entity: Option<GetRepoError> = serde_json::from_str(&content).ok();
2514        Err(Error::ResponseError(ResponseContent {
2515            status,
2516            content,
2517            entity,
2518        }))
2519    }
2520}
2521
2522pub async fn get_repository_reseted_runner_register_token(
2523    configuration: &configuration::Configuration,
2524    repo_ref: &str,
2525) -> Result<models::RegisterTokenModel, Error<GetRepositoryResetedRunnerRegisterTokenError>> {
2526    // add a prefix to parameters to efficiently prevent name collisions
2527    let p_path_repo_ref = repo_ref;
2528
2529    let uri_str = format!(
2530        "{}/repos/{repo_ref}/+/runners/register_token/reseted",
2531        configuration.base_path,
2532        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2533    );
2534    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2535
2536    if let Some(ref apikey) = configuration.api_key {
2537        let key = apikey.key.clone();
2538        let value = match apikey.prefix {
2539            Some(ref prefix) => format!("{} {}", prefix, key),
2540            None => key,
2541        };
2542        req_builder = req_builder.query(&[("access_token", value)]);
2543    }
2544    if let Some(ref user_agent) = configuration.user_agent {
2545        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2546    }
2547    if let Some(ref auth_conf) = configuration.basic_auth {
2548        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2549    };
2550    if let Some(ref token) = configuration.bearer_access_token {
2551        req_builder = req_builder.bearer_auth(token.to_owned());
2552    };
2553
2554    let req = req_builder.build()?;
2555    let resp = configuration.client.execute(req).await?;
2556
2557    let status = resp.status();
2558    let content_type = resp
2559        .headers()
2560        .get("content-type")
2561        .and_then(|v| v.to_str().ok())
2562        .unwrap_or("application/octet-stream");
2563    let content_type = super::ContentType::from(content_type);
2564
2565    if !status.is_client_error() && !status.is_server_error() {
2566        let content = resp.text().await?;
2567        match content_type {
2568            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2569            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterTokenModel`"))),
2570            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`")))),
2571        }
2572    } else {
2573        let content = resp.text().await?;
2574        let entity: Option<GetRepositoryResetedRunnerRegisterTokenError> =
2575            serde_json::from_str(&content).ok();
2576        Err(Error::ResponseError(ResponseContent {
2577            status,
2578            content,
2579            entity,
2580        }))
2581    }
2582}
2583
2584pub async fn get_repository_runner(
2585    configuration: &configuration::Configuration,
2586    repo_ref: &str,
2587    runner_uuid: &str,
2588) -> Result<models::RunnerModel, Error<GetRepositoryRunnerError>> {
2589    // add a prefix to parameters to efficiently prevent name collisions
2590    let p_path_repo_ref = repo_ref;
2591    let p_path_runner_uuid = runner_uuid;
2592
2593    let uri_str = format!(
2594        "{}/repos/{repo_ref}/+/runners/{runner_uuid}",
2595        configuration.base_path,
2596        repo_ref = crate::apis::urlencode(p_path_repo_ref),
2597        runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
2598    );
2599    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2600
2601    if let Some(ref apikey) = configuration.api_key {
2602        let key = apikey.key.clone();
2603        let value = match apikey.prefix {
2604            Some(ref prefix) => format!("{} {}", prefix, key),
2605            None => key,
2606        };
2607        req_builder = req_builder.query(&[("access_token", value)]);
2608    }
2609    if let Some(ref user_agent) = configuration.user_agent {
2610        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2611    }
2612    if let Some(ref auth_conf) = configuration.basic_auth {
2613        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2614    };
2615    if let Some(ref token) = configuration.bearer_access_token {
2616        req_builder = req_builder.bearer_auth(token.to_owned());
2617    };
2618
2619    let req = req_builder.build()?;
2620    let resp = configuration.client.execute(req).await?;
2621
2622    let status = resp.status();
2623    let content_type = resp
2624        .headers()
2625        .get("content-type")
2626        .and_then(|v| v.to_str().ok())
2627        .unwrap_or("application/octet-stream");
2628    let content_type = super::ContentType::from(content_type);
2629
2630    if !status.is_client_error() && !status.is_server_error() {
2631        let content = resp.text().await?;
2632        match content_type {
2633            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2634            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerModel`"))),
2635            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`")))),
2636        }
2637    } else {
2638        let content = resp.text().await?;
2639        let entity: Option<GetRepositoryRunnerError> = serde_json::from_str(&content).ok();
2640        Err(Error::ResponseError(ResponseContent {
2641            status,
2642            content,
2643            entity,
2644        }))
2645    }
2646}
2647
2648pub async fn get_repository_runner_register_token(
2649    configuration: &configuration::Configuration,
2650    repo_ref: &str,
2651) -> Result<models::RegisterTokenModel, Error<GetRepositoryRunnerRegisterTokenError>> {
2652    // add a prefix to parameters to efficiently prevent name collisions
2653    let p_path_repo_ref = repo_ref;
2654
2655    let uri_str = format!(
2656        "{}/repos/{repo_ref}/+/runners/register_token",
2657        configuration.base_path,
2658        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2659    );
2660    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2661
2662    if let Some(ref apikey) = configuration.api_key {
2663        let key = apikey.key.clone();
2664        let value = match apikey.prefix {
2665            Some(ref prefix) => format!("{} {}", prefix, key),
2666            None => key,
2667        };
2668        req_builder = req_builder.query(&[("access_token", value)]);
2669    }
2670    if let Some(ref user_agent) = configuration.user_agent {
2671        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2672    }
2673    if let Some(ref auth_conf) = configuration.basic_auth {
2674        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2675    };
2676    if let Some(ref token) = configuration.bearer_access_token {
2677        req_builder = req_builder.bearer_auth(token.to_owned());
2678    };
2679
2680    let req = req_builder.build()?;
2681    let resp = configuration.client.execute(req).await?;
2682
2683    let status = resp.status();
2684    let content_type = resp
2685        .headers()
2686        .get("content-type")
2687        .and_then(|v| v.to_str().ok())
2688        .unwrap_or("application/octet-stream");
2689    let content_type = super::ContentType::from(content_type);
2690
2691    if !status.is_client_error() && !status.is_server_error() {
2692        let content = resp.text().await?;
2693        match content_type {
2694            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2695            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterTokenModel`"))),
2696            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`")))),
2697        }
2698    } else {
2699        let content = resp.text().await?;
2700        let entity: Option<GetRepositoryRunnerRegisterTokenError> =
2701            serde_json::from_str(&content).ok();
2702        Err(Error::ResponseError(ResponseContent {
2703            status,
2704            content,
2705            entity,
2706        }))
2707    }
2708}
2709
2710pub async fn get_repository_runners(
2711    configuration: &configuration::Configuration,
2712    repo_ref: &str,
2713    page: Option<i64>,
2714    size: Option<i64>,
2715    query: Option<&str>,
2716) -> Result<Vec<models::RunnerCreator>, Error<GetRepositoryRunnersError>> {
2717    // add a prefix to parameters to efficiently prevent name collisions
2718    let p_path_repo_ref = repo_ref;
2719    let p_query_page = page;
2720    let p_query_size = size;
2721    let p_query_query = query;
2722
2723    let uri_str = format!(
2724        "{}/repos/{repo_ref}/+/runners",
2725        configuration.base_path,
2726        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2727    );
2728    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2729
2730    if let Some(ref param_value) = p_query_page {
2731        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2732    }
2733    if let Some(ref param_value) = p_query_size {
2734        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
2735    }
2736    if let Some(ref param_value) = p_query_query {
2737        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
2738    }
2739    if let Some(ref apikey) = configuration.api_key {
2740        let key = apikey.key.clone();
2741        let value = match apikey.prefix {
2742            Some(ref prefix) => format!("{} {}", prefix, key),
2743            None => key,
2744        };
2745        req_builder = req_builder.query(&[("access_token", value)]);
2746    }
2747    if let Some(ref user_agent) = configuration.user_agent {
2748        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2749    }
2750    if let Some(ref auth_conf) = configuration.basic_auth {
2751        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2752    };
2753    if let Some(ref token) = configuration.bearer_access_token {
2754        req_builder = req_builder.bearer_auth(token.to_owned());
2755    };
2756
2757    let req = req_builder.build()?;
2758    let resp = configuration.client.execute(req).await?;
2759
2760    let status = resp.status();
2761    let content_type = resp
2762        .headers()
2763        .get("content-type")
2764        .and_then(|v| v.to_str().ok())
2765        .unwrap_or("application/octet-stream");
2766    let content_type = super::ContentType::from(content_type);
2767
2768    if !status.is_client_error() && !status.is_server_error() {
2769        let content = resp.text().await?;
2770        match content_type {
2771            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2772            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::RunnerCreator&gt;`"))),
2773            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::RunnerCreator&gt;`")))),
2774        }
2775    } else {
2776        let content = resp.text().await?;
2777        let entity: Option<GetRepositoryRunnersError> = serde_json::from_str(&content).ok();
2778        Err(Error::ResponseError(ResponseContent {
2779            status,
2780            content,
2781            entity,
2782        }))
2783    }
2784}
2785
2786pub async fn get_repository_service_accounts(
2787    configuration: &configuration::Configuration,
2788    repo_ref: &str,
2789) -> Result<Vec<models::UserModel>, Error<GetRepositoryServiceAccountsError>> {
2790    // add a prefix to parameters to efficiently prevent name collisions
2791    let p_path_repo_ref = repo_ref;
2792
2793    let uri_str = format!(
2794        "{}/repos/{repo_ref}/+/service-accounts",
2795        configuration.base_path,
2796        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2797    );
2798    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2799
2800    if let Some(ref apikey) = configuration.api_key {
2801        let key = apikey.key.clone();
2802        let value = match apikey.prefix {
2803            Some(ref prefix) => format!("{} {}", prefix, key),
2804            None => key,
2805        };
2806        req_builder = req_builder.query(&[("access_token", value)]);
2807    }
2808    if let Some(ref user_agent) = configuration.user_agent {
2809        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2810    }
2811    if let Some(ref auth_conf) = configuration.basic_auth {
2812        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2813    };
2814    if let Some(ref token) = configuration.bearer_access_token {
2815        req_builder = req_builder.bearer_auth(token.to_owned());
2816    };
2817
2818    let req = req_builder.build()?;
2819    let resp = configuration.client.execute(req).await?;
2820
2821    let status = resp.status();
2822    let content_type = resp
2823        .headers()
2824        .get("content-type")
2825        .and_then(|v| v.to_str().ok())
2826        .unwrap_or("application/octet-stream");
2827    let content_type = super::ContentType::from(content_type);
2828
2829    if !status.is_client_error() && !status.is_server_error() {
2830        let content = resp.text().await?;
2831        match content_type {
2832            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2833            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UserModel&gt;`"))),
2834            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UserModel&gt;`")))),
2835        }
2836    } else {
2837        let content = resp.text().await?;
2838        let entity: Option<GetRepositoryServiceAccountsError> = serde_json::from_str(&content).ok();
2839        Err(Error::ResponseError(ResponseContent {
2840            status,
2841            content,
2842            entity,
2843        }))
2844    }
2845}
2846
2847pub async fn get_repository_stats(
2848    configuration: &configuration::Configuration,
2849    repo_ref: &str,
2850) -> Result<models::RepoStatsOutput, Error<GetRepositoryStatsError>> {
2851    // add a prefix to parameters to efficiently prevent name collisions
2852    let p_path_repo_ref = repo_ref;
2853
2854    let uri_str = format!(
2855        "{}/repos/{repo_ref}/+/stats",
2856        configuration.base_path,
2857        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2858    );
2859    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2860
2861    if let Some(ref apikey) = configuration.api_key {
2862        let key = apikey.key.clone();
2863        let value = match apikey.prefix {
2864            Some(ref prefix) => format!("{} {}", prefix, key),
2865            None => key,
2866        };
2867        req_builder = req_builder.query(&[("access_token", value)]);
2868    }
2869    if let Some(ref user_agent) = configuration.user_agent {
2870        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2871    }
2872    if let Some(ref auth_conf) = configuration.basic_auth {
2873        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2874    };
2875    if let Some(ref token) = configuration.bearer_access_token {
2876        req_builder = req_builder.bearer_auth(token.to_owned());
2877    };
2878
2879    let req = req_builder.build()?;
2880    let resp = configuration.client.execute(req).await?;
2881
2882    let status = resp.status();
2883    let content_type = resp
2884        .headers()
2885        .get("content-type")
2886        .and_then(|v| v.to_str().ok())
2887        .unwrap_or("application/octet-stream");
2888    let content_type = super::ContentType::from(content_type);
2889
2890    if !status.is_client_error() && !status.is_server_error() {
2891        let content = resp.text().await?;
2892        match content_type {
2893            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2894            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoStatsOutput`"))),
2895            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`")))),
2896        }
2897    } else {
2898        let content = resp.text().await?;
2899        let entity: Option<GetRepositoryStatsError> = serde_json::from_str(&content).ok();
2900        Err(Error::ResponseError(ResponseContent {
2901            status,
2902            content,
2903            entity,
2904        }))
2905    }
2906}
2907
2908pub async fn get_repository_variable(
2909    configuration: &configuration::Configuration,
2910    repo_ref: &str,
2911    variable_identifier: &str,
2912) -> Result<models::VariableModel, Error<GetRepositoryVariableError>> {
2913    // add a prefix to parameters to efficiently prevent name collisions
2914    let p_path_repo_ref = repo_ref;
2915    let p_path_variable_identifier = variable_identifier;
2916
2917    let uri_str = format!(
2918        "{}/repos/{repo_ref}/+/variables/{variable_identifier}",
2919        configuration.base_path,
2920        repo_ref = crate::apis::urlencode(p_path_repo_ref),
2921        variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
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::VariableModel`"))),
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::VariableModel`")))),
2960        }
2961    } else {
2962        let content = resp.text().await?;
2963        let entity: Option<GetRepositoryVariableError> = 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_variables(
2973    configuration: &configuration::Configuration,
2974    repo_ref: &str,
2975    page: Option<i64>,
2976    size: Option<i64>,
2977    query: Option<&str>,
2978    types: Option<Vec<models::VariableType>>,
2979    sort: Option<models::VariableSort>,
2980    order: Option<models::OrderOption>,
2981) -> Result<Vec<models::VariableGroup>, Error<GetRepositoryVariablesError>> {
2982    // add a prefix to parameters to efficiently prevent name collisions
2983    let p_path_repo_ref = repo_ref;
2984    let p_query_page = page;
2985    let p_query_size = size;
2986    let p_query_query = query;
2987    let p_query_types = types;
2988    let p_query_sort = sort;
2989    let p_query_order = order;
2990
2991    let uri_str = format!(
2992        "{}/repos/{repo_ref}/+/variables",
2993        configuration.base_path,
2994        repo_ref = crate::apis::urlencode(p_path_repo_ref)
2995    );
2996    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2997
2998    if let Some(ref param_value) = p_query_page {
2999        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3000    }
3001    if let Some(ref param_value) = p_query_size {
3002        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
3003    }
3004    if let Some(ref param_value) = p_query_query {
3005        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
3006    }
3007    if let Some(ref param_value) = p_query_types {
3008        req_builder = match "multi" {
3009            "multi" => req_builder.query(
3010                &param_value
3011                    .iter()
3012                    .map(|p| ("types".to_owned(), p.to_string()))
3013                    .collect::<Vec<(std::string::String, std::string::String)>>(),
3014            ),
3015            _ => req_builder.query(&[(
3016                "types",
3017                &param_value
3018                    .iter()
3019                    .map(|p| p.to_string())
3020                    .collect::<Vec<String>>()
3021                    .join(",")
3022                    .to_string(),
3023            )]),
3024        };
3025    }
3026    if let Some(ref param_value) = p_query_sort {
3027        req_builder = req_builder.query(&[("sort", &param_value.to_string())]);
3028    }
3029    if let Some(ref param_value) = p_query_order {
3030        req_builder = req_builder.query(&[("order", &param_value.to_string())]);
3031    }
3032    if let Some(ref apikey) = configuration.api_key {
3033        let key = apikey.key.clone();
3034        let value = match apikey.prefix {
3035            Some(ref prefix) => format!("{} {}", prefix, key),
3036            None => key,
3037        };
3038        req_builder = req_builder.query(&[("access_token", value)]);
3039    }
3040    if let Some(ref user_agent) = configuration.user_agent {
3041        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3042    }
3043    if let Some(ref auth_conf) = configuration.basic_auth {
3044        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3045    };
3046    if let Some(ref token) = configuration.bearer_access_token {
3047        req_builder = req_builder.bearer_auth(token.to_owned());
3048    };
3049
3050    let req = req_builder.build()?;
3051    let resp = configuration.client.execute(req).await?;
3052
3053    let status = resp.status();
3054    let content_type = resp
3055        .headers()
3056        .get("content-type")
3057        .and_then(|v| v.to_str().ok())
3058        .unwrap_or("application/octet-stream");
3059    let content_type = super::ContentType::from(content_type);
3060
3061    if !status.is_client_error() && !status.is_server_error() {
3062        let content = resp.text().await?;
3063        match content_type {
3064            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3065            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::VariableGroup&gt;`"))),
3066            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::VariableGroup&gt;`")))),
3067        }
3068    } else {
3069        let content = resp.text().await?;
3070        let entity: Option<GetRepositoryVariablesError> = serde_json::from_str(&content).ok();
3071        Err(Error::ResponseError(ResponseContent {
3072            status,
3073            content,
3074            entity,
3075        }))
3076    }
3077}
3078
3079pub async fn get_security(
3080    configuration: &configuration::Configuration,
3081    repo_ref: &str,
3082) -> Result<models::SecuritySettings, Error<GetSecurityError>> {
3083    // add a prefix to parameters to efficiently prevent name collisions
3084    let p_path_repo_ref = repo_ref;
3085
3086    let uri_str = format!(
3087        "{}/repos/{repo_ref}/+/settings/security",
3088        configuration.base_path,
3089        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3090    );
3091    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3092
3093    if let Some(ref apikey) = configuration.api_key {
3094        let key = apikey.key.clone();
3095        let value = match apikey.prefix {
3096            Some(ref prefix) => format!("{} {}", prefix, key),
3097            None => key,
3098        };
3099        req_builder = req_builder.query(&[("access_token", value)]);
3100    }
3101    if let Some(ref user_agent) = configuration.user_agent {
3102        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3103    }
3104    if let Some(ref auth_conf) = configuration.basic_auth {
3105        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3106    };
3107    if let Some(ref token) = configuration.bearer_access_token {
3108        req_builder = req_builder.bearer_auth(token.to_owned());
3109    };
3110
3111    let req = req_builder.build()?;
3112    let resp = configuration.client.execute(req).await?;
3113
3114    let status = resp.status();
3115    let content_type = resp
3116        .headers()
3117        .get("content-type")
3118        .and_then(|v| v.to_str().ok())
3119        .unwrap_or("application/octet-stream");
3120    let content_type = super::ContentType::from(content_type);
3121
3122    if !status.is_client_error() && !status.is_server_error() {
3123        let content = resp.text().await?;
3124        match content_type {
3125            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3126            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecuritySettings`"))),
3127            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`")))),
3128        }
3129    } else {
3130        let content = resp.text().await?;
3131        let entity: Option<GetSecurityError> = serde_json::from_str(&content).ok();
3132        Err(Error::ResponseError(ResponseContent {
3133            status,
3134            content,
3135            entity,
3136        }))
3137    }
3138}
3139
3140pub async fn get_stars(
3141    configuration: &configuration::Configuration,
3142    repo_ref: &str,
3143    page: Option<i64>,
3144    size: Option<i64>,
3145    query: Option<&str>,
3146    sort: Option<models::UserSort>,
3147    order: Option<models::OrderOption>,
3148) -> Result<Vec<models::UserModel>, Error<GetStarsError>> {
3149    // add a prefix to parameters to efficiently prevent name collisions
3150    let p_path_repo_ref = repo_ref;
3151    let p_query_page = page;
3152    let p_query_size = size;
3153    let p_query_query = query;
3154    let p_query_sort = sort;
3155    let p_query_order = order;
3156
3157    let uri_str = format!(
3158        "{}/repos/{repo_ref}/+/stars",
3159        configuration.base_path,
3160        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3161    );
3162    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3163
3164    if let Some(ref param_value) = p_query_page {
3165        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3166    }
3167    if let Some(ref param_value) = p_query_size {
3168        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
3169    }
3170    if let Some(ref param_value) = p_query_query {
3171        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
3172    }
3173    if let Some(ref param_value) = p_query_sort {
3174        req_builder = req_builder.query(&[("sort", &param_value.to_string())]);
3175    }
3176    if let Some(ref param_value) = p_query_order {
3177        req_builder = req_builder.query(&[("order", &param_value.to_string())]);
3178    }
3179    if let Some(ref apikey) = configuration.api_key {
3180        let key = apikey.key.clone();
3181        let value = match apikey.prefix {
3182            Some(ref prefix) => format!("{} {}", prefix, key),
3183            None => key,
3184        };
3185        req_builder = req_builder.query(&[("access_token", value)]);
3186    }
3187    if let Some(ref user_agent) = configuration.user_agent {
3188        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3189    }
3190    if let Some(ref auth_conf) = configuration.basic_auth {
3191        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3192    };
3193    if let Some(ref token) = configuration.bearer_access_token {
3194        req_builder = req_builder.bearer_auth(token.to_owned());
3195    };
3196
3197    let req = req_builder.build()?;
3198    let resp = configuration.client.execute(req).await?;
3199
3200    let status = resp.status();
3201    let content_type = resp
3202        .headers()
3203        .get("content-type")
3204        .and_then(|v| v.to_str().ok())
3205        .unwrap_or("application/octet-stream");
3206    let content_type = super::ContentType::from(content_type);
3207
3208    if !status.is_client_error() && !status.is_server_error() {
3209        let content = resp.text().await?;
3210        match content_type {
3211            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3212            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UserModel&gt;`"))),
3213            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UserModel&gt;`")))),
3214        }
3215    } else {
3216        let content = resp.text().await?;
3217        let entity: Option<GetStarsError> = serde_json::from_str(&content).ok();
3218        Err(Error::ResponseError(ResponseContent {
3219            status,
3220            content,
3221            entity,
3222        }))
3223    }
3224}
3225
3226pub async fn get_tags(
3227    configuration: &configuration::Configuration,
3228    repo_ref: &str,
3229    page: Option<i64>,
3230    size: Option<i64>,
3231    query: Option<&str>,
3232    include_commit: Option<bool>,
3233) -> Result<Vec<models::CommitTag>, Error<GetTagsError>> {
3234    // add a prefix to parameters to efficiently prevent name collisions
3235    let p_path_repo_ref = repo_ref;
3236    let p_query_page = page;
3237    let p_query_size = size;
3238    let p_query_query = query;
3239    let p_query_include_commit = include_commit;
3240
3241    let uri_str = format!(
3242        "{}/repos/{repo_ref}/+/tags",
3243        configuration.base_path,
3244        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3245    );
3246    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3247
3248    if let Some(ref param_value) = p_query_page {
3249        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3250    }
3251    if let Some(ref param_value) = p_query_size {
3252        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
3253    }
3254    if let Some(ref param_value) = p_query_query {
3255        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
3256    }
3257    if let Some(ref param_value) = p_query_include_commit {
3258        req_builder = req_builder.query(&[("include_commit", &param_value.to_string())]);
3259    }
3260    if let Some(ref apikey) = configuration.api_key {
3261        let key = apikey.key.clone();
3262        let value = match apikey.prefix {
3263            Some(ref prefix) => format!("{} {}", prefix, key),
3264            None => key,
3265        };
3266        req_builder = req_builder.query(&[("access_token", value)]);
3267    }
3268    if let Some(ref user_agent) = configuration.user_agent {
3269        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3270    }
3271    if let Some(ref auth_conf) = configuration.basic_auth {
3272        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3273    };
3274    if let Some(ref token) = configuration.bearer_access_token {
3275        req_builder = req_builder.bearer_auth(token.to_owned());
3276    };
3277
3278    let req = req_builder.build()?;
3279    let resp = configuration.client.execute(req).await?;
3280
3281    let status = resp.status();
3282    let content_type = resp
3283        .headers()
3284        .get("content-type")
3285        .and_then(|v| v.to_str().ok())
3286        .unwrap_or("application/octet-stream");
3287    let content_type = super::ContentType::from(content_type);
3288
3289    if !status.is_client_error() && !status.is_server_error() {
3290        let content = resp.text().await?;
3291        match content_type {
3292            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3293            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::CommitTag&gt;`"))),
3294            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::CommitTag&gt;`")))),
3295        }
3296    } else {
3297        let content = resp.text().await?;
3298        let entity: Option<GetTagsError> = serde_json::from_str(&content).ok();
3299        Err(Error::ResponseError(ResponseContent {
3300            status,
3301            content,
3302            entity,
3303        }))
3304    }
3305}
3306
3307pub async fn patch_repo(
3308    configuration: &configuration::Configuration,
3309    repo_ref: &str,
3310    repo_update_input: models::RepoUpdateInput,
3311) -> Result<models::RepositoryModel, Error<PatchRepoError>> {
3312    // add a prefix to parameters to efficiently prevent name collisions
3313    let p_path_repo_ref = repo_ref;
3314    let p_body_repo_update_input = repo_update_input;
3315
3316    let uri_str = format!(
3317        "{}/repos/{repo_ref}/+",
3318        configuration.base_path,
3319        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3320    );
3321    let mut req_builder = configuration
3322        .client
3323        .request(reqwest::Method::PATCH, &uri_str);
3324
3325    if let Some(ref apikey) = configuration.api_key {
3326        let key = apikey.key.clone();
3327        let value = match apikey.prefix {
3328            Some(ref prefix) => format!("{} {}", prefix, key),
3329            None => key,
3330        };
3331        req_builder = req_builder.query(&[("access_token", value)]);
3332    }
3333    if let Some(ref user_agent) = configuration.user_agent {
3334        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3335    }
3336    if let Some(ref auth_conf) = configuration.basic_auth {
3337        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3338    };
3339    if let Some(ref token) = configuration.bearer_access_token {
3340        req_builder = req_builder.bearer_auth(token.to_owned());
3341    };
3342    req_builder = req_builder.json(&p_body_repo_update_input);
3343
3344    let req = req_builder.build()?;
3345    let resp = configuration.client.execute(req).await?;
3346
3347    let status = resp.status();
3348    let content_type = resp
3349        .headers()
3350        .get("content-type")
3351        .and_then(|v| v.to_str().ok())
3352        .unwrap_or("application/octet-stream");
3353    let content_type = super::ContentType::from(content_type);
3354
3355    if !status.is_client_error() && !status.is_server_error() {
3356        let content = resp.text().await?;
3357        match content_type {
3358            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3359            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
3360            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`")))),
3361        }
3362    } else {
3363        let content = resp.text().await?;
3364        let entity: Option<PatchRepoError> = serde_json::from_str(&content).ok();
3365        Err(Error::ResponseError(ResponseContent {
3366            status,
3367            content,
3368            entity,
3369        }))
3370    }
3371}
3372
3373pub async fn patch_repository_runner(
3374    configuration: &configuration::Configuration,
3375    repo_ref: &str,
3376    runner_uuid: &str,
3377    runner_patch_input: models::RunnerPatchInput,
3378) -> Result<models::RunnerModel, Error<PatchRepositoryRunnerError>> {
3379    // add a prefix to parameters to efficiently prevent name collisions
3380    let p_path_repo_ref = repo_ref;
3381    let p_path_runner_uuid = runner_uuid;
3382    let p_body_runner_patch_input = runner_patch_input;
3383
3384    let uri_str = format!(
3385        "{}/repos/{repo_ref}/+/runners/{runner_uuid}",
3386        configuration.base_path,
3387        repo_ref = crate::apis::urlencode(p_path_repo_ref),
3388        runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
3389    );
3390    let mut req_builder = configuration
3391        .client
3392        .request(reqwest::Method::PATCH, &uri_str);
3393
3394    if let Some(ref apikey) = configuration.api_key {
3395        let key = apikey.key.clone();
3396        let value = match apikey.prefix {
3397            Some(ref prefix) => format!("{} {}", prefix, key),
3398            None => key,
3399        };
3400        req_builder = req_builder.query(&[("access_token", value)]);
3401    }
3402    if let Some(ref user_agent) = configuration.user_agent {
3403        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3404    }
3405    if let Some(ref auth_conf) = configuration.basic_auth {
3406        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3407    };
3408    if let Some(ref token) = configuration.bearer_access_token {
3409        req_builder = req_builder.bearer_auth(token.to_owned());
3410    };
3411    req_builder = req_builder.json(&p_body_runner_patch_input);
3412
3413    let req = req_builder.build()?;
3414    let resp = configuration.client.execute(req).await?;
3415
3416    let status = resp.status();
3417    let content_type = resp
3418        .headers()
3419        .get("content-type")
3420        .and_then(|v| v.to_str().ok())
3421        .unwrap_or("application/octet-stream");
3422    let content_type = super::ContentType::from(content_type);
3423
3424    if !status.is_client_error() && !status.is_server_error() {
3425        let content = resp.text().await?;
3426        match content_type {
3427            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3428            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerModel`"))),
3429            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`")))),
3430        }
3431    } else {
3432        let content = resp.text().await?;
3433        let entity: Option<PatchRepositoryRunnerError> = serde_json::from_str(&content).ok();
3434        Err(Error::ResponseError(ResponseContent {
3435            status,
3436            content,
3437            entity,
3438        }))
3439    }
3440}
3441
3442pub async fn patch_repository_variable(
3443    configuration: &configuration::Configuration,
3444    repo_ref: &str,
3445    variable_identifier: &str,
3446    variable_patch_input: models::VariablePatchInput,
3447) -> Result<models::VariableModel, Error<PatchRepositoryVariableError>> {
3448    // add a prefix to parameters to efficiently prevent name collisions
3449    let p_path_repo_ref = repo_ref;
3450    let p_path_variable_identifier = variable_identifier;
3451    let p_body_variable_patch_input = variable_patch_input;
3452
3453    let uri_str = format!(
3454        "{}/repos/{repo_ref}/+/variables/{variable_identifier}",
3455        configuration.base_path,
3456        repo_ref = crate::apis::urlencode(p_path_repo_ref),
3457        variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
3458    );
3459    let mut req_builder = configuration
3460        .client
3461        .request(reqwest::Method::PATCH, &uri_str);
3462
3463    if let Some(ref apikey) = configuration.api_key {
3464        let key = apikey.key.clone();
3465        let value = match apikey.prefix {
3466            Some(ref prefix) => format!("{} {}", prefix, key),
3467            None => key,
3468        };
3469        req_builder = req_builder.query(&[("access_token", value)]);
3470    }
3471    if let Some(ref user_agent) = configuration.user_agent {
3472        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3473    }
3474    if let Some(ref auth_conf) = configuration.basic_auth {
3475        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3476    };
3477    if let Some(ref token) = configuration.bearer_access_token {
3478        req_builder = req_builder.bearer_auth(token.to_owned());
3479    };
3480    req_builder = req_builder.json(&p_body_variable_patch_input);
3481
3482    let req = req_builder.build()?;
3483    let resp = configuration.client.execute(req).await?;
3484
3485    let status = resp.status();
3486    let content_type = resp
3487        .headers()
3488        .get("content-type")
3489        .and_then(|v| v.to_str().ok())
3490        .unwrap_or("application/octet-stream");
3491    let content_type = super::ContentType::from(content_type);
3492
3493    if !status.is_client_error() && !status.is_server_error() {
3494        let content = resp.text().await?;
3495        match content_type {
3496            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3497            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
3498            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`")))),
3499        }
3500    } else {
3501        let content = resp.text().await?;
3502        let entity: Option<PatchRepositoryVariableError> = serde_json::from_str(&content).ok();
3503        Err(Error::ResponseError(ResponseContent {
3504            status,
3505            content,
3506            entity,
3507        }))
3508    }
3509}
3510
3511pub async fn patch_security(
3512    configuration: &configuration::Configuration,
3513    repo_ref: &str,
3514    security_settings: models::SecuritySettings,
3515) -> Result<models::SecuritySettings, Error<PatchSecurityError>> {
3516    // add a prefix to parameters to efficiently prevent name collisions
3517    let p_path_repo_ref = repo_ref;
3518    let p_body_security_settings = security_settings;
3519
3520    let uri_str = format!(
3521        "{}/repos/{repo_ref}/+/settings/security",
3522        configuration.base_path,
3523        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3524    );
3525    let mut req_builder = configuration
3526        .client
3527        .request(reqwest::Method::PATCH, &uri_str);
3528
3529    if let Some(ref apikey) = configuration.api_key {
3530        let key = apikey.key.clone();
3531        let value = match apikey.prefix {
3532            Some(ref prefix) => format!("{} {}", prefix, key),
3533            None => key,
3534        };
3535        req_builder = req_builder.query(&[("access_token", value)]);
3536    }
3537    if let Some(ref user_agent) = configuration.user_agent {
3538        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3539    }
3540    if let Some(ref auth_conf) = configuration.basic_auth {
3541        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3542    };
3543    if let Some(ref token) = configuration.bearer_access_token {
3544        req_builder = req_builder.bearer_auth(token.to_owned());
3545    };
3546    req_builder = req_builder.json(&p_body_security_settings);
3547
3548    let req = req_builder.build()?;
3549    let resp = configuration.client.execute(req).await?;
3550
3551    let status = resp.status();
3552    let content_type = resp
3553        .headers()
3554        .get("content-type")
3555        .and_then(|v| v.to_str().ok())
3556        .unwrap_or("application/octet-stream");
3557    let content_type = super::ContentType::from(content_type);
3558
3559    if !status.is_client_error() && !status.is_server_error() {
3560        let content = resp.text().await?;
3561        match content_type {
3562            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3563            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecuritySettings`"))),
3564            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`")))),
3565        }
3566    } else {
3567        let content = resp.text().await?;
3568        let entity: Option<PatchSecurityError> = serde_json::from_str(&content).ok();
3569        Err(Error::ResponseError(ResponseContent {
3570            status,
3571            content,
3572            entity,
3573        }))
3574    }
3575}
3576
3577pub async fn patch_stars(
3578    configuration: &configuration::Configuration,
3579    repo_ref: &str,
3580    repo_stars_input: models::RepoStarsInput,
3581) -> Result<models::RepositoryModel, Error<PatchStarsError>> {
3582    // add a prefix to parameters to efficiently prevent name collisions
3583    let p_path_repo_ref = repo_ref;
3584    let p_body_repo_stars_input = repo_stars_input;
3585
3586    let uri_str = format!(
3587        "{}/repos/{repo_ref}/+/stars",
3588        configuration.base_path,
3589        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3590    );
3591    let mut req_builder = configuration
3592        .client
3593        .request(reqwest::Method::PATCH, &uri_str);
3594
3595    if let Some(ref apikey) = configuration.api_key {
3596        let key = apikey.key.clone();
3597        let value = match apikey.prefix {
3598            Some(ref prefix) => format!("{} {}", prefix, key),
3599            None => key,
3600        };
3601        req_builder = req_builder.query(&[("access_token", value)]);
3602    }
3603    if let Some(ref user_agent) = configuration.user_agent {
3604        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3605    }
3606    if let Some(ref auth_conf) = configuration.basic_auth {
3607        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3608    };
3609    if let Some(ref token) = configuration.bearer_access_token {
3610        req_builder = req_builder.bearer_auth(token.to_owned());
3611    };
3612    req_builder = req_builder.json(&p_body_repo_stars_input);
3613
3614    let req = req_builder.build()?;
3615    let resp = configuration.client.execute(req).await?;
3616
3617    let status = resp.status();
3618    let content_type = resp
3619        .headers()
3620        .get("content-type")
3621        .and_then(|v| v.to_str().ok())
3622        .unwrap_or("application/octet-stream");
3623    let content_type = super::ContentType::from(content_type);
3624
3625    if !status.is_client_error() && !status.is_server_error() {
3626        let content = resp.text().await?;
3627        match content_type {
3628            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3629            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
3630            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`")))),
3631        }
3632    } else {
3633        let content = resp.text().await?;
3634        let entity: Option<PatchStarsError> = serde_json::from_str(&content).ok();
3635        Err(Error::ResponseError(ResponseContent {
3636            status,
3637            content,
3638            entity,
3639        }))
3640    }
3641}
3642
3643pub async fn post_branch(
3644    configuration: &configuration::Configuration,
3645    repo_ref: &str,
3646    branch_create_input: models::BranchCreateInput,
3647) -> Result<models::CommitBranch, Error<PostBranchError>> {
3648    // add a prefix to parameters to efficiently prevent name collisions
3649    let p_path_repo_ref = repo_ref;
3650    let p_body_branch_create_input = branch_create_input;
3651
3652    let uri_str = format!(
3653        "{}/repos/{repo_ref}/+/branches",
3654        configuration.base_path,
3655        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3656    );
3657    let mut req_builder = configuration
3658        .client
3659        .request(reqwest::Method::POST, &uri_str);
3660
3661    if let Some(ref apikey) = configuration.api_key {
3662        let key = apikey.key.clone();
3663        let value = match apikey.prefix {
3664            Some(ref prefix) => format!("{} {}", prefix, key),
3665            None => key,
3666        };
3667        req_builder = req_builder.query(&[("access_token", value)]);
3668    }
3669    if let Some(ref user_agent) = configuration.user_agent {
3670        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3671    }
3672    if let Some(ref auth_conf) = configuration.basic_auth {
3673        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3674    };
3675    if let Some(ref token) = configuration.bearer_access_token {
3676        req_builder = req_builder.bearer_auth(token.to_owned());
3677    };
3678    req_builder = req_builder.json(&p_body_branch_create_input);
3679
3680    let req = req_builder.build()?;
3681    let resp = configuration.client.execute(req).await?;
3682
3683    let status = resp.status();
3684    let content_type = resp
3685        .headers()
3686        .get("content-type")
3687        .and_then(|v| v.to_str().ok())
3688        .unwrap_or("application/octet-stream");
3689    let content_type = super::ContentType::from(content_type);
3690
3691    if !status.is_client_error() && !status.is_server_error() {
3692        let content = resp.text().await?;
3693        match content_type {
3694            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3695            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitBranch`"))),
3696            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`")))),
3697        }
3698    } else {
3699        let content = resp.text().await?;
3700        let entity: Option<PostBranchError> = serde_json::from_str(&content).ok();
3701        Err(Error::ResponseError(ResponseContent {
3702            status,
3703            content,
3704            entity,
3705        }))
3706    }
3707}
3708
3709pub async fn post_default_branch(
3710    configuration: &configuration::Configuration,
3711    repo_ref: &str,
3712    repo_update_default_branch_input: models::RepoUpdateDefaultBranchInput,
3713) -> Result<models::RepositoryModel, Error<PostDefaultBranchError>> {
3714    // add a prefix to parameters to efficiently prevent name collisions
3715    let p_path_repo_ref = repo_ref;
3716    let p_body_repo_update_default_branch_input = repo_update_default_branch_input;
3717
3718    let uri_str = format!(
3719        "{}/repos/{repo_ref}/+/default-branch",
3720        configuration.base_path,
3721        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3722    );
3723    let mut req_builder = configuration
3724        .client
3725        .request(reqwest::Method::POST, &uri_str);
3726
3727    if let Some(ref apikey) = configuration.api_key {
3728        let key = apikey.key.clone();
3729        let value = match apikey.prefix {
3730            Some(ref prefix) => format!("{} {}", prefix, key),
3731            None => key,
3732        };
3733        req_builder = req_builder.query(&[("access_token", value)]);
3734    }
3735    if let Some(ref user_agent) = configuration.user_agent {
3736        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3737    }
3738    if let Some(ref auth_conf) = configuration.basic_auth {
3739        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3740    };
3741    if let Some(ref token) = configuration.bearer_access_token {
3742        req_builder = req_builder.bearer_auth(token.to_owned());
3743    };
3744    req_builder = req_builder.json(&p_body_repo_update_default_branch_input);
3745
3746    let req = req_builder.build()?;
3747    let resp = configuration.client.execute(req).await?;
3748
3749    let status = resp.status();
3750    let content_type = resp
3751        .headers()
3752        .get("content-type")
3753        .and_then(|v| v.to_str().ok())
3754        .unwrap_or("application/octet-stream");
3755    let content_type = super::ContentType::from(content_type);
3756
3757    if !status.is_client_error() && !status.is_server_error() {
3758        let content = resp.text().await?;
3759        match content_type {
3760            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3761            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
3762            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`")))),
3763        }
3764    } else {
3765        let content = resp.text().await?;
3766        let entity: Option<PostDefaultBranchError> = serde_json::from_str(&content).ok();
3767        Err(Error::ResponseError(ResponseContent {
3768            status,
3769            content,
3770            entity,
3771        }))
3772    }
3773}
3774
3775pub async fn post_merge_check(
3776    configuration: &configuration::Configuration,
3777    repo_ref: &str,
3778    path: &str,
3779    repo_merge_check_input: models::RepoMergeCheckInput,
3780) -> Result<models::RepoMergeCheckOutput, Error<PostMergeCheckError>> {
3781    // add a prefix to parameters to efficiently prevent name collisions
3782    let p_path_repo_ref = repo_ref;
3783    let p_path_path = path;
3784    let p_body_repo_merge_check_input = repo_merge_check_input;
3785
3786    let uri_str = format!(
3787        "{}/repos/{repo_ref}/+/merge-check/{path}",
3788        configuration.base_path,
3789        repo_ref = crate::apis::urlencode(p_path_repo_ref),
3790        path = crate::apis::urlencode(p_path_path)
3791    );
3792    let mut req_builder = configuration
3793        .client
3794        .request(reqwest::Method::POST, &uri_str);
3795
3796    if let Some(ref apikey) = configuration.api_key {
3797        let key = apikey.key.clone();
3798        let value = match apikey.prefix {
3799            Some(ref prefix) => format!("{} {}", prefix, key),
3800            None => key,
3801        };
3802        req_builder = req_builder.query(&[("access_token", value)]);
3803    }
3804    if let Some(ref user_agent) = configuration.user_agent {
3805        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3806    }
3807    if let Some(ref auth_conf) = configuration.basic_auth {
3808        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3809    };
3810    if let Some(ref token) = configuration.bearer_access_token {
3811        req_builder = req_builder.bearer_auth(token.to_owned());
3812    };
3813    req_builder = req_builder.json(&p_body_repo_merge_check_input);
3814
3815    let req = req_builder.build()?;
3816    let resp = configuration.client.execute(req).await?;
3817
3818    let status = resp.status();
3819    let content_type = resp
3820        .headers()
3821        .get("content-type")
3822        .and_then(|v| v.to_str().ok())
3823        .unwrap_or("application/octet-stream");
3824    let content_type = super::ContentType::from(content_type);
3825
3826    if !status.is_client_error() && !status.is_server_error() {
3827        let content = resp.text().await?;
3828        match content_type {
3829            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3830            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoMergeCheckOutput`"))),
3831            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`")))),
3832        }
3833    } else {
3834        let content = resp.text().await?;
3835        let entity: Option<PostMergeCheckError> = serde_json::from_str(&content).ok();
3836        Err(Error::ResponseError(ResponseContent {
3837            status,
3838            content,
3839            entity,
3840        }))
3841    }
3842}
3843
3844pub async fn post_release(
3845    configuration: &configuration::Configuration,
3846    repo_ref: &str,
3847    release_create_input: models::ReleaseCreateInput,
3848) -> Result<models::ReleaseModel, Error<PostReleaseError>> {
3849    // add a prefix to parameters to efficiently prevent name collisions
3850    let p_path_repo_ref = repo_ref;
3851    let p_body_release_create_input = release_create_input;
3852
3853    let uri_str = format!(
3854        "{}/repos/{repo_ref}/+/releases",
3855        configuration.base_path,
3856        repo_ref = crate::apis::urlencode(p_path_repo_ref)
3857    );
3858    let mut req_builder = configuration
3859        .client
3860        .request(reqwest::Method::POST, &uri_str);
3861
3862    if let Some(ref apikey) = configuration.api_key {
3863        let key = apikey.key.clone();
3864        let value = match apikey.prefix {
3865            Some(ref prefix) => format!("{} {}", prefix, key),
3866            None => key,
3867        };
3868        req_builder = req_builder.query(&[("access_token", value)]);
3869    }
3870    if let Some(ref user_agent) = configuration.user_agent {
3871        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3872    }
3873    if let Some(ref auth_conf) = configuration.basic_auth {
3874        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3875    };
3876    if let Some(ref token) = configuration.bearer_access_token {
3877        req_builder = req_builder.bearer_auth(token.to_owned());
3878    };
3879    req_builder = req_builder.json(&p_body_release_create_input);
3880
3881    let req = req_builder.build()?;
3882    let resp = configuration.client.execute(req).await?;
3883
3884    let status = resp.status();
3885    let content_type = resp
3886        .headers()
3887        .get("content-type")
3888        .and_then(|v| v.to_str().ok())
3889        .unwrap_or("application/octet-stream");
3890    let content_type = super::ContentType::from(content_type);
3891
3892    if !status.is_client_error() && !status.is_server_error() {
3893        let content = resp.text().await?;
3894        match content_type {
3895            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3896            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReleaseModel`"))),
3897            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`")))),
3898        }
3899    } else {
3900        let content = resp.text().await?;
3901        let entity: Option<PostReleaseError> = serde_json::from_str(&content).ok();
3902        Err(Error::ResponseError(ResponseContent {
3903            status,
3904            content,
3905            entity,
3906        }))
3907    }
3908}
3909
3910pub async fn post_repo(
3911    configuration: &configuration::Configuration,
3912    repo_create_input: models::RepoCreateInput,
3913) -> Result<models::RepositoryModel, Error<PostRepoError>> {
3914    // add a prefix to parameters to efficiently prevent name collisions
3915    let p_body_repo_create_input = repo_create_input;
3916
3917    let uri_str = format!("{}/repos", configuration.base_path);
3918    let mut req_builder = configuration
3919        .client
3920        .request(reqwest::Method::POST, &uri_str);
3921
3922    if let Some(ref apikey) = configuration.api_key {
3923        let key = apikey.key.clone();
3924        let value = match apikey.prefix {
3925            Some(ref prefix) => format!("{} {}", prefix, key),
3926            None => key,
3927        };
3928        req_builder = req_builder.query(&[("access_token", value)]);
3929    }
3930    if let Some(ref user_agent) = configuration.user_agent {
3931        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3932    }
3933    if let Some(ref auth_conf) = configuration.basic_auth {
3934        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3935    };
3936    if let Some(ref token) = configuration.bearer_access_token {
3937        req_builder = req_builder.bearer_auth(token.to_owned());
3938    };
3939    req_builder = req_builder.json(&p_body_repo_create_input);
3940
3941    let req = req_builder.build()?;
3942    let resp = configuration.client.execute(req).await?;
3943
3944    let status = resp.status();
3945    let content_type = resp
3946        .headers()
3947        .get("content-type")
3948        .and_then(|v| v.to_str().ok())
3949        .unwrap_or("application/octet-stream");
3950    let content_type = super::ContentType::from(content_type);
3951
3952    if !status.is_client_error() && !status.is_server_error() {
3953        let content = resp.text().await?;
3954        match content_type {
3955            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3956            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
3957            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`")))),
3958        }
3959    } else {
3960        let content = resp.text().await?;
3961        let entity: Option<PostRepoError> = serde_json::from_str(&content).ok();
3962        Err(Error::ResponseError(ResponseContent {
3963            status,
3964            content,
3965            entity,
3966        }))
3967    }
3968}
3969
3970pub async fn post_repository_import(
3971    configuration: &configuration::Configuration,
3972    repo_import_input: models::RepoImportInput,
3973) -> Result<models::RepositoryModel, Error<PostRepositoryImportError>> {
3974    // add a prefix to parameters to efficiently prevent name collisions
3975    let p_body_repo_import_input = repo_import_input;
3976
3977    let uri_str = format!("{}/repos/import", configuration.base_path);
3978    let mut req_builder = configuration
3979        .client
3980        .request(reqwest::Method::POST, &uri_str);
3981
3982    if let Some(ref apikey) = configuration.api_key {
3983        let key = apikey.key.clone();
3984        let value = match apikey.prefix {
3985            Some(ref prefix) => format!("{} {}", prefix, key),
3986            None => key,
3987        };
3988        req_builder = req_builder.query(&[("access_token", value)]);
3989    }
3990    if let Some(ref user_agent) = configuration.user_agent {
3991        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3992    }
3993    if let Some(ref auth_conf) = configuration.basic_auth {
3994        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
3995    };
3996    if let Some(ref token) = configuration.bearer_access_token {
3997        req_builder = req_builder.bearer_auth(token.to_owned());
3998    };
3999    req_builder = req_builder.json(&p_body_repo_import_input);
4000
4001    let req = req_builder.build()?;
4002    let resp = configuration.client.execute(req).await?;
4003
4004    let status = resp.status();
4005    let content_type = resp
4006        .headers()
4007        .get("content-type")
4008        .and_then(|v| v.to_str().ok())
4009        .unwrap_or("application/octet-stream");
4010    let content_type = super::ContentType::from(content_type);
4011
4012    if !status.is_client_error() && !status.is_server_error() {
4013        let content = resp.text().await?;
4014        match content_type {
4015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4016            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4017            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`")))),
4018        }
4019    } else {
4020        let content = resp.text().await?;
4021        let entity: Option<PostRepositoryImportError> = serde_json::from_str(&content).ok();
4022        Err(Error::ResponseError(ResponseContent {
4023            status,
4024            content,
4025            entity,
4026        }))
4027    }
4028}
4029
4030pub async fn post_repository_move(
4031    configuration: &configuration::Configuration,
4032    repo_ref: &str,
4033    repo_move_input: models::RepoMoveInput,
4034) -> Result<models::RepositoryModel, Error<PostRepositoryMoveError>> {
4035    // add a prefix to parameters to efficiently prevent name collisions
4036    let p_path_repo_ref = repo_ref;
4037    let p_body_repo_move_input = repo_move_input;
4038
4039    let uri_str = format!(
4040        "{}/repos/{repo_ref}/+/move",
4041        configuration.base_path,
4042        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4043    );
4044    let mut req_builder = configuration
4045        .client
4046        .request(reqwest::Method::POST, &uri_str);
4047
4048    if let Some(ref apikey) = configuration.api_key {
4049        let key = apikey.key.clone();
4050        let value = match apikey.prefix {
4051            Some(ref prefix) => format!("{} {}", prefix, key),
4052            None => key,
4053        };
4054        req_builder = req_builder.query(&[("access_token", value)]);
4055    }
4056    if let Some(ref user_agent) = configuration.user_agent {
4057        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4058    }
4059    if let Some(ref auth_conf) = configuration.basic_auth {
4060        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4061    };
4062    if let Some(ref token) = configuration.bearer_access_token {
4063        req_builder = req_builder.bearer_auth(token.to_owned());
4064    };
4065    req_builder = req_builder.json(&p_body_repo_move_input);
4066
4067    let req = req_builder.build()?;
4068    let resp = configuration.client.execute(req).await?;
4069
4070    let status = resp.status();
4071    let content_type = resp
4072        .headers()
4073        .get("content-type")
4074        .and_then(|v| v.to_str().ok())
4075        .unwrap_or("application/octet-stream");
4076    let content_type = super::ContentType::from(content_type);
4077
4078    if !status.is_client_error() && !status.is_server_error() {
4079        let content = resp.text().await?;
4080        match content_type {
4081            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4082            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4083            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`")))),
4084        }
4085    } else {
4086        let content = resp.text().await?;
4087        let entity: Option<PostRepositoryMoveError> = serde_json::from_str(&content).ok();
4088        Err(Error::ResponseError(ResponseContent {
4089            status,
4090            content,
4091            entity,
4092        }))
4093    }
4094}
4095
4096pub async fn post_repository_purge(
4097    configuration: &configuration::Configuration,
4098    repo_ref: &str,
4099) -> Result<(), Error<PostRepositoryPurgeError>> {
4100    // add a prefix to parameters to efficiently prevent name collisions
4101    let p_path_repo_ref = repo_ref;
4102
4103    let uri_str = format!(
4104        "{}/repos/{repo_ref}/+/purge",
4105        configuration.base_path,
4106        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4107    );
4108    let mut req_builder = configuration
4109        .client
4110        .request(reqwest::Method::POST, &uri_str);
4111
4112    if let Some(ref apikey) = configuration.api_key {
4113        let key = apikey.key.clone();
4114        let value = match apikey.prefix {
4115            Some(ref prefix) => format!("{} {}", prefix, key),
4116            None => key,
4117        };
4118        req_builder = req_builder.query(&[("access_token", value)]);
4119    }
4120    if let Some(ref user_agent) = configuration.user_agent {
4121        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4122    }
4123    if let Some(ref auth_conf) = configuration.basic_auth {
4124        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4125    };
4126    if let Some(ref token) = configuration.bearer_access_token {
4127        req_builder = req_builder.bearer_auth(token.to_owned());
4128    };
4129
4130    let req = req_builder.build()?;
4131    let resp = configuration.client.execute(req).await?;
4132
4133    let status = resp.status();
4134
4135    if !status.is_client_error() && !status.is_server_error() {
4136        Ok(())
4137    } else {
4138        let content = resp.text().await?;
4139        let entity: Option<PostRepositoryPurgeError> = serde_json::from_str(&content).ok();
4140        Err(Error::ResponseError(ResponseContent {
4141            status,
4142            content,
4143            entity,
4144        }))
4145    }
4146}
4147
4148pub async fn post_repository_variable(
4149    configuration: &configuration::Configuration,
4150    repo_ref: &str,
4151    variable_create_input: models::VariableCreateInput,
4152) -> Result<models::VariableModel, Error<PostRepositoryVariableError>> {
4153    // add a prefix to parameters to efficiently prevent name collisions
4154    let p_path_repo_ref = repo_ref;
4155    let p_body_variable_create_input = variable_create_input;
4156
4157    let uri_str = format!(
4158        "{}/repos/{repo_ref}/+/variables",
4159        configuration.base_path,
4160        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4161    );
4162    let mut req_builder = configuration
4163        .client
4164        .request(reqwest::Method::POST, &uri_str);
4165
4166    if let Some(ref apikey) = configuration.api_key {
4167        let key = apikey.key.clone();
4168        let value = match apikey.prefix {
4169            Some(ref prefix) => format!("{} {}", prefix, key),
4170            None => key,
4171        };
4172        req_builder = req_builder.query(&[("access_token", value)]);
4173    }
4174    if let Some(ref user_agent) = configuration.user_agent {
4175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4176    }
4177    if let Some(ref auth_conf) = configuration.basic_auth {
4178        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4179    };
4180    if let Some(ref token) = configuration.bearer_access_token {
4181        req_builder = req_builder.bearer_auth(token.to_owned());
4182    };
4183    req_builder = req_builder.json(&p_body_variable_create_input);
4184
4185    let req = req_builder.build()?;
4186    let resp = configuration.client.execute(req).await?;
4187
4188    let status = resp.status();
4189    let content_type = resp
4190        .headers()
4191        .get("content-type")
4192        .and_then(|v| v.to_str().ok())
4193        .unwrap_or("application/octet-stream");
4194    let content_type = super::ContentType::from(content_type);
4195
4196    if !status.is_client_error() && !status.is_server_error() {
4197        let content = resp.text().await?;
4198        match content_type {
4199            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4200            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
4201            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`")))),
4202        }
4203    } else {
4204        let content = resp.text().await?;
4205        let entity: Option<PostRepositoryVariableError> = serde_json::from_str(&content).ok();
4206        Err(Error::ResponseError(ResponseContent {
4207            status,
4208            content,
4209            entity,
4210        }))
4211    }
4212}
4213
4214pub async fn post_tag(
4215    configuration: &configuration::Configuration,
4216    repo_ref: &str,
4217    tag_create_input: models::TagCreateInput,
4218) -> Result<models::CommitTag, Error<PostTagError>> {
4219    // add a prefix to parameters to efficiently prevent name collisions
4220    let p_path_repo_ref = repo_ref;
4221    let p_body_tag_create_input = tag_create_input;
4222
4223    let uri_str = format!(
4224        "{}/repos/{repo_ref}/+/tags",
4225        configuration.base_path,
4226        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4227    );
4228    let mut req_builder = configuration
4229        .client
4230        .request(reqwest::Method::POST, &uri_str);
4231
4232    if let Some(ref apikey) = configuration.api_key {
4233        let key = apikey.key.clone();
4234        let value = match apikey.prefix {
4235            Some(ref prefix) => format!("{} {}", prefix, key),
4236            None => key,
4237        };
4238        req_builder = req_builder.query(&[("access_token", value)]);
4239    }
4240    if let Some(ref user_agent) = configuration.user_agent {
4241        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4242    }
4243    if let Some(ref auth_conf) = configuration.basic_auth {
4244        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4245    };
4246    if let Some(ref token) = configuration.bearer_access_token {
4247        req_builder = req_builder.bearer_auth(token.to_owned());
4248    };
4249    req_builder = req_builder.json(&p_body_tag_create_input);
4250
4251    let req = req_builder.build()?;
4252    let resp = configuration.client.execute(req).await?;
4253
4254    let status = resp.status();
4255    let content_type = resp
4256        .headers()
4257        .get("content-type")
4258        .and_then(|v| v.to_str().ok())
4259        .unwrap_or("application/octet-stream");
4260    let content_type = super::ContentType::from(content_type);
4261
4262    if !status.is_client_error() && !status.is_server_error() {
4263        let content = resp.text().await?;
4264        match content_type {
4265            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4266            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitTag`"))),
4267            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`")))),
4268        }
4269    } else {
4270        let content = resp.text().await?;
4271        let entity: Option<PostTagError> = serde_json::from_str(&content).ok();
4272        Err(Error::ResponseError(ResponseContent {
4273            status,
4274            content,
4275            entity,
4276        }))
4277    }
4278}
4279
4280pub async fn rename_branch(
4281    configuration: &configuration::Configuration,
4282    repo_ref: &str,
4283    branch_rename_input: models::BranchRenameInput,
4284) -> Result<models::CommitBranch, Error<RenameBranchError>> {
4285    // add a prefix to parameters to efficiently prevent name collisions
4286    let p_path_repo_ref = repo_ref;
4287    let p_body_branch_rename_input = branch_rename_input;
4288
4289    let uri_str = format!(
4290        "{}/repos/{repo_ref}/+/branches",
4291        configuration.base_path,
4292        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4293    );
4294    let mut req_builder = configuration
4295        .client
4296        .request(reqwest::Method::PATCH, &uri_str);
4297
4298    if let Some(ref apikey) = configuration.api_key {
4299        let key = apikey.key.clone();
4300        let value = match apikey.prefix {
4301            Some(ref prefix) => format!("{} {}", prefix, key),
4302            None => key,
4303        };
4304        req_builder = req_builder.query(&[("access_token", value)]);
4305    }
4306    if let Some(ref user_agent) = configuration.user_agent {
4307        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4308    }
4309    if let Some(ref auth_conf) = configuration.basic_auth {
4310        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4311    };
4312    if let Some(ref token) = configuration.bearer_access_token {
4313        req_builder = req_builder.bearer_auth(token.to_owned());
4314    };
4315    req_builder = req_builder.json(&p_body_branch_rename_input);
4316
4317    let req = req_builder.build()?;
4318    let resp = configuration.client.execute(req).await?;
4319
4320    let status = resp.status();
4321    let content_type = resp
4322        .headers()
4323        .get("content-type")
4324        .and_then(|v| v.to_str().ok())
4325        .unwrap_or("application/octet-stream");
4326    let content_type = super::ContentType::from(content_type);
4327
4328    if !status.is_client_error() && !status.is_server_error() {
4329        let content = resp.text().await?;
4330        match content_type {
4331            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4332            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitBranch`"))),
4333            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`")))),
4334        }
4335    } else {
4336        let content = resp.text().await?;
4337        let entity: Option<RenameBranchError> = serde_json::from_str(&content).ok();
4338        Err(Error::ResponseError(ResponseContent {
4339            status,
4340            content,
4341            entity,
4342        }))
4343    }
4344}
4345
4346pub async fn repo_restore(
4347    configuration: &configuration::Configuration,
4348    repo_ref: &str,
4349    repo_restore_input: models::RepoRestoreInput,
4350) -> Result<models::RepositoryModel, Error<RepoRestoreError>> {
4351    // add a prefix to parameters to efficiently prevent name collisions
4352    let p_path_repo_ref = repo_ref;
4353    let p_body_repo_restore_input = repo_restore_input;
4354
4355    let uri_str = format!(
4356        "{}/repos/{repo_ref}/+/restore",
4357        configuration.base_path,
4358        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4359    );
4360    let mut req_builder = configuration
4361        .client
4362        .request(reqwest::Method::POST, &uri_str);
4363
4364    if let Some(ref apikey) = configuration.api_key {
4365        let key = apikey.key.clone();
4366        let value = match apikey.prefix {
4367            Some(ref prefix) => format!("{} {}", prefix, key),
4368            None => key,
4369        };
4370        req_builder = req_builder.query(&[("access_token", value)]);
4371    }
4372    if let Some(ref user_agent) = configuration.user_agent {
4373        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4374    }
4375    if let Some(ref auth_conf) = configuration.basic_auth {
4376        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4377    };
4378    if let Some(ref token) = configuration.bearer_access_token {
4379        req_builder = req_builder.bearer_auth(token.to_owned());
4380    };
4381    req_builder = req_builder.json(&p_body_repo_restore_input);
4382
4383    let req = req_builder.build()?;
4384    let resp = configuration.client.execute(req).await?;
4385
4386    let status = resp.status();
4387    let content_type = resp
4388        .headers()
4389        .get("content-type")
4390        .and_then(|v| v.to_str().ok())
4391        .unwrap_or("application/octet-stream");
4392    let content_type = super::ContentType::from(content_type);
4393
4394    if !status.is_client_error() && !status.is_server_error() {
4395        let content = resp.text().await?;
4396        match content_type {
4397            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4398            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepositoryModel`"))),
4399            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`")))),
4400        }
4401    } else {
4402        let content = resp.text().await?;
4403        let entity: Option<RepoRestoreError> = serde_json::from_str(&content).ok();
4404        Err(Error::ResponseError(ResponseContent {
4405            status,
4406            content,
4407            entity,
4408        }))
4409    }
4410}
4411
4412pub async fn soft_repository_delete(
4413    configuration: &configuration::Configuration,
4414    repo_ref: &str,
4415) -> Result<(), Error<SoftRepositoryDeleteError>> {
4416    // add a prefix to parameters to efficiently prevent name collisions
4417    let p_path_repo_ref = repo_ref;
4418
4419    let uri_str = format!(
4420        "{}/repos/{repo_ref}/+",
4421        configuration.base_path,
4422        repo_ref = crate::apis::urlencode(p_path_repo_ref)
4423    );
4424    let mut req_builder = configuration
4425        .client
4426        .request(reqwest::Method::DELETE, &uri_str);
4427
4428    if let Some(ref apikey) = configuration.api_key {
4429        let key = apikey.key.clone();
4430        let value = match apikey.prefix {
4431            Some(ref prefix) => format!("{} {}", prefix, key),
4432            None => key,
4433        };
4434        req_builder = req_builder.query(&[("access_token", value)]);
4435    }
4436    if let Some(ref user_agent) = configuration.user_agent {
4437        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4438    }
4439    if let Some(ref auth_conf) = configuration.basic_auth {
4440        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
4441    };
4442    if let Some(ref token) = configuration.bearer_access_token {
4443        req_builder = req_builder.bearer_auth(token.to_owned());
4444    };
4445
4446    let req = req_builder.build()?;
4447    let resp = configuration.client.execute(req).await?;
4448
4449    let status = resp.status();
4450
4451    if !status.is_client_error() && !status.is_server_error() {
4452        Ok(())
4453    } else {
4454        let content = resp.text().await?;
4455        let entity: Option<SoftRepositoryDeleteError> = serde_json::from_str(&content).ok();
4456        Err(Error::ResponseError(ResponseContent {
4457            status,
4458            content,
4459            entity,
4460        }))
4461    }
4462}