1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteGitKeysByIdError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteGitReposByNameError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteGitReposByNameMirrorsByIdError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteGitReposByNameSubscriptionsByIdError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetGitError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetGitByOrgByProjectByRepoInfoRefsError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetGitByOrgByRepoError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetGitByOrgByRepoCommitsError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetGitByOrgByRepoInfoRefsError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetGitExploreError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetGitKeysError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetGitReposError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetGitReposByNameError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetGitReposByNameBlobError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetGitReposByNameCommitsError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetGitReposByNameFilesError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetGitReposByNameMirrorsError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetGitReposByNamePullsError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetGitReposByNamePullsByNumberError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetGitReposByNameReadmeError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetGitReposByNameRefsError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetGitReposByNameSubscriptionsError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetGitReposByNameTreeError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetGitUsageError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum PatchGitReposByNameError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PostGitByOrgByProjectByRepoGitReceivePackError {
197 UnknownValue(serde_json::Value),
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum PostGitByOrgByProjectByRepoGitUploadPackError {
204 UnknownValue(serde_json::Value),
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum PostGitByOrgByRepoGitReceivePackError {
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum PostGitByOrgByRepoGitUploadPackError {
218 UnknownValue(serde_json::Value),
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum PostGitKeysError {
225 UnknownValue(serde_json::Value),
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum PostGitReposError {
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum PostGitReposByNameGcError {
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum PostGitReposByNameMirrorError {
246 UnknownValue(serde_json::Value),
247}
248
249#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum PostGitReposByNameMirrorsError {
253 UnknownValue(serde_json::Value),
254}
255
256#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum PostGitReposByNamePullsError {
260 UnknownValue(serde_json::Value),
261}
262
263#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum PostGitReposByNamePullsByNumberMergeError {
267 UnknownValue(serde_json::Value),
268}
269
270#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum PostGitReposByNamePushError {
274 UnknownValue(serde_json::Value),
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum PostGitReposByNameSubscriptionsError {
281 UnknownValue(serde_json::Value),
282}
283
284#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum PostGitWebhookError {
288 UnknownValue(serde_json::Value),
289}
290
291#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum PostGitZapCreaterepoError {
295 UnknownValue(serde_json::Value),
296}
297
298#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum PostGitZapDeleterepoError {
302 UnknownValue(serde_json::Value),
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum PostGitZapGetrepoError {
309 UnknownValue(serde_json::Value),
310}
311
312#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum PostGitZapListreposError {
316 UnknownValue(serde_json::Value),
317}
318
319#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum PostGitZapUsageError {
323 UnknownValue(serde_json::Value),
324}
325
326
327pub async fn delete_git_keys_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteGitKeysByIdError>> {
329 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
356pub async fn delete_git_repos_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteGitReposByNameError>> {
358 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
385pub async fn delete_git_repos_by_name_mirrors_by_id(configuration: &configuration::Configuration, name: &str, id: &str) -> Result<(), Error<DeleteGitReposByNameMirrorsByIdError>> {
387 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
415pub async fn delete_git_repos_by_name_subscriptions_by_id(configuration: &configuration::Configuration, name: &str, id: &str) -> Result<(), Error<DeleteGitReposByNameSubscriptionsByIdError>> {
417 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
445pub 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
472pub 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 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
503pub async fn get_git_by_org_by_repo(configuration: &configuration::Configuration, org: &str, repo: &str) -> Result<(), Error<GetGitByOrgByRepoError>> {
505 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
533pub async fn get_git_by_org_by_repo_commits(configuration: &configuration::Configuration, org: &str, repo: &str) -> Result<(), Error<GetGitByOrgByRepoCommitsError>> {
535 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
563pub async fn get_git_by_org_by_repo_info_refs(configuration: &configuration::Configuration, org: &str, repo: &str) -> Result<(), Error<GetGitByOrgByRepoInfoRefsError>> {
565 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
593pub 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
620pub 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
658pub 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
696pub async fn get_git_repos_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::RepoView, Error<GetGitReposByNameError>> {
698 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
736pub 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 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", ¶m_value.to_string())]);
748 }
749 if let Some(ref param_value) = p_path {
750 req_builder = req_builder.query(&[("path", ¶m_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
784pub 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 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", ¶m_value.to_string())]);
797 }
798 if let Some(ref param_value) = p_path {
799 req_builder = req_builder.query(&[("path", ¶m_value.to_string())]);
800 }
801 if let Some(ref param_value) = p_limit {
802 req_builder = req_builder.query(&[("limit", ¶m_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
836pub 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 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", ¶m_value.to_string())]);
848 }
849 if let Some(ref param_value) = p_glob {
850 req_builder = req_builder.query(&[("glob", ¶m_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
884pub async fn get_git_repos_by_name_mirrors(configuration: &configuration::Configuration, name: &str) -> Result<models::MirrorList, Error<GetGitReposByNameMirrorsError>> {
886 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
924pub async fn get_git_repos_by_name_pulls(configuration: &configuration::Configuration, name: &str, state: Option<&str>) -> Result<models::PullList, Error<GetGitReposByNamePullsError>> {
926 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", ¶m_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
968pub async fn get_git_repos_by_name_pulls_by_number(configuration: &configuration::Configuration, name: &str, number: i32) -> Result<models::PullView, Error<GetGitReposByNamePullsByNumberError>> {
970 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
1009pub async fn get_git_repos_by_name_readme(configuration: &configuration::Configuration, name: &str, r#ref: Option<&str>) -> Result<models::ReadmeJson, Error<GetGitReposByNameReadmeError>> {
1011 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", ¶m_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
1053pub async fn get_git_repos_by_name_refs(configuration: &configuration::Configuration, name: &str) -> Result<models::RefsJson, Error<GetGitReposByNameRefsError>> {
1055 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
1093pub async fn get_git_repos_by_name_subscriptions(configuration: &configuration::Configuration, name: &str) -> Result<models::SubscriptionList, Error<GetGitReposByNameSubscriptionsError>> {
1095 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
1133pub 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 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", ¶m_value.to_string())]);
1145 }
1146 if let Some(ref param_value) = p_path {
1147 req_builder = req_builder.query(&[("path", ¶m_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
1181pub 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
1219pub async fn patch_git_repos_by_name(configuration: &configuration::Configuration, name: &str, patch_in: models::PatchIn) -> Result<models::RepoView, Error<PatchGitReposByNameError>> {
1221 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
1261pub 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 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
1296pub 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 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
1331pub 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 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
1365pub 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 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
1399pub async fn post_git_keys(configuration: &configuration::Configuration, register_key_req: models::RegisterKeyReq) -> Result<models::KeyView, Error<PostGitKeysError>> {
1401 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
1440pub async fn post_git_repos(configuration: &configuration::Configuration, create_req: models::CreateReq) -> Result<models::RepoView, Error<PostGitReposError>> {
1442 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
1481pub async fn post_git_repos_by_name_gc(configuration: &configuration::Configuration, name: &str) -> Result<models::GcOut, Error<PostGitReposByNameGcError>> {
1483 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
1521pub async fn post_git_repos_by_name_mirror(configuration: &configuration::Configuration, name: &str, mirror_req: models::MirrorReq) -> Result<models::RepoView, Error<PostGitReposByNameMirrorError>> {
1523 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
1563pub async fn post_git_repos_by_name_mirrors(configuration: &configuration::Configuration, name: &str, mirror_target_req: models::MirrorTargetReq) -> Result<models::MirrorTargetView, Error<PostGitReposByNameMirrorsError>> {
1565 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
1605pub async fn post_git_repos_by_name_pulls(configuration: &configuration::Configuration, name: &str, open_req: models::OpenReq) -> Result<models::PullView, Error<PostGitReposByNamePullsError>> {
1607 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
1647pub async fn post_git_repos_by_name_pulls_by_number_merge(configuration: &configuration::Configuration, name: &str, number: i32) -> Result<models::PullView, Error<PostGitReposByNamePullsByNumberMergeError>> {
1649 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
1688pub async fn post_git_repos_by_name_push(configuration: &configuration::Configuration, name: &str, push_req: models::PushReq) -> Result<models::PushResp, Error<PostGitReposByNamePushError>> {
1690 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
1730pub async fn post_git_repos_by_name_subscriptions(configuration: &configuration::Configuration, name: &str, subscribe_req: models::SubscribeReq) -> Result<models::SubscriptionView, Error<PostGitReposByNameSubscriptionsError>> {
1732 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
1772pub 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
1799pub async fn post_git_zap_createrepo(configuration: &configuration::Configuration, zap_proc_req: Option<models::ZapProcReq>) -> Result<(), Error<PostGitZapCreaterepoError>> {
1801 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
1829pub async fn post_git_zap_deleterepo(configuration: &configuration::Configuration, zap_proc_req: Option<models::ZapProcReq>) -> Result<(), Error<PostGitZapDeleterepoError>> {
1831 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
1859pub async fn post_git_zap_getrepo(configuration: &configuration::Configuration, zap_proc_req: Option<models::ZapProcReq>) -> Result<(), Error<PostGitZapGetrepoError>> {
1861 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
1889pub 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
1916pub 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