Skip to main content

hanzo_client/apis/
git_api.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`delete_git_keys_by_id`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteGitKeysByIdError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`delete_git_repos_by_name`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteGitReposByNameError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_git_repos_by_name_mirrors_by_id`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteGitReposByNameMirrorsByIdError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_git_repos_by_name_subscriptions_by_id`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteGitReposByNameSubscriptionsByIdError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`get_git`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetGitError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`get_git_by_org_by_project_by_repo_info_refs`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetGitByOrgByProjectByRepoInfoRefsError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_git_by_org_by_repo`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetGitByOrgByRepoError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_git_by_org_by_repo_commits`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetGitByOrgByRepoCommitsError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_git_by_org_by_repo_info_refs`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetGitByOrgByRepoInfoRefsError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_git_explore`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetGitExploreError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_git_keys`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetGitKeysError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_git_repos`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetGitReposError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_git_repos_by_name`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetGitReposByNameError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_git_repos_by_name_blob`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetGitReposByNameBlobError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_git_repos_by_name_commits`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetGitReposByNameCommitsError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_git_repos_by_name_files`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetGitReposByNameFilesError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_git_repos_by_name_mirrors`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetGitReposByNameMirrorsError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_git_repos_by_name_pulls`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetGitReposByNamePullsError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_git_repos_by_name_pulls_by_number`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetGitReposByNamePullsByNumberError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_git_repos_by_name_readme`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetGitReposByNameReadmeError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_git_repos_by_name_refs`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetGitReposByNameRefsError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`get_git_repos_by_name_subscriptions`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetGitReposByNameSubscriptionsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_git_repos_by_name_tree`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetGitReposByNameTreeError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_git_usage`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetGitUsageError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`patch_git_repos_by_name`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum PatchGitReposByNameError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`post_git_by_org_by_project_by_repo_git_receive_pack`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PostGitByOrgByProjectByRepoGitReceivePackError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`post_git_by_org_by_project_by_repo_git_upload_pack`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum PostGitByOrgByProjectByRepoGitUploadPackError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`post_git_by_org_by_repo_git_receive_pack`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum PostGitByOrgByRepoGitReceivePackError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`post_git_by_org_by_repo_git_upload_pack`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum PostGitByOrgByRepoGitUploadPackError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`post_git_keys`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum PostGitKeysError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`post_git_repos`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum PostGitReposError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`post_git_repos_by_name_gc`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum PostGitReposByNameGcError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`post_git_repos_by_name_mirror`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum PostGitReposByNameMirrorError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`post_git_repos_by_name_mirrors`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum PostGitReposByNameMirrorsError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`post_git_repos_by_name_pulls`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum PostGitReposByNamePullsError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`post_git_repos_by_name_pulls_by_number_merge`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum PostGitReposByNamePullsByNumberMergeError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`post_git_repos_by_name_push`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum PostGitReposByNamePushError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`post_git_repos_by_name_subscriptions`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum PostGitReposByNameSubscriptionsError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`post_git_webhook`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum PostGitWebhookError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`post_git_zap_createrepo`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum PostGitZapCreaterepoError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`post_git_zap_deleterepo`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum PostGitZapDeleterepoError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`post_git_zap_getrepo`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum PostGitZapGetrepoError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`post_git_zap_listrepos`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum PostGitZapListreposError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`post_git_zap_usage`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum PostGitZapUsageError {
323    UnknownValue(serde_json::Value),
324}
325
326
327/// Removes a registered SSH key, scoped to the caller's org: an org can only delete its own, and a key id it does not own is not found. Answers 204 with no body. Once removed the key no longer authenticates any SSH git access.
328pub async fn delete_git_keys_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteGitKeysByIdError>> {
329    // add a prefix to parameters to efficiently prevent name collisions
330    let p_id = id;
331
332    let uri_str = format!("{}/v1/git/keys/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
333    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
334
335    if let Some(ref user_agent) = configuration.user_agent {
336        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
337    }
338    if let Some(ref token) = configuration.bearer_access_token {
339        req_builder = req_builder.bearer_auth(token.to_owned());
340    };
341
342    let req = req_builder.build()?;
343    let resp = configuration.client.execute(req).await?;
344
345    let status = resp.status();
346
347    if !status.is_client_error() && !status.is_server_error() {
348        Ok(())
349    } else {
350        let content = resp.text().await?;
351        let entity: Option<DeleteGitKeysByIdError> = serde_json::from_str(&content).ok();
352        Err(Error::ResponseError(ResponseContent { status, content, entity }))
353    }
354}
355
356/// Removes a repo's metadata and purges its storage. Answers 204 with no body. The metadata row is the source of truth for existence, so a storage purge that fails is logged and the delete still succeeds — and a second call is a 404, not a second delete.
357pub async fn delete_git_repos_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteGitReposByNameError>> {
358    // add a prefix to parameters to efficiently prevent name collisions
359    let p_name = name;
360
361    let uri_str = format!("{}/v1/git/repos/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
362    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
363
364    if let Some(ref user_agent) = configuration.user_agent {
365        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
366    }
367    if let Some(ref token) = configuration.bearer_access_token {
368        req_builder = req_builder.bearer_auth(token.to_owned());
369    };
370
371    let req = req_builder.build()?;
372    let resp = configuration.client.execute(req).await?;
373
374    let status = resp.status();
375
376    if !status.is_client_error() && !status.is_server_error() {
377        Ok(())
378    } else {
379        let content = resp.text().await?;
380        let entity: Option<DeleteGitReposByNameError> = serde_json::from_str(&content).ok();
381        Err(Error::ResponseError(ResponseContent { status, content, entity }))
382    }
383}
384
385/// Removes one outbound mirror target; later pushes stop being forwarded to it. Answers 204 with no body. Nothing is done to the downstream remote itself — only this repo's intent to push there is dropped.
386pub async fn delete_git_repos_by_name_mirrors_by_id(configuration: &configuration::Configuration, name: &str, id: &str) -> Result<(), Error<DeleteGitReposByNameMirrorsByIdError>> {
387    // add a prefix to parameters to efficiently prevent name collisions
388    let p_name = name;
389    let p_id = id;
390
391    let uri_str = format!("{}/v1/git/repos/{name}/mirrors/{id}", configuration.base_path, name=crate::apis::urlencode(p_name), id=crate::apis::urlencode(p_id));
392    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
393
394    if let Some(ref user_agent) = configuration.user_agent {
395        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
396    }
397    if let Some(ref token) = configuration.bearer_access_token {
398        req_builder = req_builder.bearer_auth(token.to_owned());
399    };
400
401    let req = req_builder.build()?;
402    let resp = configuration.client.execute(req).await?;
403
404    let status = resp.status();
405
406    if !status.is_client_error() && !status.is_server_error() {
407        Ok(())
408    } else {
409        let content = resp.text().await?;
410        let entity: Option<DeleteGitReposByNameMirrorsByIdError> = serde_json::from_str(&content).ok();
411        Err(Error::ResponseError(ResponseContent { status, content, entity }))
412    }
413}
414
415/// Removes one Slack subscription from a repo; the notifier stops posting that repo's events to that channel. Answers 204 with no body. An id that is not this repo's subscription is not found.
416pub async fn delete_git_repos_by_name_subscriptions_by_id(configuration: &configuration::Configuration, name: &str, id: &str) -> Result<(), Error<DeleteGitReposByNameSubscriptionsByIdError>> {
417    // add a prefix to parameters to efficiently prevent name collisions
418    let p_name = name;
419    let p_id = id;
420
421    let uri_str = format!("{}/v1/git/repos/{name}/subscriptions/{id}", configuration.base_path, name=crate::apis::urlencode(p_name), id=crate::apis::urlencode(p_id));
422    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
423
424    if let Some(ref user_agent) = configuration.user_agent {
425        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
426    }
427    if let Some(ref token) = configuration.bearer_access_token {
428        req_builder = req_builder.bearer_auth(token.to_owned());
429    };
430
431    let req = req_builder.build()?;
432    let resp = configuration.client.execute(req).await?;
433
434    let status = resp.status();
435
436    if !status.is_client_error() && !status.is_server_error() {
437        Ok(())
438    } else {
439        let content = resp.text().await?;
440        let entity: Option<DeleteGitReposByNameSubscriptionsByIdError> = serde_json::from_str(&content).ok();
441        Err(Error::ResponseError(ResponseContent { status, content, entity }))
442    }
443}
444
445/// The repository list for the signed-in caller's org — each repo with its description, default branch, size and last update. SIGNED OUT it renders the public explore page instead of refusing, because most Hanzo repos are open source and the open face is the default one; signed in, the caller's own org shows its private repositories alongside its public ones. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
446pub async fn get_git(configuration: &configuration::Configuration, ) -> Result<(), Error<GetGitError>> {
447
448    let uri_str = format!("{}/v1/git", configuration.base_path);
449    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
450
451    if let Some(ref user_agent) = configuration.user_agent {
452        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
453    }
454    if let Some(ref token) = configuration.bearer_access_token {
455        req_builder = req_builder.bearer_auth(token.to_owned());
456    };
457
458    let req = req_builder.build()?;
459    let resp = configuration.client.execute(req).await?;
460
461    let status = resp.status();
462
463    if !status.is_client_error() && !status.is_server_error() {
464        Ok(())
465    } else {
466        let content = resp.text().await?;
467        let entity: Option<GetGitError> = serde_json::from_str(&content).ok();
468        Err(Error::ResponseError(ResponseContent { status, content, entity }))
469    }
470}
471
472/// The ref-advertisement phase of git's smart-HTTP protocol — the first request a clone, a fetch and a push all make. `?service=` selects which: `git-upload-pack` advertises for a fetch, `git-receive-pack` for a push, and any other value is 400.  ANONYMOUS ONLY FOR FETCH, AND ONLY ON A PUBLIC REPOSITORY. The push advertisement always requires an authenticated org, and where a path org is present it must equal the authenticated one. A private repository reached without its org is 404, indistinguishable from one that does not exist. Addressed under the API prefix, with the PROJECT as a middle path segment: project scope otherwise rides a header a git client cannot send, so this path is the only usable remote for a project-scoped repository. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
473pub async fn get_git_by_org_by_project_by_repo_info_refs(configuration: &configuration::Configuration, org: &str, project: &str, repo: &str) -> Result<(), Error<GetGitByOrgByProjectByRepoInfoRefsError>> {
474    // add a prefix to parameters to efficiently prevent name collisions
475    let p_org = org;
476    let p_project = project;
477    let p_repo = repo;
478
479    let uri_str = format!("{}/v1/git/{org}/{project}/{repo}/info/refs", configuration.base_path, org=crate::apis::urlencode(p_org), project=crate::apis::urlencode(p_project), repo=crate::apis::urlencode(p_repo));
480    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
481
482    if let Some(ref user_agent) = configuration.user_agent {
483        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
484    }
485    if let Some(ref token) = configuration.bearer_access_token {
486        req_builder = req_builder.bearer_auth(token.to_owned());
487    };
488
489    let req = req_builder.build()?;
490    let resp = configuration.client.execute(req).await?;
491
492    let status = resp.status();
493
494    if !status.is_client_error() && !status.is_server_error() {
495        Ok(())
496    } else {
497        let content = resp.text().await?;
498        let entity: Option<GetGitByOrgByProjectByRepoInfoRefsError> = serde_json::from_str(&content).ok();
499        Err(Error::ResponseError(ResponseContent { status, content, entity }))
500    }
501}
502
503/// A repository at a glance: its branches, the tree at the tip, its most recent commits, its README rendered, and the HTTPS and SSH clone URLs. `?ref=` selects a branch, tag or commit; the default branch is used when it is omitted. A repository with no commits yet renders its clone instructions rather than an error, which is what a caller who has just created one needs to see. A public repository is readable by anyone; a private one only by its own org. A repository that does not exist and one belonging to another org answer the SAME 404, so the page is never an existence oracle. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
504pub async fn get_git_by_org_by_repo(configuration: &configuration::Configuration, org: &str, repo: &str) -> Result<(), Error<GetGitByOrgByRepoError>> {
505    // add a prefix to parameters to efficiently prevent name collisions
506    let p_org = org;
507    let p_repo = repo;
508
509    let uri_str = format!("{}/v1/git/{org}/{repo}", configuration.base_path, org=crate::apis::urlencode(p_org), repo=crate::apis::urlencode(p_repo));
510    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
511
512    if let Some(ref user_agent) = configuration.user_agent {
513        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
514    }
515    if let Some(ref token) = configuration.bearer_access_token {
516        req_builder = req_builder.bearer_auth(token.to_owned());
517    };
518
519    let req = req_builder.build()?;
520    let resp = configuration.client.execute(req).await?;
521
522    let status = resp.status();
523
524    if !status.is_client_error() && !status.is_server_error() {
525        Ok(())
526    } else {
527        let content = resp.text().await?;
528        let entity: Option<GetGitByOrgByRepoError> = serde_json::from_str(&content).ok();
529        Err(Error::ResponseError(ResponseContent { status, content, entity }))
530    }
531}
532
533/// The hundred most recent commits on one ref, each with its author, message and date. `?ref=` selects the branch, tag or commit, defaulting to the repository's default branch; an unknown one is 404. A public repository is readable by anyone; a private one only by its own org. A repository that does not exist and one belonging to another org answer the SAME 404, so the page is never an existence oracle. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
534pub async fn get_git_by_org_by_repo_commits(configuration: &configuration::Configuration, org: &str, repo: &str) -> Result<(), Error<GetGitByOrgByRepoCommitsError>> {
535    // add a prefix to parameters to efficiently prevent name collisions
536    let p_org = org;
537    let p_repo = repo;
538
539    let uri_str = format!("{}/v1/git/{org}/{repo}/commits", configuration.base_path, org=crate::apis::urlencode(p_org), repo=crate::apis::urlencode(p_repo));
540    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
541
542    if let Some(ref user_agent) = configuration.user_agent {
543        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
544    }
545    if let Some(ref token) = configuration.bearer_access_token {
546        req_builder = req_builder.bearer_auth(token.to_owned());
547    };
548
549    let req = req_builder.build()?;
550    let resp = configuration.client.execute(req).await?;
551
552    let status = resp.status();
553
554    if !status.is_client_error() && !status.is_server_error() {
555        Ok(())
556    } else {
557        let content = resp.text().await?;
558        let entity: Option<GetGitByOrgByRepoCommitsError> = serde_json::from_str(&content).ok();
559        Err(Error::ResponseError(ResponseContent { status, content, entity }))
560    }
561}
562
563/// The ref-advertisement phase of git's smart-HTTP protocol — the first request a clone, a fetch and a push all make. `?service=` selects which: `git-upload-pack` advertises for a fetch, `git-receive-pack` for a push, and any other value is 400.  ANONYMOUS ONLY FOR FETCH, AND ONLY ON A PUBLIC REPOSITORY. The push advertisement always requires an authenticated org, and where a path org is present it must equal the authenticated one. A private repository reached without its org is 404, indistinguishable from one that does not exist. Addressed under the API prefix, so `git clone https://<host>/v1/git/<org>/<repo>.git` works on any host the binary serves. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
564pub async fn get_git_by_org_by_repo_info_refs(configuration: &configuration::Configuration, org: &str, repo: &str) -> Result<(), Error<GetGitByOrgByRepoInfoRefsError>> {
565    // add a prefix to parameters to efficiently prevent name collisions
566    let p_org = org;
567    let p_repo = repo;
568
569    let uri_str = format!("{}/v1/git/{org}/{repo}/info/refs", configuration.base_path, org=crate::apis::urlencode(p_org), repo=crate::apis::urlencode(p_repo));
570    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
571
572    if let Some(ref user_agent) = configuration.user_agent {
573        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
574    }
575    if let Some(ref token) = configuration.bearer_access_token {
576        req_builder = req_builder.bearer_auth(token.to_owned());
577    };
578
579    let req = req_builder.build()?;
580    let resp = configuration.client.execute(req).await?;
581
582    let status = resp.status();
583
584    if !status.is_client_error() && !status.is_server_error() {
585        Ok(())
586    } else {
587        let content = resp.text().await?;
588        let entity: Option<GetGitByOrgByRepoInfoRefsError> = serde_json::from_str(&content).ok();
589        Err(Error::ResponseError(ResponseContent { status, content, entity }))
590    }
591}
592
593/// The open, unauthenticated face of the git host: every PUBLIC repository in the fleet, org-qualified, so a project can be found and cloned with no account at all — signing in is for private repos and for writes. Repositories live in per-org stores with no global index, so this unions each org's public rows and is bounded to a fixed number of stores per request, keeping discovery quick however many orgs exist. A fleet with no orgs yet is an empty page, not an error. This is a server-rendered browser page, not JSON — the console repo-browser reads the same repository through the JSON ops under /v1/git/repos. Repository names, paths and file contents all render through auto-escaping templates rather than being concatenated into HTML.
594pub async fn get_git_explore(configuration: &configuration::Configuration, ) -> Result<(), Error<GetGitExploreError>> {
595
596    let uri_str = format!("{}/v1/git/explore", configuration.base_path);
597    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
598
599    if let Some(ref user_agent) = configuration.user_agent {
600        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
601    }
602    if let Some(ref token) = configuration.bearer_access_token {
603        req_builder = req_builder.bearer_auth(token.to_owned());
604    };
605
606    let req = req_builder.build()?;
607    let resp = configuration.client.execute(req).await?;
608
609    let status = resp.status();
610
611    if !status.is_client_error() && !status.is_server_error() {
612        Ok(())
613    } else {
614        let content = resp.text().await?;
615        let entity: Option<GetGitExploreError> = serde_json::from_str(&content).ok();
616        Err(Error::ResponseError(ResponseContent { status, content, entity }))
617    }
618}
619
620/// Returns the SSH public keys registered to the caller's org — the keys that authenticate `git clone git@<host>:<org>/<repo>.git`. Keys are org-scoped on read even though the fingerprint index is global, so one org never sees another's.
621pub async fn get_git_keys(configuration: &configuration::Configuration, ) -> Result<models::KeyList, Error<GetGitKeysError>> {
622
623    let uri_str = format!("{}/v1/git/keys", configuration.base_path);
624    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
625
626    if let Some(ref user_agent) = configuration.user_agent {
627        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
628    }
629    if let Some(ref token) = configuration.bearer_access_token {
630        req_builder = req_builder.bearer_auth(token.to_owned());
631    };
632
633    let req = req_builder.build()?;
634    let resp = configuration.client.execute(req).await?;
635
636    let status = resp.status();
637    let content_type = resp
638        .headers()
639        .get("content-type")
640        .and_then(|v| v.to_str().ok())
641        .unwrap_or("application/octet-stream");
642    let content_type = super::ContentType::from(content_type);
643
644    if !status.is_client_error() && !status.is_server_error() {
645        let content = resp.text().await?;
646        match content_type {
647            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
648            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyList`"))),
649            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyList`")))),
650        }
651    } else {
652        let content = resp.text().await?;
653        let entity: Option<GetGitKeysError> = serde_json::from_str(&content).ok();
654        Err(Error::ResponseError(ResponseContent { status, content, entity }))
655    }
656}
657
658/// Returns the repos in the caller's scope, most recently updated first. The scope is the request principal's — the gateway-minted org and its optional project — never anything off the wire, so a caller only ever sees its own. Rows carry no branches or HEAD; read one repo for those.
659pub async fn get_git_repos(configuration: &configuration::Configuration, ) -> Result<models::RepoList, Error<GetGitReposError>> {
660
661    let uri_str = format!("{}/v1/git/repos", configuration.base_path);
662    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
663
664    if let Some(ref user_agent) = configuration.user_agent {
665        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
666    }
667    if let Some(ref token) = configuration.bearer_access_token {
668        req_builder = req_builder.bearer_auth(token.to_owned());
669    };
670
671    let req = req_builder.build()?;
672    let resp = configuration.client.execute(req).await?;
673
674    let status = resp.status();
675    let content_type = resp
676        .headers()
677        .get("content-type")
678        .and_then(|v| v.to_str().ok())
679        .unwrap_or("application/octet-stream");
680    let content_type = super::ContentType::from(content_type);
681
682    if !status.is_client_error() && !status.is_server_error() {
683        let content = resp.text().await?;
684        match content_type {
685            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
686            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoList`"))),
687            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoList`")))),
688        }
689    } else {
690        let content = resp.text().await?;
691        let entity: Option<GetGitReposError> = serde_json::from_str(&content).ok();
692        Err(Error::ResponseError(ResponseContent { status, content, entity }))
693    }
694}
695
696/// Returns one repo with its live ref state: every branch name and the resolved HEAD commit. Both are read from the object store on each call, so an empty repo reports no branches and an empty head rather than failing. A repo outside the caller's scope is not found.
697pub async fn get_git_repos_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::RepoView, Error<GetGitReposByNameError>> {
698    // add a prefix to parameters to efficiently prevent name collisions
699    let p_name = name;
700
701    let uri_str = format!("{}/v1/git/repos/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
702    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
703
704    if let Some(ref user_agent) = configuration.user_agent {
705        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
706    }
707    if let Some(ref token) = configuration.bearer_access_token {
708        req_builder = req_builder.bearer_auth(token.to_owned());
709    };
710
711    let req = req_builder.build()?;
712    let resp = configuration.client.execute(req).await?;
713
714    let status = resp.status();
715    let content_type = resp
716        .headers()
717        .get("content-type")
718        .and_then(|v| v.to_str().ok())
719        .unwrap_or("application/octet-stream");
720    let content_type = super::ContentType::from(content_type);
721
722    if !status.is_client_error() && !status.is_server_error() {
723        let content = resp.text().await?;
724        match content_type {
725            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
726            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoView`"))),
727            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoView`")))),
728        }
729    } else {
730        let content = resp.text().await?;
731        let entity: Option<GetGitReposByNameError> = serde_json::from_str(&content).ok();
732        Err(Error::ResponseError(ResponseContent { status, content, entity }))
733    }
734}
735
736/// Returns one file's bytes at one revision. Text comes back verbatim, binary comes back base64, and a file past the 1 MiB view cap comes back marked truncated with NO content — the client is expected to clone instead.
737pub async fn get_git_repos_by_name_blob(configuration: &configuration::Configuration, name: &str, r#ref: Option<&str>, path: Option<&str>) -> Result<models::BlobJson, Error<GetGitReposByNameBlobError>> {
738    // add a prefix to parameters to efficiently prevent name collisions
739    let p_name = name;
740    let p_ref = r#ref;
741    let p_path = path;
742
743    let uri_str = format!("{}/v1/git/repos/{name}/blob", configuration.base_path, name=crate::apis::urlencode(p_name));
744    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
745
746    if let Some(ref param_value) = p_ref {
747        req_builder = req_builder.query(&[("ref", &param_value.to_string())]);
748    }
749    if let Some(ref param_value) = p_path {
750        req_builder = req_builder.query(&[("path", &param_value.to_string())]);
751    }
752    if let Some(ref user_agent) = configuration.user_agent {
753        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
754    }
755    if let Some(ref token) = configuration.bearer_access_token {
756        req_builder = req_builder.bearer_auth(token.to_owned());
757    };
758
759    let req = req_builder.build()?;
760    let resp = configuration.client.execute(req).await?;
761
762    let status = resp.status();
763    let content_type = resp
764        .headers()
765        .get("content-type")
766        .and_then(|v| v.to_str().ok())
767        .unwrap_or("application/octet-stream");
768    let content_type = super::ContentType::from(content_type);
769
770    if !status.is_client_error() && !status.is_server_error() {
771        let content = resp.text().await?;
772        match content_type {
773            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
774            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlobJson`"))),
775            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlobJson`")))),
776        }
777    } else {
778        let content = resp.text().await?;
779        let entity: Option<GetGitReposByNameBlobError> = serde_json::from_str(&content).ok();
780        Err(Error::ResponseError(ResponseContent { status, content, entity }))
781    }
782}
783
784/// Walks a ref's history newest first, or one path's history when a path is given. There is no cursor: the page is the newest `limit` commits.
785pub async fn get_git_repos_by_name_commits(configuration: &configuration::Configuration, name: &str, r#ref: Option<&str>, path: Option<&str>, limit: Option<i32>) -> Result<models::CommitsJson, Error<GetGitReposByNameCommitsError>> {
786    // add a prefix to parameters to efficiently prevent name collisions
787    let p_name = name;
788    let p_ref = r#ref;
789    let p_path = path;
790    let p_limit = limit;
791
792    let uri_str = format!("{}/v1/git/repos/{name}/commits", configuration.base_path, name=crate::apis::urlencode(p_name));
793    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
794
795    if let Some(ref param_value) = p_ref {
796        req_builder = req_builder.query(&[("ref", &param_value.to_string())]);
797    }
798    if let Some(ref param_value) = p_path {
799        req_builder = req_builder.query(&[("path", &param_value.to_string())]);
800    }
801    if let Some(ref param_value) = p_limit {
802        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
803    }
804    if let Some(ref user_agent) = configuration.user_agent {
805        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
806    }
807    if let Some(ref token) = configuration.bearer_access_token {
808        req_builder = req_builder.bearer_auth(token.to_owned());
809    };
810
811    let req = req_builder.build()?;
812    let resp = configuration.client.execute(req).await?;
813
814    let status = resp.status();
815    let content_type = resp
816        .headers()
817        .get("content-type")
818        .and_then(|v| v.to_str().ok())
819        .unwrap_or("application/octet-stream");
820    let content_type = super::ContentType::from(content_type);
821
822    if !status.is_client_error() && !status.is_server_error() {
823        let content = resp.text().await?;
824        match content_type {
825            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
826            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitsJson`"))),
827            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitsJson`")))),
828        }
829    } else {
830        let content = resp.text().await?;
831        let entity: Option<GetGitReposByNameCommitsError> = serde_json::from_str(&content).ok();
832        Err(Error::ResponseError(ResponseContent { status, content, entity }))
833    }
834}
835
836/// Returns every file a glob selects at one revision, WITH its bytes and the revision they came from. It is the read a delivery generator makes: one call answers \"what is the inventory at this commit, and what does it say\", where listing and then fetching would be a request per file.  Returning the resolved revision matters as much as the bytes. A generator that lists at `main` and then reads at `main` can straddle a push and assemble half its inventory from one commit and half from the next; resolving once makes the whole read consistent by construction.  A file past the read cap comes back Truncated with no content rather than being dropped. A caller building a desired set has to know the difference between \"this file is empty\" and \"this file was not read\" — silently omitting it is how a pruning reconcile deletes what the missing file declared.
837pub async fn get_git_repos_by_name_files(configuration: &configuration::Configuration, name: &str, r#ref: Option<&str>, glob: Option<&str>) -> Result<models::FilesJson, Error<GetGitReposByNameFilesError>> {
838    // add a prefix to parameters to efficiently prevent name collisions
839    let p_name = name;
840    let p_ref = r#ref;
841    let p_glob = glob;
842
843    let uri_str = format!("{}/v1/git/repos/{name}/files", configuration.base_path, name=crate::apis::urlencode(p_name));
844    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
845
846    if let Some(ref param_value) = p_ref {
847        req_builder = req_builder.query(&[("ref", &param_value.to_string())]);
848    }
849    if let Some(ref param_value) = p_glob {
850        req_builder = req_builder.query(&[("glob", &param_value.to_string())]);
851    }
852    if let Some(ref user_agent) = configuration.user_agent {
853        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
854    }
855    if let Some(ref token) = configuration.bearer_access_token {
856        req_builder = req_builder.bearer_auth(token.to_owned());
857    };
858
859    let req = req_builder.build()?;
860    let resp = configuration.client.execute(req).await?;
861
862    let status = resp.status();
863    let content_type = resp
864        .headers()
865        .get("content-type")
866        .and_then(|v| v.to_str().ok())
867        .unwrap_or("application/octet-stream");
868    let content_type = super::ContentType::from(content_type);
869
870    if !status.is_client_error() && !status.is_server_error() {
871        let content = resp.text().await?;
872        match content_type {
873            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
874            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FilesJson`"))),
875            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FilesJson`")))),
876        }
877    } else {
878        let content = resp.text().await?;
879        let entity: Option<GetGitReposByNameFilesError> = serde_json::from_str(&content).ok();
880        Err(Error::ResponseError(ResponseContent { status, content, entity }))
881    }
882}
883
884/// Returns a repo's outbound mirror targets — the downstream remotes the mirror reactor pushes to whenever a push lands here.
885pub async fn get_git_repos_by_name_mirrors(configuration: &configuration::Configuration, name: &str) -> Result<models::MirrorList, Error<GetGitReposByNameMirrorsError>> {
886    // add a prefix to parameters to efficiently prevent name collisions
887    let p_name = name;
888
889    let uri_str = format!("{}/v1/git/repos/{name}/mirrors", configuration.base_path, name=crate::apis::urlencode(p_name));
890    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
891
892    if let Some(ref user_agent) = configuration.user_agent {
893        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
894    }
895    if let Some(ref token) = configuration.bearer_access_token {
896        req_builder = req_builder.bearer_auth(token.to_owned());
897    };
898
899    let req = req_builder.build()?;
900    let resp = configuration.client.execute(req).await?;
901
902    let status = resp.status();
903    let content_type = resp
904        .headers()
905        .get("content-type")
906        .and_then(|v| v.to_str().ok())
907        .unwrap_or("application/octet-stream");
908    let content_type = super::ContentType::from(content_type);
909
910    if !status.is_client_error() && !status.is_server_error() {
911        let content = resp.text().await?;
912        match content_type {
913            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
914            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MirrorList`"))),
915            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MirrorList`")))),
916        }
917    } else {
918        let content = resp.text().await?;
919        let entity: Option<GetGitReposByNameMirrorsError> = serde_json::from_str(&content).ok();
920        Err(Error::ResponseError(ResponseContent { status, content, entity }))
921    }
922}
923
924/// Returns a repo's pull requests, newest number first — what is waiting to be reviewed, and what has already landed. Narrow it with ?state=open or ?state=merged; omit state for every proposal.
925pub async fn get_git_repos_by_name_pulls(configuration: &configuration::Configuration, name: &str, state: Option<&str>) -> Result<models::PullList, Error<GetGitReposByNamePullsError>> {
926    // add a prefix to parameters to efficiently prevent name collisions
927    let p_name = name;
928    let p_state = state;
929
930    let uri_str = format!("{}/v1/git/repos/{name}/pulls", configuration.base_path, name=crate::apis::urlencode(p_name));
931    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
932
933    if let Some(ref param_value) = p_state {
934        req_builder = req_builder.query(&[("state", &param_value.to_string())]);
935    }
936    if let Some(ref user_agent) = configuration.user_agent {
937        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
938    }
939    if let Some(ref token) = configuration.bearer_access_token {
940        req_builder = req_builder.bearer_auth(token.to_owned());
941    };
942
943    let req = req_builder.build()?;
944    let resp = configuration.client.execute(req).await?;
945
946    let status = resp.status();
947    let content_type = resp
948        .headers()
949        .get("content-type")
950        .and_then(|v| v.to_str().ok())
951        .unwrap_or("application/octet-stream");
952    let content_type = super::ContentType::from(content_type);
953
954    if !status.is_client_error() && !status.is_server_error() {
955        let content = resp.text().await?;
956        match content_type {
957            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
958            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullList`"))),
959            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullList`")))),
960        }
961    } else {
962        let content = resp.text().await?;
963        let entity: Option<GetGitReposByNamePullsError> = serde_json::from_str(&content).ok();
964        Err(Error::ResponseError(ResponseContent { status, content, entity }))
965    }
966}
967
968/// Returns one pull request by its per-repo number. A number belonging to another tenant's repo is not found, exactly as the repo itself is not.
969pub async fn get_git_repos_by_name_pulls_by_number(configuration: &configuration::Configuration, name: &str, number: i32) -> Result<models::PullView, Error<GetGitReposByNamePullsByNumberError>> {
970    // add a prefix to parameters to efficiently prevent name collisions
971    let p_name = name;
972    let p_number = number;
973
974    let uri_str = format!("{}/v1/git/repos/{name}/pulls/{number}", configuration.base_path, name=crate::apis::urlencode(p_name), number=p_number);
975    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
976
977    if let Some(ref user_agent) = configuration.user_agent {
978        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
979    }
980    if let Some(ref token) = configuration.bearer_access_token {
981        req_builder = req_builder.bearer_auth(token.to_owned());
982    };
983
984    let req = req_builder.build()?;
985    let resp = configuration.client.execute(req).await?;
986
987    let status = resp.status();
988    let content_type = resp
989        .headers()
990        .get("content-type")
991        .and_then(|v| v.to_str().ok())
992        .unwrap_or("application/octet-stream");
993    let content_type = super::ContentType::from(content_type);
994
995    if !status.is_client_error() && !status.is_server_error() {
996        let content = resp.text().await?;
997        match content_type {
998            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
999            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullView`"))),
1000            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullView`")))),
1001        }
1002    } else {
1003        let content = resp.text().await?;
1004        let entity: Option<GetGitReposByNamePullsByNumberError> = serde_json::from_str(&content).ok();
1005        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1006    }
1007}
1008
1009/// Returns the README at the tree root as plain text — unrendered, so the caller decides how to present it. A repo with no README is not found.
1010pub async fn get_git_repos_by_name_readme(configuration: &configuration::Configuration, name: &str, r#ref: Option<&str>) -> Result<models::ReadmeJson, Error<GetGitReposByNameReadmeError>> {
1011    // add a prefix to parameters to efficiently prevent name collisions
1012    let p_name = name;
1013    let p_ref = r#ref;
1014
1015    let uri_str = format!("{}/v1/git/repos/{name}/readme", configuration.base_path, name=crate::apis::urlencode(p_name));
1016    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1017
1018    if let Some(ref param_value) = p_ref {
1019        req_builder = req_builder.query(&[("ref", &param_value.to_string())]);
1020    }
1021    if let Some(ref user_agent) = configuration.user_agent {
1022        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1023    }
1024    if let Some(ref token) = configuration.bearer_access_token {
1025        req_builder = req_builder.bearer_auth(token.to_owned());
1026    };
1027
1028    let req = req_builder.build()?;
1029    let resp = configuration.client.execute(req).await?;
1030
1031    let status = resp.status();
1032    let content_type = resp
1033        .headers()
1034        .get("content-type")
1035        .and_then(|v| v.to_str().ok())
1036        .unwrap_or("application/octet-stream");
1037    let content_type = super::ContentType::from(content_type);
1038
1039    if !status.is_client_error() && !status.is_server_error() {
1040        let content = resp.text().await?;
1041        match content_type {
1042            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1043            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ReadmeJson`"))),
1044            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ReadmeJson`")))),
1045        }
1046    } else {
1047        let content = resp.text().await?;
1048        let entity: Option<GetGitReposByNameReadmeError> = serde_json::from_str(&content).ok();
1049        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1050    }
1051}
1052
1053/// Lists a repo's branches, tags and default branch — what a branch picker needs in one call. Unlike the other read ops it tolerates a repo with no commits: the ref sets come back empty and the default branch is still named.
1054pub async fn get_git_repos_by_name_refs(configuration: &configuration::Configuration, name: &str) -> Result<models::RefsJson, Error<GetGitReposByNameRefsError>> {
1055    // add a prefix to parameters to efficiently prevent name collisions
1056    let p_name = name;
1057
1058    let uri_str = format!("{}/v1/git/repos/{name}/refs", configuration.base_path, name=crate::apis::urlencode(p_name));
1059    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1060
1061    if let Some(ref user_agent) = configuration.user_agent {
1062        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1063    }
1064    if let Some(ref token) = configuration.bearer_access_token {
1065        req_builder = req_builder.bearer_auth(token.to_owned());
1066    };
1067
1068    let req = req_builder.build()?;
1069    let resp = configuration.client.execute(req).await?;
1070
1071    let status = resp.status();
1072    let content_type = resp
1073        .headers()
1074        .get("content-type")
1075        .and_then(|v| v.to_str().ok())
1076        .unwrap_or("application/octet-stream");
1077    let content_type = super::ContentType::from(content_type);
1078
1079    if !status.is_client_error() && !status.is_server_error() {
1080        let content = resp.text().await?;
1081        match content_type {
1082            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1083            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefsJson`"))),
1084            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RefsJson`")))),
1085        }
1086    } else {
1087        let content = resp.text().await?;
1088        let entity: Option<GetGitReposByNameRefsError> = serde_json::from_str(&content).ok();
1089        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1090    }
1091}
1092
1093/// Returns a repo's Slack subscriptions — which channels the lifecycle notifier posts this repo's push and deploy events to.
1094pub async fn get_git_repos_by_name_subscriptions(configuration: &configuration::Configuration, name: &str) -> Result<models::SubscriptionList, Error<GetGitReposByNameSubscriptionsError>> {
1095    // add a prefix to parameters to efficiently prevent name collisions
1096    let p_name = name;
1097
1098    let uri_str = format!("{}/v1/git/repos/{name}/subscriptions", configuration.base_path, name=crate::apis::urlencode(p_name));
1099    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1100
1101    if let Some(ref user_agent) = configuration.user_agent {
1102        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1103    }
1104    if let Some(ref token) = configuration.bearer_access_token {
1105        req_builder = req_builder.bearer_auth(token.to_owned());
1106    };
1107
1108    let req = req_builder.build()?;
1109    let resp = configuration.client.execute(req).await?;
1110
1111    let status = resp.status();
1112    let content_type = resp
1113        .headers()
1114        .get("content-type")
1115        .and_then(|v| v.to_str().ok())
1116        .unwrap_or("application/octet-stream");
1117    let content_type = super::ContentType::from(content_type);
1118
1119    if !status.is_client_error() && !status.is_server_error() {
1120        let content = resp.text().await?;
1121        match content_type {
1122            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1123            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SubscriptionList`"))),
1124            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SubscriptionList`")))),
1125        }
1126    } else {
1127        let content = resp.text().await?;
1128        let entity: Option<GetGitReposByNameSubscriptionsError> = serde_json::from_str(&content).ok();
1129        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1130    }
1131}
1132
1133/// Lists the immediate children of one directory at one revision, directories before files. It does not recurse — walk down a level at a time.
1134pub async fn get_git_repos_by_name_tree(configuration: &configuration::Configuration, name: &str, r#ref: Option<&str>, path: Option<&str>) -> Result<models::TreeJson, Error<GetGitReposByNameTreeError>> {
1135    // add a prefix to parameters to efficiently prevent name collisions
1136    let p_name = name;
1137    let p_ref = r#ref;
1138    let p_path = path;
1139
1140    let uri_str = format!("{}/v1/git/repos/{name}/tree", configuration.base_path, name=crate::apis::urlencode(p_name));
1141    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1142
1143    if let Some(ref param_value) = p_ref {
1144        req_builder = req_builder.query(&[("ref", &param_value.to_string())]);
1145    }
1146    if let Some(ref param_value) = p_path {
1147        req_builder = req_builder.query(&[("path", &param_value.to_string())]);
1148    }
1149    if let Some(ref user_agent) = configuration.user_agent {
1150        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1151    }
1152    if let Some(ref token) = configuration.bearer_access_token {
1153        req_builder = req_builder.bearer_auth(token.to_owned());
1154    };
1155
1156    let req = req_builder.build()?;
1157    let resp = configuration.client.execute(req).await?;
1158
1159    let status = resp.status();
1160    let content_type = resp
1161        .headers()
1162        .get("content-type")
1163        .and_then(|v| v.to_str().ok())
1164        .unwrap_or("application/octet-stream");
1165    let content_type = super::ContentType::from(content_type);
1166
1167    if !status.is_client_error() && !status.is_server_error() {
1168        let content = resp.text().await?;
1169        match content_type {
1170            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1171            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TreeJson`"))),
1172            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TreeJson`")))),
1173        }
1174    } else {
1175        let content = resp.text().await?;
1176        let entity: Option<GetGitReposByNameTreeError> = serde_json::from_str(&content).ok();
1177        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1178    }
1179}
1180
1181/// Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on. It spans EVERY project sub-scope, unlike the repo list, so a billing consumer sees the whole tenant footprint in one call. Sizes are last-measured values (create, push, mirror and gc each re-measure), not a live walk of the disk.
1182pub async fn get_git_usage(configuration: &configuration::Configuration, ) -> Result<models::UsageView, Error<GetGitUsageError>> {
1183
1184    let uri_str = format!("{}/v1/git/usage", configuration.base_path);
1185    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1186
1187    if let Some(ref user_agent) = configuration.user_agent {
1188        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1189    }
1190    if let Some(ref token) = configuration.bearer_access_token {
1191        req_builder = req_builder.bearer_auth(token.to_owned());
1192    };
1193
1194    let req = req_builder.build()?;
1195    let resp = configuration.client.execute(req).await?;
1196
1197    let status = resp.status();
1198    let content_type = resp
1199        .headers()
1200        .get("content-type")
1201        .and_then(|v| v.to_str().ok())
1202        .unwrap_or("application/octet-stream");
1203    let content_type = super::ContentType::from(content_type);
1204
1205    if !status.is_client_error() && !status.is_server_error() {
1206        let content = resp.text().await?;
1207        match content_type {
1208            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1209            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UsageView`"))),
1210            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UsageView`")))),
1211        }
1212    } else {
1213        let content = resp.text().await?;
1214        let entity: Option<GetGitUsageError> = serde_json::from_str(&content).ok();
1215        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1216    }
1217}
1218
1219/// Flips a repo's public bit, the one mutable repo setting today. Public grants ANONYMOUS fetch only; push and the whole control plane stay org-authed. Returns the updated repo.
1220pub async fn patch_git_repos_by_name(configuration: &configuration::Configuration, name: &str, patch_in: models::PatchIn) -> Result<models::RepoView, Error<PatchGitReposByNameError>> {
1221    // add a prefix to parameters to efficiently prevent name collisions
1222    let p_name = name;
1223    let p_patch_in = patch_in;
1224
1225    let uri_str = format!("{}/v1/git/repos/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
1226    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1227
1228    if let Some(ref user_agent) = configuration.user_agent {
1229        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1230    }
1231    if let Some(ref token) = configuration.bearer_access_token {
1232        req_builder = req_builder.bearer_auth(token.to_owned());
1233    };
1234    req_builder = req_builder.json(&p_patch_in);
1235
1236    let req = req_builder.build()?;
1237    let resp = configuration.client.execute(req).await?;
1238
1239    let status = resp.status();
1240    let content_type = resp
1241        .headers()
1242        .get("content-type")
1243        .and_then(|v| v.to_str().ok())
1244        .unwrap_or("application/octet-stream");
1245    let content_type = super::ContentType::from(content_type);
1246
1247    if !status.is_client_error() && !status.is_server_error() {
1248        let content = resp.text().await?;
1249        match content_type {
1250            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1251            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoView`"))),
1252            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoView`")))),
1253        }
1254    } else {
1255        let content = resp.text().await?;
1256        let entity: Option<PatchGitReposByNameError> = serde_json::from_str(&content).ok();
1257        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1258    }
1259}
1260
1261/// The pack-transfer phase of a push, and the point at which a push becomes an EVENT. NEVER ANONYMOUS: a push always requires an authenticated org, and the org in the path must equal it.  Once the pack is on disk the repository's storage usage is metered and a build is fired for every branch whose tip actually moved, computed from the before/after branch diff rather than from what the client claimed. That runs on a cancel-immune context, so a client that hangs up the moment its push lands still gets its build, and it runs even when git itself exited non-zero — the refs on disk are the ground truth. Repacking housekeeping is detached and never blocks the response.  A Content-Type other than `application/x-git-receive-pack-request` is 400. Addressed under the API prefix, with the PROJECT as a middle path segment: project scope otherwise rides a header a git client cannot send, so this path is the only usable remote for a project-scoped repository. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
1262pub async fn post_git_by_org_by_project_by_repo_git_receive_pack(configuration: &configuration::Configuration, org: &str, project: &str, repo: &str, body: Option<Vec<u8>>) -> Result<(), Error<PostGitByOrgByProjectByRepoGitReceivePackError>> {
1263    // add a prefix to parameters to efficiently prevent name collisions
1264    let p_org = org;
1265    let p_project = project;
1266    let p_repo = repo;
1267    let p_body = body;
1268
1269    let uri_str = format!("{}/v1/git/{org}/{project}/{repo}/git-receive-pack", configuration.base_path, org=crate::apis::urlencode(p_org), project=crate::apis::urlencode(p_project), repo=crate::apis::urlencode(p_repo));
1270    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1271
1272    if let Some(ref user_agent) = configuration.user_agent {
1273        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1274    }
1275    if let Some(ref token) = configuration.bearer_access_token {
1276        req_builder = req_builder.bearer_auth(token.to_owned());
1277    };
1278    if let Some(body) = p_body {
1279        req_builder = req_builder.body(body);
1280    }
1281
1282    let req = req_builder.build()?;
1283    let resp = configuration.client.execute(req).await?;
1284
1285    let status = resp.status();
1286
1287    if !status.is_client_error() && !status.is_server_error() {
1288        Ok(())
1289    } else {
1290        let content = resp.text().await?;
1291        let entity: Option<PostGitByOrgByProjectByRepoGitReceivePackError> = serde_json::from_str(&content).ok();
1292        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1293    }
1294}
1295
1296/// The pack-transfer phase of a clone or fetch: the request and the response are git's binary pack protocol, streamed straight through git itself — request body to git's stdin, git's stdout to the response — so a multi-gigabyte clone never lands in this process's memory.  A PUBLIC repository is fetched anonymously; a private one requires its own org, and a wrong or absent org is 404 rather than a hint that the repository exists. A Content-Type other than `application/x-git-upload-pack-request` is 400. Addressed under the API prefix, with the PROJECT as a middle path segment: project scope otherwise rides a header a git client cannot send, so this path is the only usable remote for a project-scoped repository. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
1297pub async fn post_git_by_org_by_project_by_repo_git_upload_pack(configuration: &configuration::Configuration, org: &str, project: &str, repo: &str, body: Option<Vec<u8>>) -> Result<(), Error<PostGitByOrgByProjectByRepoGitUploadPackError>> {
1298    // add a prefix to parameters to efficiently prevent name collisions
1299    let p_org = org;
1300    let p_project = project;
1301    let p_repo = repo;
1302    let p_body = body;
1303
1304    let uri_str = format!("{}/v1/git/{org}/{project}/{repo}/git-upload-pack", configuration.base_path, org=crate::apis::urlencode(p_org), project=crate::apis::urlencode(p_project), repo=crate::apis::urlencode(p_repo));
1305    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1306
1307    if let Some(ref user_agent) = configuration.user_agent {
1308        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1309    }
1310    if let Some(ref token) = configuration.bearer_access_token {
1311        req_builder = req_builder.bearer_auth(token.to_owned());
1312    };
1313    if let Some(body) = p_body {
1314        req_builder = req_builder.body(body);
1315    }
1316
1317    let req = req_builder.build()?;
1318    let resp = configuration.client.execute(req).await?;
1319
1320    let status = resp.status();
1321
1322    if !status.is_client_error() && !status.is_server_error() {
1323        Ok(())
1324    } else {
1325        let content = resp.text().await?;
1326        let entity: Option<PostGitByOrgByProjectByRepoGitUploadPackError> = serde_json::from_str(&content).ok();
1327        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1328    }
1329}
1330
1331/// The pack-transfer phase of a push, and the point at which a push becomes an EVENT. NEVER ANONYMOUS: a push always requires an authenticated org, and the org in the path must equal it.  Once the pack is on disk the repository's storage usage is metered and a build is fired for every branch whose tip actually moved, computed from the before/after branch diff rather than from what the client claimed. That runs on a cancel-immune context, so a client that hangs up the moment its push lands still gets its build, and it runs even when git itself exited non-zero — the refs on disk are the ground truth. Repacking housekeeping is detached and never blocks the response.  A Content-Type other than `application/x-git-receive-pack-request` is 400. Addressed under the API prefix, so `git clone https://<host>/v1/git/<org>/<repo>.git` works on any host the binary serves. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
1332pub async fn post_git_by_org_by_repo_git_receive_pack(configuration: &configuration::Configuration, org: &str, repo: &str, body: Option<Vec<u8>>) -> Result<(), Error<PostGitByOrgByRepoGitReceivePackError>> {
1333    // add a prefix to parameters to efficiently prevent name collisions
1334    let p_org = org;
1335    let p_repo = repo;
1336    let p_body = body;
1337
1338    let uri_str = format!("{}/v1/git/{org}/{repo}/git-receive-pack", configuration.base_path, org=crate::apis::urlencode(p_org), repo=crate::apis::urlencode(p_repo));
1339    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1340
1341    if let Some(ref user_agent) = configuration.user_agent {
1342        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1343    }
1344    if let Some(ref token) = configuration.bearer_access_token {
1345        req_builder = req_builder.bearer_auth(token.to_owned());
1346    };
1347    if let Some(body) = p_body {
1348        req_builder = req_builder.body(body);
1349    }
1350
1351    let req = req_builder.build()?;
1352    let resp = configuration.client.execute(req).await?;
1353
1354    let status = resp.status();
1355
1356    if !status.is_client_error() && !status.is_server_error() {
1357        Ok(())
1358    } else {
1359        let content = resp.text().await?;
1360        let entity: Option<PostGitByOrgByRepoGitReceivePackError> = serde_json::from_str(&content).ok();
1361        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1362    }
1363}
1364
1365/// The pack-transfer phase of a clone or fetch: the request and the response are git's binary pack protocol, streamed straight through git itself — request body to git's stdin, git's stdout to the response — so a multi-gigabyte clone never lands in this process's memory.  A PUBLIC repository is fetched anonymously; a private one requires its own org, and a wrong or absent org is 404 rather than a hint that the repository exists. A Content-Type other than `application/x-git-upload-pack-request` is 400. Addressed under the API prefix, so `git clone https://<host>/v1/git/<org>/<repo>.git` works on any host the binary serves. This is git's own wire protocol, not an API call to make by hand: point a git client at the clone URL and it makes this request itself.
1366pub async fn post_git_by_org_by_repo_git_upload_pack(configuration: &configuration::Configuration, org: &str, repo: &str, body: Option<Vec<u8>>) -> Result<(), Error<PostGitByOrgByRepoGitUploadPackError>> {
1367    // add a prefix to parameters to efficiently prevent name collisions
1368    let p_org = org;
1369    let p_repo = repo;
1370    let p_body = body;
1371
1372    let uri_str = format!("{}/v1/git/{org}/{repo}/git-upload-pack", configuration.base_path, org=crate::apis::urlencode(p_org), repo=crate::apis::urlencode(p_repo));
1373    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1374
1375    if let Some(ref user_agent) = configuration.user_agent {
1376        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1377    }
1378    if let Some(ref token) = configuration.bearer_access_token {
1379        req_builder = req_builder.bearer_auth(token.to_owned());
1380    };
1381    if let Some(body) = p_body {
1382        req_builder = req_builder.body(body);
1383    }
1384
1385    let req = req_builder.build()?;
1386    let resp = configuration.client.execute(req).await?;
1387
1388    let status = resp.status();
1389
1390    if !status.is_client_error() && !status.is_server_error() {
1391        Ok(())
1392    } else {
1393        let content = resp.text().await?;
1394        let entity: Option<PostGitByOrgByRepoGitUploadPackError> = serde_json::from_str(&content).ok();
1395        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1396    }
1397}
1398
1399/// Registers an SSH public key so it can authenticate `git clone git@<host>:<org>/<repo>.git` for the caller's org. The key line is parsed and canonicalized before storage, its SHA256 fingerprint becomes the auth lookup handle, and the full public key round-trips (it is public). Answers 201. Fingerprints are globally unique, so a key already registered — to this org or any other — is a 409: one key belongs to exactly one org.
1400pub async fn post_git_keys(configuration: &configuration::Configuration, register_key_req: models::RegisterKeyReq) -> Result<models::KeyView, Error<PostGitKeysError>> {
1401    // add a prefix to parameters to efficiently prevent name collisions
1402    let p_register_key_req = register_key_req;
1403
1404    let uri_str = format!("{}/v1/git/keys", configuration.base_path);
1405    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1406
1407    if let Some(ref user_agent) = configuration.user_agent {
1408        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1409    }
1410    if let Some(ref token) = configuration.bearer_access_token {
1411        req_builder = req_builder.bearer_auth(token.to_owned());
1412    };
1413    req_builder = req_builder.json(&p_register_key_req);
1414
1415    let req = req_builder.build()?;
1416    let resp = configuration.client.execute(req).await?;
1417
1418    let status = resp.status();
1419    let content_type = resp
1420        .headers()
1421        .get("content-type")
1422        .and_then(|v| v.to_str().ok())
1423        .unwrap_or("application/octet-stream");
1424    let content_type = super::ContentType::from(content_type);
1425
1426    if !status.is_client_error() && !status.is_server_error() {
1427        let content = resp.text().await?;
1428        match content_type {
1429            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1430            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeyView`"))),
1431            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KeyView`")))),
1432        }
1433    } else {
1434        let content = resp.text().await?;
1435        let entity: Option<PostGitKeysError> = serde_json::from_str(&content).ok();
1436        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1437    }
1438}
1439
1440/// Provisions an empty bare repository in the caller's scope and returns it with its clone URLs. Answers 201. The name must be unique within the scope — a repeat is a 409, never a silent overwrite of an existing repo. The org comes from the validated principal, so a repo is always born owned by the caller's own tenant.
1441pub async fn post_git_repos(configuration: &configuration::Configuration, create_req: models::CreateReq) -> Result<models::RepoView, Error<PostGitReposError>> {
1442    // add a prefix to parameters to efficiently prevent name collisions
1443    let p_create_req = create_req;
1444
1445    let uri_str = format!("{}/v1/git/repos", configuration.base_path);
1446    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1447
1448    if let Some(ref user_agent) = configuration.user_agent {
1449        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1450    }
1451    if let Some(ref token) = configuration.bearer_access_token {
1452        req_builder = req_builder.bearer_auth(token.to_owned());
1453    };
1454    req_builder = req_builder.json(&p_create_req);
1455
1456    let req = req_builder.build()?;
1457    let resp = configuration.client.execute(req).await?;
1458
1459    let status = resp.status();
1460    let content_type = resp
1461        .headers()
1462        .get("content-type")
1463        .and_then(|v| v.to_str().ok())
1464        .unwrap_or("application/octet-stream");
1465    let content_type = super::ContentType::from(content_type);
1466
1467    if !status.is_client_error() && !status.is_server_error() {
1468        let content = resp.text().await?;
1469        match content_type {
1470            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1471            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoView`"))),
1472            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoView`")))),
1473        }
1474    } else {
1475        let content = resp.text().await?;
1476        let entity: Option<PostGitReposError> = serde_json::from_str(&content).ok();
1477        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1478    }
1479}
1480
1481/// Repacks a repo into one bitmapped pack and rewrites its commit-graph, so the next clone reuses the bitmap instead of walking the whole object graph. Idempotent, and safe to interrupt — git swaps both artifacts atomically. It runs under one pack slot with the same memory bounds as a clone, so it can block behind heavy pack traffic rather than compete with it. Storage usage is re-measured afterwards, since a repack reclaims space.
1482pub async fn post_git_repos_by_name_gc(configuration: &configuration::Configuration, name: &str) -> Result<models::GcOut, Error<PostGitReposByNameGcError>> {
1483    // add a prefix to parameters to efficiently prevent name collisions
1484    let p_name = name;
1485
1486    let uri_str = format!("{}/v1/git/repos/{name}/gc", configuration.base_path, name=crate::apis::urlencode(p_name));
1487    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1488
1489    if let Some(ref user_agent) = configuration.user_agent {
1490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1491    }
1492    if let Some(ref token) = configuration.bearer_access_token {
1493        req_builder = req_builder.bearer_auth(token.to_owned());
1494    };
1495
1496    let req = req_builder.build()?;
1497    let resp = configuration.client.execute(req).await?;
1498
1499    let status = resp.status();
1500    let content_type = resp
1501        .headers()
1502        .get("content-type")
1503        .and_then(|v| v.to_str().ok())
1504        .unwrap_or("application/octet-stream");
1505    let content_type = super::ContentType::from(content_type);
1506
1507    if !status.is_client_error() && !status.is_server_error() {
1508        let content = resp.text().await?;
1509        match content_type {
1510            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1511            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GcOut`"))),
1512            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GcOut`")))),
1513        }
1514    } else {
1515        let content = resp.text().await?;
1516        let entity: Option<PostGitReposByNameGcError> = serde_json::from_str(&content).ok();
1517        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1518    }
1519}
1520
1521/// Imports an external git repository into the caller's repo, provisioning it on first use. Fetch is FORCED and covers every ref, so a first call clones the source and a repeat call re-syncs it — the endpoint is idempotent by mirror semantics. Mirrored bytes are metered exactly like a push, and a push.landed event is emitted for the default branch so the code index picks the repo up.
1522pub async fn post_git_repos_by_name_mirror(configuration: &configuration::Configuration, name: &str, mirror_req: models::MirrorReq) -> Result<models::RepoView, Error<PostGitReposByNameMirrorError>> {
1523    // add a prefix to parameters to efficiently prevent name collisions
1524    let p_name = name;
1525    let p_mirror_req = mirror_req;
1526
1527    let uri_str = format!("{}/v1/git/repos/{name}/mirror", configuration.base_path, name=crate::apis::urlencode(p_name));
1528    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1529
1530    if let Some(ref user_agent) = configuration.user_agent {
1531        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1532    }
1533    if let Some(ref token) = configuration.bearer_access_token {
1534        req_builder = req_builder.bearer_auth(token.to_owned());
1535    };
1536    req_builder = req_builder.json(&p_mirror_req);
1537
1538    let req = req_builder.build()?;
1539    let resp = configuration.client.execute(req).await?;
1540
1541    let status = resp.status();
1542    let content_type = resp
1543        .headers()
1544        .get("content-type")
1545        .and_then(|v| v.to_str().ok())
1546        .unwrap_or("application/octet-stream");
1547    let content_type = super::ContentType::from(content_type);
1548
1549    if !status.is_client_error() && !status.is_server_error() {
1550        let content = resp.text().await?;
1551        match content_type {
1552            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1553            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoView`"))),
1554            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoView`")))),
1555        }
1556    } else {
1557        let content = resp.text().await?;
1558        let entity: Option<PostGitReposByNameMirrorError> = serde_json::from_str(&content).ok();
1559        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1560    }
1561}
1562
1563/// Registers a downstream remote the repo's advanced refs are pushed to whenever a push lands here. Answers 201. The URL must be https to a host on the mirror allowlist (github.com / gitlab.com): the same set the mirror credential may be sent to, so a target can never capture the shared token or point the push at an internal service. Any embedded userinfo is stripped — credentials ride env-only at push time and never enter the stored URL. One mirror per host per repo; a second is a 409.
1564pub async fn post_git_repos_by_name_mirrors(configuration: &configuration::Configuration, name: &str, mirror_target_req: models::MirrorTargetReq) -> Result<models::MirrorTargetView, Error<PostGitReposByNameMirrorsError>> {
1565    // add a prefix to parameters to efficiently prevent name collisions
1566    let p_name = name;
1567    let p_mirror_target_req = mirror_target_req;
1568
1569    let uri_str = format!("{}/v1/git/repos/{name}/mirrors", configuration.base_path, name=crate::apis::urlencode(p_name));
1570    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1571
1572    if let Some(ref user_agent) = configuration.user_agent {
1573        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1574    }
1575    if let Some(ref token) = configuration.bearer_access_token {
1576        req_builder = req_builder.bearer_auth(token.to_owned());
1577    };
1578    req_builder = req_builder.json(&p_mirror_target_req);
1579
1580    let req = req_builder.build()?;
1581    let resp = configuration.client.execute(req).await?;
1582
1583    let status = resp.status();
1584    let content_type = resp
1585        .headers()
1586        .get("content-type")
1587        .and_then(|v| v.to_str().ok())
1588        .unwrap_or("application/octet-stream");
1589    let content_type = super::ContentType::from(content_type);
1590
1591    if !status.is_client_error() && !status.is_server_error() {
1592        let content = resp.text().await?;
1593        match content_type {
1594            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1595            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MirrorTargetView`"))),
1596            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MirrorTargetView`")))),
1597        }
1598    } else {
1599        let content = resp.text().await?;
1600        let entity: Option<PostGitReposByNameMirrorsError> = serde_json::from_str(&content).ok();
1601        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1602    }
1603}
1604
1605/// Proposes a branch for merging and returns it with its number. Answers 201. Both branches must already exist — a proposal naming a branch nobody pushed is a typo, not a plan — and base defaults to the repo's default branch.  Proposing the same head into the same base twice is a 409 while the first proposal is still open, so a retried agent run leaves ONE thing to review rather than a pile of identical ones. A repo outside the caller's scope is a 404, exactly as reading it is.
1606pub async fn post_git_repos_by_name_pulls(configuration: &configuration::Configuration, name: &str, open_req: models::OpenReq) -> Result<models::PullView, Error<PostGitReposByNamePullsError>> {
1607    // add a prefix to parameters to efficiently prevent name collisions
1608    let p_name = name;
1609    let p_open_req = open_req;
1610
1611    let uri_str = format!("{}/v1/git/repos/{name}/pulls", configuration.base_path, name=crate::apis::urlencode(p_name));
1612    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1613
1614    if let Some(ref user_agent) = configuration.user_agent {
1615        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1616    }
1617    if let Some(ref token) = configuration.bearer_access_token {
1618        req_builder = req_builder.bearer_auth(token.to_owned());
1619    };
1620    req_builder = req_builder.json(&p_open_req);
1621
1622    let req = req_builder.build()?;
1623    let resp = configuration.client.execute(req).await?;
1624
1625    let status = resp.status();
1626    let content_type = resp
1627        .headers()
1628        .get("content-type")
1629        .and_then(|v| v.to_str().ok())
1630        .unwrap_or("application/octet-stream");
1631    let content_type = super::ContentType::from(content_type);
1632
1633    if !status.is_client_error() && !status.is_server_error() {
1634        let content = resp.text().await?;
1635        match content_type {
1636            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1637            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullView`"))),
1638            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullView`")))),
1639        }
1640    } else {
1641        let content = resp.text().await?;
1642        let entity: Option<PostGitReposByNamePullsError> = serde_json::from_str(&content).ok();
1643        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1644    }
1645}
1646
1647/// Merges an open pull request by FAST-FORWARDING base to head, and answers the proposal in its merged state with the revision base now points at.  It merges only when base is already an ancestor of head — the case where head contains every commit base has, so moving the branch loses nothing and invents nothing. When base has moved on independently, this REFUSES with 409 and says so: a real three-way merge is not implemented here, and reporting one would claim a result these bytes do not produce. Rebase head onto base and merge again.  The move is judged by the same ref policy a `git push` of it would face, and fires the same build and notify reactions, so merging is not a way around either. Merging an already-merged proposal is a 409.
1648pub async fn post_git_repos_by_name_pulls_by_number_merge(configuration: &configuration::Configuration, name: &str, number: i32) -> Result<models::PullView, Error<PostGitReposByNamePullsByNumberMergeError>> {
1649    // add a prefix to parameters to efficiently prevent name collisions
1650    let p_name = name;
1651    let p_number = number;
1652
1653    let uri_str = format!("{}/v1/git/repos/{name}/pulls/{number}/merge", configuration.base_path, name=crate::apis::urlencode(p_name), number=p_number);
1654    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1655
1656    if let Some(ref user_agent) = configuration.user_agent {
1657        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1658    }
1659    if let Some(ref token) = configuration.bearer_access_token {
1660        req_builder = req_builder.bearer_auth(token.to_owned());
1661    };
1662
1663    let req = req_builder.build()?;
1664    let resp = configuration.client.execute(req).await?;
1665
1666    let status = resp.status();
1667    let content_type = resp
1668        .headers()
1669        .get("content-type")
1670        .and_then(|v| v.to_str().ok())
1671        .unwrap_or("application/octet-stream");
1672    let content_type = super::ContentType::from(content_type);
1673
1674    if !status.is_client_error() && !status.is_server_error() {
1675        let content = resp.text().await?;
1676        match content_type {
1677            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1678            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullView`"))),
1679            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullView`")))),
1680        }
1681    } else {
1682        let content = resp.text().await?;
1683        let entity: Option<PostGitReposByNamePullsByNumberMergeError> = serde_json::from_str(&content).ok();
1684        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1685    }
1686}
1687
1688/// Lands a set of files as one commit without a git client — the hanzo.app builder's push. The repo is CREATED on first push, the files are merged onto the branch tip (unlisted files survive), and the same push-to-deploy hook a real receive-pack fires is fired, so downstream this is indistinguishable from a `git push`.
1689pub async fn post_git_repos_by_name_push(configuration: &configuration::Configuration, name: &str, push_req: models::PushReq) -> Result<models::PushResp, Error<PostGitReposByNamePushError>> {
1690    // add a prefix to parameters to efficiently prevent name collisions
1691    let p_name = name;
1692    let p_push_req = push_req;
1693
1694    let uri_str = format!("{}/v1/git/repos/{name}/push", configuration.base_path, name=crate::apis::urlencode(p_name));
1695    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1696
1697    if let Some(ref user_agent) = configuration.user_agent {
1698        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1699    }
1700    if let Some(ref token) = configuration.bearer_access_token {
1701        req_builder = req_builder.bearer_auth(token.to_owned());
1702    };
1703    req_builder = req_builder.json(&p_push_req);
1704
1705    let req = req_builder.build()?;
1706    let resp = configuration.client.execute(req).await?;
1707
1708    let status = resp.status();
1709    let content_type = resp
1710        .headers()
1711        .get("content-type")
1712        .and_then(|v| v.to_str().ok())
1713        .unwrap_or("application/octet-stream");
1714    let content_type = super::ContentType::from(content_type);
1715
1716    if !status.is_client_error() && !status.is_server_error() {
1717        let content = resp.text().await?;
1718        match content_type {
1719            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1720            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PushResp`"))),
1721            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PushResp`")))),
1722        }
1723    } else {
1724        let content = resp.text().await?;
1725        let entity: Option<PostGitReposByNamePushError> = serde_json::from_str(&content).ok();
1726        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1727    }
1728}
1729
1730/// Binds a Slack channel to a repo, so the lifecycle notifier posts that repo's push and deploy events there. Answers 201. The same channel twice on one repo is a 409; a repo outside the caller's scope is a 404, exactly as reading it is.
1731pub async fn post_git_repos_by_name_subscriptions(configuration: &configuration::Configuration, name: &str, subscribe_req: models::SubscribeReq) -> Result<models::SubscriptionView, Error<PostGitReposByNameSubscriptionsError>> {
1732    // add a prefix to parameters to efficiently prevent name collisions
1733    let p_name = name;
1734    let p_subscribe_req = subscribe_req;
1735
1736    let uri_str = format!("{}/v1/git/repos/{name}/subscriptions", configuration.base_path, name=crate::apis::urlencode(p_name));
1737    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1738
1739    if let Some(ref user_agent) = configuration.user_agent {
1740        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1741    }
1742    if let Some(ref token) = configuration.bearer_access_token {
1743        req_builder = req_builder.bearer_auth(token.to_owned());
1744    };
1745    req_builder = req_builder.json(&p_subscribe_req);
1746
1747    let req = req_builder.build()?;
1748    let resp = configuration.client.execute(req).await?;
1749
1750    let status = resp.status();
1751    let content_type = resp
1752        .headers()
1753        .get("content-type")
1754        .and_then(|v| v.to_str().ok())
1755        .unwrap_or("application/octet-stream");
1756    let content_type = super::ContentType::from(content_type);
1757
1758    if !status.is_client_error() && !status.is_server_error() {
1759        let content = resp.text().await?;
1760        match content_type {
1761            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1762            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SubscriptionView`"))),
1763            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SubscriptionView`")))),
1764        }
1765    } else {
1766        let content = resp.text().await?;
1767        let entity: Option<PostGitReposByNameSubscriptionsError> = serde_json::from_str(&content).ok();
1768        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1769    }
1770}
1771
1772/// GONE (410). Push-to-deploy belongs to POST https://platform.hanzo.ai/v1/git-webhook, which owns the build system-of-record and dispatches BuildKit Jobs. git.hanzo.ai delivers there through ONE forge-wide system webhook covering every repository; a repo opts in by committing hanzo.yml, not by owning a hook of its own.  Every delivery answers 410 whatever it carries — this endpoint reads no body and authenticates nothing.  410 rather than 404, because the address was real and its meaning moved, which is the distinction 410 carries. A 404 from this estate is ambiguous: Hanzo Git serves /v1, so /api/v1 404s too and reads as \"the API is switched off\". A retired endpoint says it is retired and names its replacement, so the answer carries its own fix.
1773pub async fn post_git_webhook(configuration: &configuration::Configuration, ) -> Result<(), Error<PostGitWebhookError>> {
1774
1775    let uri_str = format!("{}/v1/git/webhook", configuration.base_path);
1776    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1777
1778    if let Some(ref user_agent) = configuration.user_agent {
1779        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1780    }
1781    if let Some(ref token) = configuration.bearer_access_token {
1782        req_builder = req_builder.bearer_auth(token.to_owned());
1783    };
1784
1785    let req = req_builder.build()?;
1786    let resp = configuration.client.execute(req).await?;
1787
1788    let status = resp.status();
1789
1790    if !status.is_client_error() && !status.is_server_error() {
1791        Ok(())
1792    } else {
1793        let content = resp.text().await?;
1794        let entity: Option<PostGitWebhookError> = serde_json::from_str(&content).ok();
1795        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1796    }
1797}
1798
1799/// Creates a repository in the caller's org and project scope and answers with its record. `name` is required and `description` is optional; `project` narrows the scope within the org. A name already taken in that scope is a 409 envelope and an invalid name a 400.  A ZAP PROCEDURE, not a REST resource. It answers the bridge's {status, msg, data} envelope rather than the raw view the /v1 route returns, and it calls the SAME core function the REST route calls, so the two transports cannot diverge in behaviour. Org and project scope come from the request identity and NEVER from the body: the body cannot widen the caller's scope. Without a validated org the answer is a 403 envelope.
1800pub async fn post_git_zap_createrepo(configuration: &configuration::Configuration, zap_proc_req: Option<models::ZapProcReq>) -> Result<(), Error<PostGitZapCreaterepoError>> {
1801    // add a prefix to parameters to efficiently prevent name collisions
1802    let p_zap_proc_req = zap_proc_req;
1803
1804    let uri_str = format!("{}/v1/git/zap/createRepo", configuration.base_path);
1805    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1806
1807    if let Some(ref user_agent) = configuration.user_agent {
1808        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1809    }
1810    if let Some(ref token) = configuration.bearer_access_token {
1811        req_builder = req_builder.bearer_auth(token.to_owned());
1812    };
1813    req_builder = req_builder.json(&p_zap_proc_req);
1814
1815    let req = req_builder.build()?;
1816    let resp = configuration.client.execute(req).await?;
1817
1818    let status = resp.status();
1819
1820    if !status.is_client_error() && !status.is_server_error() {
1821        Ok(())
1822    } else {
1823        let content = resp.text().await?;
1824        let entity: Option<PostGitZapCreaterepoError> = serde_json::from_str(&content).ok();
1825        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1826    }
1827}
1828
1829/// Deletes the repository named by `name` and answers with the deleted name. A repository outside the caller's org and project scope is a 404 envelope, so a delete can never reach another tenant's repository.  A ZAP PROCEDURE, not a REST resource. It answers the bridge's {status, msg, data} envelope rather than the raw view the /v1 route returns, and it calls the SAME core function the REST route calls, so the two transports cannot diverge in behaviour. Org and project scope come from the request identity and NEVER from the body: the body cannot widen the caller's scope. Without a validated org the answer is a 403 envelope.
1830pub async fn post_git_zap_deleterepo(configuration: &configuration::Configuration, zap_proc_req: Option<models::ZapProcReq>) -> Result<(), Error<PostGitZapDeleterepoError>> {
1831    // add a prefix to parameters to efficiently prevent name collisions
1832    let p_zap_proc_req = zap_proc_req;
1833
1834    let uri_str = format!("{}/v1/git/zap/deleteRepo", configuration.base_path);
1835    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1836
1837    if let Some(ref user_agent) = configuration.user_agent {
1838        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1839    }
1840    if let Some(ref token) = configuration.bearer_access_token {
1841        req_builder = req_builder.bearer_auth(token.to_owned());
1842    };
1843    req_builder = req_builder.json(&p_zap_proc_req);
1844
1845    let req = req_builder.build()?;
1846    let resp = configuration.client.execute(req).await?;
1847
1848    let status = resp.status();
1849
1850    if !status.is_client_error() && !status.is_server_error() {
1851        Ok(())
1852    } else {
1853        let content = resp.text().await?;
1854        let entity: Option<PostGitZapDeleterepoError> = serde_json::from_str(&content).ok();
1855        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1856    }
1857}
1858
1859/// Answers a single repository's record, named by `name`. A repository outside the caller's org and project scope is a 404 envelope, the same answer one that does not exist gets.  A ZAP PROCEDURE, not a REST resource. It answers the bridge's {status, msg, data} envelope rather than the raw view the /v1 route returns, and it calls the SAME core function the REST route calls, so the two transports cannot diverge in behaviour. Org and project scope come from the request identity and NEVER from the body: the body cannot widen the caller's scope. Without a validated org the answer is a 403 envelope.
1860pub async fn post_git_zap_getrepo(configuration: &configuration::Configuration, zap_proc_req: Option<models::ZapProcReq>) -> Result<(), Error<PostGitZapGetrepoError>> {
1861    // add a prefix to parameters to efficiently prevent name collisions
1862    let p_zap_proc_req = zap_proc_req;
1863
1864    let uri_str = format!("{}/v1/git/zap/getRepo", configuration.base_path);
1865    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1866
1867    if let Some(ref user_agent) = configuration.user_agent {
1868        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1869    }
1870    if let Some(ref token) = configuration.bearer_access_token {
1871        req_builder = req_builder.bearer_auth(token.to_owned());
1872    };
1873    req_builder = req_builder.json(&p_zap_proc_req);
1874
1875    let req = req_builder.build()?;
1876    let resp = configuration.client.execute(req).await?;
1877
1878    let status = resp.status();
1879
1880    if !status.is_client_error() && !status.is_server_error() {
1881        Ok(())
1882    } else {
1883        let content = resp.text().await?;
1884        let entity: Option<PostGitZapGetrepoError> = serde_json::from_str(&content).ok();
1885        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1886    }
1887}
1888
1889/// Answers every repository in the caller's org and project scope. It reads NO body — the scope is entirely the caller's identity — so a request with an empty object is correct.  A ZAP PROCEDURE, not a REST resource. It answers the bridge's {status, msg, data} envelope rather than the raw view the /v1 route returns, and it calls the SAME core function the REST route calls, so the two transports cannot diverge in behaviour. Org and project scope come from the request identity and NEVER from the body: the body cannot widen the caller's scope. Without a validated org the answer is a 403 envelope.
1890pub async fn post_git_zap_listrepos(configuration: &configuration::Configuration, ) -> Result<(), Error<PostGitZapListreposError>> {
1891
1892    let uri_str = format!("{}/v1/git/zap/listRepos", configuration.base_path);
1893    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1894
1895    if let Some(ref user_agent) = configuration.user_agent {
1896        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1897    }
1898    if let Some(ref token) = configuration.bearer_access_token {
1899        req_builder = req_builder.bearer_auth(token.to_owned());
1900    };
1901
1902    let req = req_builder.build()?;
1903    let resp = configuration.client.execute(req).await?;
1904
1905    let status = resp.status();
1906
1907    if !status.is_client_error() && !status.is_server_error() {
1908        Ok(())
1909    } else {
1910        let content = resp.text().await?;
1911        let entity: Option<PostGitZapListreposError> = serde_json::from_str(&content).ok();
1912        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1913    }
1914}
1915
1916/// Answers every repository in the caller's org with its size in bytes, plus the org's total — what git storage is actually being used, and by which repository. It reads NO body, and it is scoped to the caller's own org, so it is that org's footprint and never the fleet's.  A ZAP PROCEDURE, not a REST resource. It answers the bridge's {status, msg, data} envelope rather than the raw view the /v1 route returns, and it calls the SAME core function the REST route calls, so the two transports cannot diverge in behaviour. Org and project scope come from the request identity and NEVER from the body: the body cannot widen the caller's scope. Without a validated org the answer is a 403 envelope.
1917pub async fn post_git_zap_usage(configuration: &configuration::Configuration, ) -> Result<(), Error<PostGitZapUsageError>> {
1918
1919    let uri_str = format!("{}/v1/git/zap/usage", configuration.base_path);
1920    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1921
1922    if let Some(ref user_agent) = configuration.user_agent {
1923        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1924    }
1925    if let Some(ref token) = configuration.bearer_access_token {
1926        req_builder = req_builder.bearer_auth(token.to_owned());
1927    };
1928
1929    let req = req_builder.build()?;
1930    let resp = configuration.client.execute(req).await?;
1931
1932    let status = resp.status();
1933
1934    if !status.is_client_error() && !status.is_server_error() {
1935        Ok(())
1936    } else {
1937        let content = resp.text().await?;
1938        let entity: Option<PostGitZapUsageError> = serde_json::from_str(&content).ok();
1939        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1940    }
1941}
1942