1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum IssueAddLabelError {
22 Status403(),
23 Status404(),
24 UnknownValue(serde_json::Value),
25}
26
27#[derive(Debug, Clone, Serialize, Deserialize)]
29#[serde(untagged)]
30pub enum IssueAddSubscriptionError {
31 Status404(),
32 UnknownValue(serde_json::Value),
33}
34
35#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum IssueAddTimeError {
39 Status400(),
40 Status403(),
41 Status404(),
42 UnknownValue(serde_json::Value),
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum IssueCheckSubscriptionError {
49 Status404(),
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum IssueClearLabelsError {
57 Status403(),
58 Status404(),
59 UnknownValue(serde_json::Value),
60}
61
62#[derive(Debug, Clone, Serialize, Deserialize)]
64#[serde(untagged)]
65pub enum IssueCreateCommentError {
66 Status403(),
67 Status404(),
68 Status423(),
69 UnknownValue(serde_json::Value),
70}
71
72#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum IssueCreateIssueError {
76 Status403(),
77 Status404(),
78 Status412(),
79 Status422(),
80 Status423(),
81 UnknownValue(serde_json::Value),
82}
83
84#[derive(Debug, Clone, Serialize, Deserialize)]
86#[serde(untagged)]
87pub enum IssueCreateIssueAttachmentError {
88 Status400(),
89 Status404(),
90 Status422(),
91 Status423(),
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum IssueCreateIssueBlockingError {
99 Status404(),
100 UnknownValue(serde_json::Value),
101}
102
103#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum IssueCreateIssueCommentAttachmentError {
107 Status400(),
108 Status403(),
109 Status404(),
110 Status422(),
111 Status423(),
112 UnknownValue(serde_json::Value),
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum IssueCreateIssueDependenciesError {
119 Status404(),
120 Status423(),
121 UnknownValue(serde_json::Value),
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum IssueCreateLabelError {
128 Status404(),
129 Status422(),
130 UnknownValue(serde_json::Value),
131}
132
133#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum IssueCreateMilestoneError {
137 Status404(),
138 UnknownValue(serde_json::Value),
139}
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
143#[serde(untagged)]
144pub enum IssueDeleteError {
145 Status403(),
146 Status404(),
147 UnknownValue(serde_json::Value),
148}
149
150#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum IssueDeleteCommentError {
154 Status403(),
155 Status404(),
156 UnknownValue(serde_json::Value),
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(untagged)]
162pub enum IssueDeleteCommentDeprecatedError {
163 Status403(),
164 Status404(),
165 UnknownValue(serde_json::Value),
166}
167
168#[derive(Debug, Clone, Serialize, Deserialize)]
170#[serde(untagged)]
171pub enum IssueDeleteCommentReactionError {
172 Status403(),
173 Status404(),
174 UnknownValue(serde_json::Value),
175}
176
177#[derive(Debug, Clone, Serialize, Deserialize)]
179#[serde(untagged)]
180pub enum IssueDeleteIssueAttachmentError {
181 Status404(),
182 Status423(),
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum IssueDeleteIssueCommentAttachmentError {
190 Status404(),
191 Status423(),
192 UnknownValue(serde_json::Value),
193}
194
195#[derive(Debug, Clone, Serialize, Deserialize)]
197#[serde(untagged)]
198pub enum IssueDeleteIssueReactionError {
199 Status403(),
200 Status404(),
201 UnknownValue(serde_json::Value),
202}
203
204#[derive(Debug, Clone, Serialize, Deserialize)]
206#[serde(untagged)]
207pub enum IssueDeleteLabelError {
208 Status404(),
209 UnknownValue(serde_json::Value),
210}
211
212#[derive(Debug, Clone, Serialize, Deserialize)]
214#[serde(untagged)]
215pub enum IssueDeleteMilestoneError {
216 Status404(),
217 UnknownValue(serde_json::Value),
218}
219
220#[derive(Debug, Clone, Serialize, Deserialize)]
222#[serde(untagged)]
223pub enum IssueDeleteStopWatchError {
224 Status403(),
225 Status404(),
226 Status409(),
227 UnknownValue(serde_json::Value),
228}
229
230#[derive(Debug, Clone, Serialize, Deserialize)]
232#[serde(untagged)]
233pub enum IssueDeleteSubscriptionError {
234 Status404(),
235 UnknownValue(serde_json::Value),
236}
237
238#[derive(Debug, Clone, Serialize, Deserialize)]
240#[serde(untagged)]
241pub enum IssueDeleteTimeError {
242 Status400(),
243 Status403(),
244 Status404(),
245 UnknownValue(serde_json::Value),
246}
247
248#[derive(Debug, Clone, Serialize, Deserialize)]
250#[serde(untagged)]
251pub enum IssueEditCommentError {
252 Status403(),
253 Status404(),
254 Status423(),
255 UnknownValue(serde_json::Value),
256}
257
258#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum IssueEditCommentDeprecatedError {
262 Status403(),
263 Status404(),
264 UnknownValue(serde_json::Value),
265}
266
267#[derive(Debug, Clone, Serialize, Deserialize)]
269#[serde(untagged)]
270pub enum IssueEditIssueError {
271 Status403(),
272 Status404(),
273 Status412(),
274 UnknownValue(serde_json::Value),
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum IssueEditIssueAttachmentError {
281 Status404(),
282 Status423(),
283 UnknownValue(serde_json::Value),
284}
285
286#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum IssueEditIssueCommentAttachmentError {
290 Status404(),
291 Status423(),
292 UnknownValue(serde_json::Value),
293}
294
295#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(untagged)]
298pub enum IssueEditIssueDeadlineError {
299 Status403(),
300 Status404(),
301 UnknownValue(serde_json::Value),
302}
303
304#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(untagged)]
307pub enum IssueEditLabelError {
308 Status404(),
309 Status422(),
310 UnknownValue(serde_json::Value),
311}
312
313#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum IssueEditMilestoneError {
317 Status404(),
318 UnknownValue(serde_json::Value),
319}
320
321#[derive(Debug, Clone, Serialize, Deserialize)]
323#[serde(untagged)]
324pub enum IssueGetCommentError {
325 Status403(),
326 Status404(),
327 UnknownValue(serde_json::Value),
328}
329
330#[derive(Debug, Clone, Serialize, Deserialize)]
332#[serde(untagged)]
333pub enum IssueGetCommentReactionsError {
334 Status403(),
335 Status404(),
336 UnknownValue(serde_json::Value),
337}
338
339#[derive(Debug, Clone, Serialize, Deserialize)]
341#[serde(untagged)]
342pub enum IssueGetCommentsError {
343 Status404(),
344 UnknownValue(serde_json::Value),
345}
346
347#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum IssueGetCommentsAndTimelineError {
351 Status404(),
352 UnknownValue(serde_json::Value),
353}
354
355#[derive(Debug, Clone, Serialize, Deserialize)]
357#[serde(untagged)]
358pub enum IssueGetIssueError {
359 Status404(),
360 UnknownValue(serde_json::Value),
361}
362
363#[derive(Debug, Clone, Serialize, Deserialize)]
365#[serde(untagged)]
366pub enum IssueGetIssueAttachmentError {
367 Status404(),
368 UnknownValue(serde_json::Value),
369}
370
371#[derive(Debug, Clone, Serialize, Deserialize)]
373#[serde(untagged)]
374pub enum IssueGetIssueCommentAttachmentError {
375 Status404(),
376 UnknownValue(serde_json::Value),
377}
378
379#[derive(Debug, Clone, Serialize, Deserialize)]
381#[serde(untagged)]
382pub enum IssueGetIssueReactionsError {
383 Status403(),
384 Status404(),
385 UnknownValue(serde_json::Value),
386}
387
388#[derive(Debug, Clone, Serialize, Deserialize)]
390#[serde(untagged)]
391pub enum IssueGetLabelError {
392 Status404(),
393 UnknownValue(serde_json::Value),
394}
395
396#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum IssueGetLabelsError {
400 Status404(),
401 UnknownValue(serde_json::Value),
402}
403
404#[derive(Debug, Clone, Serialize, Deserialize)]
406#[serde(untagged)]
407pub enum IssueGetMilestoneError {
408 Status404(),
409 UnknownValue(serde_json::Value),
410}
411
412#[derive(Debug, Clone, Serialize, Deserialize)]
414#[serde(untagged)]
415pub enum IssueGetMilestonesListError {
416 Status404(),
417 UnknownValue(serde_json::Value),
418}
419
420#[derive(Debug, Clone, Serialize, Deserialize)]
422#[serde(untagged)]
423pub enum IssueGetRepoCommentsError {
424 Status404(),
425 UnknownValue(serde_json::Value),
426}
427
428#[derive(Debug, Clone, Serialize, Deserialize)]
430#[serde(untagged)]
431pub enum IssueListBlocksError {
432 Status404(),
433 UnknownValue(serde_json::Value),
434}
435
436#[derive(Debug, Clone, Serialize, Deserialize)]
438#[serde(untagged)]
439pub enum IssueListIssueAttachmentsError {
440 Status404(),
441 UnknownValue(serde_json::Value),
442}
443
444#[derive(Debug, Clone, Serialize, Deserialize)]
446#[serde(untagged)]
447pub enum IssueListIssueCommentAttachmentsError {
448 Status404(),
449 UnknownValue(serde_json::Value),
450}
451
452#[derive(Debug, Clone, Serialize, Deserialize)]
454#[serde(untagged)]
455pub enum IssueListIssueDependenciesError {
456 Status404(),
457 UnknownValue(serde_json::Value),
458}
459
460#[derive(Debug, Clone, Serialize, Deserialize)]
462#[serde(untagged)]
463pub enum IssueListIssuesError {
464 Status404(),
465 UnknownValue(serde_json::Value),
466}
467
468#[derive(Debug, Clone, Serialize, Deserialize)]
470#[serde(untagged)]
471pub enum IssueListLabelsError {
472 Status404(),
473 UnknownValue(serde_json::Value),
474}
475
476#[derive(Debug, Clone, Serialize, Deserialize)]
478#[serde(untagged)]
479pub enum IssuePostCommentReactionError {
480 Status403(),
481 Status404(),
482 UnknownValue(serde_json::Value),
483}
484
485#[derive(Debug, Clone, Serialize, Deserialize)]
487#[serde(untagged)]
488pub enum IssuePostIssueReactionError {
489 Status403(),
490 Status404(),
491 UnknownValue(serde_json::Value),
492}
493
494#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(untagged)]
497pub enum IssueRemoveIssueBlockingError {
498 Status404(),
499 UnknownValue(serde_json::Value),
500}
501
502#[derive(Debug, Clone, Serialize, Deserialize)]
504#[serde(untagged)]
505pub enum IssueRemoveIssueDependenciesError {
506 Status404(),
507 Status423(),
508 UnknownValue(serde_json::Value),
509}
510
511#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum IssueRemoveLabelError {
515 Status403(),
516 Status404(),
517 Status422(),
518 UnknownValue(serde_json::Value),
519}
520
521#[derive(Debug, Clone, Serialize, Deserialize)]
523#[serde(untagged)]
524pub enum IssueReplaceLabelsError {
525 Status403(),
526 Status404(),
527 UnknownValue(serde_json::Value),
528}
529
530#[derive(Debug, Clone, Serialize, Deserialize)]
532#[serde(untagged)]
533pub enum IssueResetTimeError {
534 Status400(),
535 Status403(),
536 Status404(),
537 UnknownValue(serde_json::Value),
538}
539
540#[derive(Debug, Clone, Serialize, Deserialize)]
542#[serde(untagged)]
543pub enum IssueSearchIssuesError {
544 UnknownValue(serde_json::Value),
545}
546
547#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(untagged)]
550pub enum IssueStartStopWatchError {
551 Status403(),
552 Status404(),
553 Status409(),
554 UnknownValue(serde_json::Value),
555}
556
557#[derive(Debug, Clone, Serialize, Deserialize)]
559#[serde(untagged)]
560pub enum IssueStopStopWatchError {
561 Status403(),
562 Status404(),
563 Status409(),
564 UnknownValue(serde_json::Value),
565}
566
567#[derive(Debug, Clone, Serialize, Deserialize)]
569#[serde(untagged)]
570pub enum IssueSubscriptionsError {
571 Status404(),
572 UnknownValue(serde_json::Value),
573}
574
575#[derive(Debug, Clone, Serialize, Deserialize)]
577#[serde(untagged)]
578pub enum IssueTrackedTimesError {
579 Status404(),
580 UnknownValue(serde_json::Value),
581}
582
583#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum MoveIssuePinError {
587 Status403(),
588 Status404(),
589 UnknownValue(serde_json::Value),
590}
591
592#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum PinIssueError {
596 Status403(),
597 Status404(),
598 UnknownValue(serde_json::Value),
599}
600
601#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum UnpinIssueError {
605 Status403(),
606 Status404(),
607 UnknownValue(serde_json::Value),
608}
609
610
611pub async fn issue_add_label(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option<models::IssueLabelsOption>) -> Result<Vec<models::Label>, Error<IssueAddLabelError>> {
612 let local_var_configuration = configuration;
613
614 let local_var_client = &local_var_configuration.client;
615
616 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
617 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
618
619 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
620 let local_var_key = local_var_apikey.key.clone();
621 let local_var_value = match local_var_apikey.prefix {
622 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
623 None => local_var_key,
624 };
625 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
626 }
627 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
628 let local_var_key = local_var_apikey.key.clone();
629 let local_var_value = match local_var_apikey.prefix {
630 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
631 None => local_var_key,
632 };
633 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
634 }
635 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
636 let local_var_key = local_var_apikey.key.clone();
637 let local_var_value = match local_var_apikey.prefix {
638 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
639 None => local_var_key,
640 };
641 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
642 }
643 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
644 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
645 }
646 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
647 let local_var_key = local_var_apikey.key.clone();
648 let local_var_value = match local_var_apikey.prefix {
649 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
650 None => local_var_key,
651 };
652 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
653 };
654 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
655 let local_var_key = local_var_apikey.key.clone();
656 let local_var_value = match local_var_apikey.prefix {
657 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
658 None => local_var_key,
659 };
660 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
661 };
662 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
663 let local_var_key = local_var_apikey.key.clone();
664 let local_var_value = match local_var_apikey.prefix {
665 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
666 None => local_var_key,
667 };
668 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
669 };
670 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
671 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
672 };
673 local_var_req_builder = local_var_req_builder.json(&body);
674
675 let local_var_req = local_var_req_builder.build()?;
676 let local_var_resp = local_var_client.execute(local_var_req).await?;
677
678 let local_var_status = local_var_resp.status();
679 let local_var_content = local_var_resp.text().await?;
680
681 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
682 serde_json::from_str(&local_var_content).map_err(Error::from)
683 } else {
684 let local_var_entity: Option<IssueAddLabelError> = serde_json::from_str(&local_var_content).ok();
685 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
686 Err(Error::ResponseError(local_var_error))
687 }
688}
689
690pub async fn issue_add_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, user: &str) -> Result<(), Error<IssueAddSubscriptionError>> {
691 let local_var_configuration = configuration;
692
693 let local_var_client = &local_var_configuration.client;
694
695 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, user=crate::apis::urlencode(user));
696 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
697
698 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
699 let local_var_key = local_var_apikey.key.clone();
700 let local_var_value = match local_var_apikey.prefix {
701 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
702 None => local_var_key,
703 };
704 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
705 }
706 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
707 let local_var_key = local_var_apikey.key.clone();
708 let local_var_value = match local_var_apikey.prefix {
709 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
710 None => local_var_key,
711 };
712 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
713 }
714 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
715 let local_var_key = local_var_apikey.key.clone();
716 let local_var_value = match local_var_apikey.prefix {
717 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
718 None => local_var_key,
719 };
720 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
721 }
722 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
723 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
724 }
725 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
726 let local_var_key = local_var_apikey.key.clone();
727 let local_var_value = match local_var_apikey.prefix {
728 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
729 None => local_var_key,
730 };
731 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
732 };
733 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
734 let local_var_key = local_var_apikey.key.clone();
735 let local_var_value = match local_var_apikey.prefix {
736 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
737 None => local_var_key,
738 };
739 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
740 };
741 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
742 let local_var_key = local_var_apikey.key.clone();
743 let local_var_value = match local_var_apikey.prefix {
744 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
745 None => local_var_key,
746 };
747 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
748 };
749 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
750 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
751 };
752
753 let local_var_req = local_var_req_builder.build()?;
754 let local_var_resp = local_var_client.execute(local_var_req).await?;
755
756 let local_var_status = local_var_resp.status();
757 let local_var_content = local_var_resp.text().await?;
758
759 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
760 Ok(())
761 } else {
762 let local_var_entity: Option<IssueAddSubscriptionError> = serde_json::from_str(&local_var_content).ok();
763 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
764 Err(Error::ResponseError(local_var_error))
765 }
766}
767
768pub async fn issue_add_time(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option<models::AddTimeOption>) -> Result<models::TrackedTime, Error<IssueAddTimeError>> {
769 let local_var_configuration = configuration;
770
771 let local_var_client = &local_var_configuration.client;
772
773 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
774 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
775
776 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
777 let local_var_key = local_var_apikey.key.clone();
778 let local_var_value = match local_var_apikey.prefix {
779 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
780 None => local_var_key,
781 };
782 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
783 }
784 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
785 let local_var_key = local_var_apikey.key.clone();
786 let local_var_value = match local_var_apikey.prefix {
787 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
788 None => local_var_key,
789 };
790 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
791 }
792 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
793 let local_var_key = local_var_apikey.key.clone();
794 let local_var_value = match local_var_apikey.prefix {
795 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
796 None => local_var_key,
797 };
798 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
799 }
800 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
801 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
802 }
803 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
804 let local_var_key = local_var_apikey.key.clone();
805 let local_var_value = match local_var_apikey.prefix {
806 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
807 None => local_var_key,
808 };
809 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
810 };
811 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
812 let local_var_key = local_var_apikey.key.clone();
813 let local_var_value = match local_var_apikey.prefix {
814 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
815 None => local_var_key,
816 };
817 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
818 };
819 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
820 let local_var_key = local_var_apikey.key.clone();
821 let local_var_value = match local_var_apikey.prefix {
822 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
823 None => local_var_key,
824 };
825 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
826 };
827 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
828 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
829 };
830 local_var_req_builder = local_var_req_builder.json(&body);
831
832 let local_var_req = local_var_req_builder.build()?;
833 let local_var_resp = local_var_client.execute(local_var_req).await?;
834
835 let local_var_status = local_var_resp.status();
836 let local_var_content = local_var_resp.text().await?;
837
838 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
839 serde_json::from_str(&local_var_content).map_err(Error::from)
840 } else {
841 let local_var_entity: Option<IssueAddTimeError> = serde_json::from_str(&local_var_content).ok();
842 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
843 Err(Error::ResponseError(local_var_error))
844 }
845}
846
847pub async fn issue_check_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<models::WatchInfo, Error<IssueCheckSubscriptionError>> {
848 let local_var_configuration = configuration;
849
850 let local_var_client = &local_var_configuration.client;
851
852 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/check", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
853 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
854
855 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
856 let local_var_key = local_var_apikey.key.clone();
857 let local_var_value = match local_var_apikey.prefix {
858 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
859 None => local_var_key,
860 };
861 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
862 }
863 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
864 let local_var_key = local_var_apikey.key.clone();
865 let local_var_value = match local_var_apikey.prefix {
866 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
867 None => local_var_key,
868 };
869 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
870 }
871 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
872 let local_var_key = local_var_apikey.key.clone();
873 let local_var_value = match local_var_apikey.prefix {
874 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
875 None => local_var_key,
876 };
877 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
878 }
879 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
880 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
881 }
882 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
883 let local_var_key = local_var_apikey.key.clone();
884 let local_var_value = match local_var_apikey.prefix {
885 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
886 None => local_var_key,
887 };
888 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
889 };
890 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
891 let local_var_key = local_var_apikey.key.clone();
892 let local_var_value = match local_var_apikey.prefix {
893 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
894 None => local_var_key,
895 };
896 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
897 };
898 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
899 let local_var_key = local_var_apikey.key.clone();
900 let local_var_value = match local_var_apikey.prefix {
901 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
902 None => local_var_key,
903 };
904 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
905 };
906 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
907 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
908 };
909
910 let local_var_req = local_var_req_builder.build()?;
911 let local_var_resp = local_var_client.execute(local_var_req).await?;
912
913 let local_var_status = local_var_resp.status();
914 let local_var_content = local_var_resp.text().await?;
915
916 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
917 serde_json::from_str(&local_var_content).map_err(Error::from)
918 } else {
919 let local_var_entity: Option<IssueCheckSubscriptionError> = serde_json::from_str(&local_var_content).ok();
920 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
921 Err(Error::ResponseError(local_var_error))
922 }
923}
924
925pub async fn issue_clear_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<IssueClearLabelsError>> {
926 let local_var_configuration = configuration;
927
928 let local_var_client = &local_var_configuration.client;
929
930 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
931 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
932
933 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
934 let local_var_key = local_var_apikey.key.clone();
935 let local_var_value = match local_var_apikey.prefix {
936 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
937 None => local_var_key,
938 };
939 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
940 }
941 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
942 let local_var_key = local_var_apikey.key.clone();
943 let local_var_value = match local_var_apikey.prefix {
944 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
945 None => local_var_key,
946 };
947 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
948 }
949 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
950 let local_var_key = local_var_apikey.key.clone();
951 let local_var_value = match local_var_apikey.prefix {
952 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
953 None => local_var_key,
954 };
955 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
956 }
957 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
958 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
959 }
960 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
961 let local_var_key = local_var_apikey.key.clone();
962 let local_var_value = match local_var_apikey.prefix {
963 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
964 None => local_var_key,
965 };
966 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
967 };
968 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
969 let local_var_key = local_var_apikey.key.clone();
970 let local_var_value = match local_var_apikey.prefix {
971 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
972 None => local_var_key,
973 };
974 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
975 };
976 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
977 let local_var_key = local_var_apikey.key.clone();
978 let local_var_value = match local_var_apikey.prefix {
979 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
980 None => local_var_key,
981 };
982 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
983 };
984 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
985 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
986 };
987
988 let local_var_req = local_var_req_builder.build()?;
989 let local_var_resp = local_var_client.execute(local_var_req).await?;
990
991 let local_var_status = local_var_resp.status();
992 let local_var_content = local_var_resp.text().await?;
993
994 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
995 Ok(())
996 } else {
997 let local_var_entity: Option<IssueClearLabelsError> = serde_json::from_str(&local_var_content).ok();
998 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
999 Err(Error::ResponseError(local_var_error))
1000 }
1001}
1002
1003pub async fn issue_create_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option<models::CreateIssueCommentOption>) -> Result<models::Comment, Error<IssueCreateCommentError>> {
1004 let local_var_configuration = configuration;
1005
1006 let local_var_client = &local_var_configuration.client;
1007
1008 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
1009 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1010
1011 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1012 let local_var_key = local_var_apikey.key.clone();
1013 let local_var_value = match local_var_apikey.prefix {
1014 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1015 None => local_var_key,
1016 };
1017 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1018 }
1019 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1020 let local_var_key = local_var_apikey.key.clone();
1021 let local_var_value = match local_var_apikey.prefix {
1022 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1023 None => local_var_key,
1024 };
1025 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1026 }
1027 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1028 let local_var_key = local_var_apikey.key.clone();
1029 let local_var_value = match local_var_apikey.prefix {
1030 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1031 None => local_var_key,
1032 };
1033 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1034 }
1035 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1036 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1037 }
1038 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1039 let local_var_key = local_var_apikey.key.clone();
1040 let local_var_value = match local_var_apikey.prefix {
1041 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1042 None => local_var_key,
1043 };
1044 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1045 };
1046 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1047 let local_var_key = local_var_apikey.key.clone();
1048 let local_var_value = match local_var_apikey.prefix {
1049 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1050 None => local_var_key,
1051 };
1052 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1053 };
1054 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1055 let local_var_key = local_var_apikey.key.clone();
1056 let local_var_value = match local_var_apikey.prefix {
1057 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1058 None => local_var_key,
1059 };
1060 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1061 };
1062 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1063 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1064 };
1065 local_var_req_builder = local_var_req_builder.json(&body);
1066
1067 let local_var_req = local_var_req_builder.build()?;
1068 let local_var_resp = local_var_client.execute(local_var_req).await?;
1069
1070 let local_var_status = local_var_resp.status();
1071 let local_var_content = local_var_resp.text().await?;
1072
1073 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1074 serde_json::from_str(&local_var_content).map_err(Error::from)
1075 } else {
1076 let local_var_entity: Option<IssueCreateCommentError> = serde_json::from_str(&local_var_content).ok();
1077 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1078 Err(Error::ResponseError(local_var_error))
1079 }
1080}
1081
1082pub async fn issue_create_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option<models::CreateIssueOption>) -> Result<models::Issue, Error<IssueCreateIssueError>> {
1083 let local_var_configuration = configuration;
1084
1085 let local_var_client = &local_var_configuration.client;
1086
1087 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1088 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1089
1090 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1091 let local_var_key = local_var_apikey.key.clone();
1092 let local_var_value = match local_var_apikey.prefix {
1093 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1094 None => local_var_key,
1095 };
1096 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1097 }
1098 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1099 let local_var_key = local_var_apikey.key.clone();
1100 let local_var_value = match local_var_apikey.prefix {
1101 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1102 None => local_var_key,
1103 };
1104 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1105 }
1106 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1107 let local_var_key = local_var_apikey.key.clone();
1108 let local_var_value = match local_var_apikey.prefix {
1109 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1110 None => local_var_key,
1111 };
1112 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1113 }
1114 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1115 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1116 }
1117 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1118 let local_var_key = local_var_apikey.key.clone();
1119 let local_var_value = match local_var_apikey.prefix {
1120 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1121 None => local_var_key,
1122 };
1123 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1124 };
1125 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1126 let local_var_key = local_var_apikey.key.clone();
1127 let local_var_value = match local_var_apikey.prefix {
1128 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1129 None => local_var_key,
1130 };
1131 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1132 };
1133 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1134 let local_var_key = local_var_apikey.key.clone();
1135 let local_var_value = match local_var_apikey.prefix {
1136 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1137 None => local_var_key,
1138 };
1139 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1140 };
1141 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1142 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1143 };
1144 local_var_req_builder = local_var_req_builder.json(&body);
1145
1146 let local_var_req = local_var_req_builder.build()?;
1147 let local_var_resp = local_var_client.execute(local_var_req).await?;
1148
1149 let local_var_status = local_var_resp.status();
1150 let local_var_content = local_var_resp.text().await?;
1151
1152 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1153 serde_json::from_str(&local_var_content).map_err(Error::from)
1154 } else {
1155 let local_var_entity: Option<IssueCreateIssueError> = serde_json::from_str(&local_var_content).ok();
1156 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1157 Err(Error::ResponseError(local_var_error))
1158 }
1159}
1160
1161pub async fn issue_create_issue_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, attachment: std::path::PathBuf, name: Option<&str>) -> Result<models::Attachment, Error<IssueCreateIssueAttachmentError>> {
1162 let local_var_configuration = configuration;
1163
1164 let local_var_client = &local_var_configuration.client;
1165
1166 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
1167 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1168
1169 if let Some(ref local_var_str) = name {
1170 local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
1171 }
1172 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1173 let local_var_key = local_var_apikey.key.clone();
1174 let local_var_value = match local_var_apikey.prefix {
1175 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1176 None => local_var_key,
1177 };
1178 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1179 }
1180 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1181 let local_var_key = local_var_apikey.key.clone();
1182 let local_var_value = match local_var_apikey.prefix {
1183 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1184 None => local_var_key,
1185 };
1186 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1187 }
1188 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1189 let local_var_key = local_var_apikey.key.clone();
1190 let local_var_value = match local_var_apikey.prefix {
1191 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1192 None => local_var_key,
1193 };
1194 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1195 }
1196 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1197 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1198 }
1199 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1200 let local_var_key = local_var_apikey.key.clone();
1201 let local_var_value = match local_var_apikey.prefix {
1202 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1203 None => local_var_key,
1204 };
1205 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1206 };
1207 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1208 let local_var_key = local_var_apikey.key.clone();
1209 let local_var_value = match local_var_apikey.prefix {
1210 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1211 None => local_var_key,
1212 };
1213 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1214 };
1215 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1216 let local_var_key = local_var_apikey.key.clone();
1217 let local_var_value = match local_var_apikey.prefix {
1218 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1219 None => local_var_key,
1220 };
1221 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1222 };
1223 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1224 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1225 };
1226 let mut local_var_form = reqwest::multipart::Form::new();
1227 local_var_req_builder = local_var_req_builder.multipart(local_var_form);
1229
1230 let local_var_req = local_var_req_builder.build()?;
1231 let local_var_resp = local_var_client.execute(local_var_req).await?;
1232
1233 let local_var_status = local_var_resp.status();
1234 let local_var_content = local_var_resp.text().await?;
1235
1236 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1237 serde_json::from_str(&local_var_content).map_err(Error::from)
1238 } else {
1239 let local_var_entity: Option<IssueCreateIssueAttachmentError> = serde_json::from_str(&local_var_content).ok();
1240 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1241 Err(Error::ResponseError(local_var_error))
1242 }
1243}
1244
1245pub async fn issue_create_issue_blocking(configuration: &configuration::Configuration, owner: &str, repo: &str, index: &str, body: Option<models::IssueMeta>) -> Result<models::Issue, Error<IssueCreateIssueBlockingError>> {
1246 let local_var_configuration = configuration;
1247
1248 let local_var_client = &local_var_configuration.client;
1249
1250 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/blocks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=crate::apis::urlencode(index));
1251 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1252
1253 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1254 let local_var_key = local_var_apikey.key.clone();
1255 let local_var_value = match local_var_apikey.prefix {
1256 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1257 None => local_var_key,
1258 };
1259 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1260 }
1261 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1262 let local_var_key = local_var_apikey.key.clone();
1263 let local_var_value = match local_var_apikey.prefix {
1264 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1265 None => local_var_key,
1266 };
1267 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1268 }
1269 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1270 let local_var_key = local_var_apikey.key.clone();
1271 let local_var_value = match local_var_apikey.prefix {
1272 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1273 None => local_var_key,
1274 };
1275 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1276 }
1277 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1278 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1279 }
1280 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1281 let local_var_key = local_var_apikey.key.clone();
1282 let local_var_value = match local_var_apikey.prefix {
1283 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1284 None => local_var_key,
1285 };
1286 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1287 };
1288 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1289 let local_var_key = local_var_apikey.key.clone();
1290 let local_var_value = match local_var_apikey.prefix {
1291 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1292 None => local_var_key,
1293 };
1294 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1295 };
1296 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1297 let local_var_key = local_var_apikey.key.clone();
1298 let local_var_value = match local_var_apikey.prefix {
1299 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1300 None => local_var_key,
1301 };
1302 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1303 };
1304 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1305 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1306 };
1307 local_var_req_builder = local_var_req_builder.json(&body);
1308
1309 let local_var_req = local_var_req_builder.build()?;
1310 let local_var_resp = local_var_client.execute(local_var_req).await?;
1311
1312 let local_var_status = local_var_resp.status();
1313 let local_var_content = local_var_resp.text().await?;
1314
1315 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1316 serde_json::from_str(&local_var_content).map_err(Error::from)
1317 } else {
1318 let local_var_entity: Option<IssueCreateIssueBlockingError> = serde_json::from_str(&local_var_content).ok();
1319 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1320 Err(Error::ResponseError(local_var_error))
1321 }
1322}
1323
1324pub async fn issue_create_issue_comment_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment: std::path::PathBuf, name: Option<&str>) -> Result<models::Attachment, Error<IssueCreateIssueCommentAttachmentError>> {
1325 let local_var_configuration = configuration;
1326
1327 let local_var_client = &local_var_configuration.client;
1328
1329 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
1330 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1331
1332 if let Some(ref local_var_str) = name {
1333 local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
1334 }
1335 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1336 let local_var_key = local_var_apikey.key.clone();
1337 let local_var_value = match local_var_apikey.prefix {
1338 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1339 None => local_var_key,
1340 };
1341 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1342 }
1343 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1344 let local_var_key = local_var_apikey.key.clone();
1345 let local_var_value = match local_var_apikey.prefix {
1346 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1347 None => local_var_key,
1348 };
1349 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1350 }
1351 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1352 let local_var_key = local_var_apikey.key.clone();
1353 let local_var_value = match local_var_apikey.prefix {
1354 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1355 None => local_var_key,
1356 };
1357 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1358 }
1359 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1360 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1361 }
1362 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1363 let local_var_key = local_var_apikey.key.clone();
1364 let local_var_value = match local_var_apikey.prefix {
1365 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1366 None => local_var_key,
1367 };
1368 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1369 };
1370 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1371 let local_var_key = local_var_apikey.key.clone();
1372 let local_var_value = match local_var_apikey.prefix {
1373 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1374 None => local_var_key,
1375 };
1376 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1377 };
1378 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1379 let local_var_key = local_var_apikey.key.clone();
1380 let local_var_value = match local_var_apikey.prefix {
1381 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1382 None => local_var_key,
1383 };
1384 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1385 };
1386 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1387 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1388 };
1389 let mut local_var_form = reqwest::multipart::Form::new();
1390 local_var_req_builder = local_var_req_builder.multipart(local_var_form);
1392
1393 let local_var_req = local_var_req_builder.build()?;
1394 let local_var_resp = local_var_client.execute(local_var_req).await?;
1395
1396 let local_var_status = local_var_resp.status();
1397 let local_var_content = local_var_resp.text().await?;
1398
1399 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1400 serde_json::from_str(&local_var_content).map_err(Error::from)
1401 } else {
1402 let local_var_entity: Option<IssueCreateIssueCommentAttachmentError> = serde_json::from_str(&local_var_content).ok();
1403 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1404 Err(Error::ResponseError(local_var_error))
1405 }
1406}
1407
1408pub async fn issue_create_issue_dependencies(configuration: &configuration::Configuration, owner: &str, repo: &str, index: &str, body: Option<models::IssueMeta>) -> Result<models::Issue, Error<IssueCreateIssueDependenciesError>> {
1409 let local_var_configuration = configuration;
1410
1411 let local_var_client = &local_var_configuration.client;
1412
1413 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/dependencies", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=crate::apis::urlencode(index));
1414 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1415
1416 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1417 let local_var_key = local_var_apikey.key.clone();
1418 let local_var_value = match local_var_apikey.prefix {
1419 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1420 None => local_var_key,
1421 };
1422 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1423 }
1424 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1425 let local_var_key = local_var_apikey.key.clone();
1426 let local_var_value = match local_var_apikey.prefix {
1427 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1428 None => local_var_key,
1429 };
1430 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1431 }
1432 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1433 let local_var_key = local_var_apikey.key.clone();
1434 let local_var_value = match local_var_apikey.prefix {
1435 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1436 None => local_var_key,
1437 };
1438 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1439 }
1440 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1441 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1442 }
1443 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1444 let local_var_key = local_var_apikey.key.clone();
1445 let local_var_value = match local_var_apikey.prefix {
1446 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1447 None => local_var_key,
1448 };
1449 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1450 };
1451 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1452 let local_var_key = local_var_apikey.key.clone();
1453 let local_var_value = match local_var_apikey.prefix {
1454 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1455 None => local_var_key,
1456 };
1457 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1458 };
1459 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1460 let local_var_key = local_var_apikey.key.clone();
1461 let local_var_value = match local_var_apikey.prefix {
1462 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1463 None => local_var_key,
1464 };
1465 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1466 };
1467 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1468 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1469 };
1470 local_var_req_builder = local_var_req_builder.json(&body);
1471
1472 let local_var_req = local_var_req_builder.build()?;
1473 let local_var_resp = local_var_client.execute(local_var_req).await?;
1474
1475 let local_var_status = local_var_resp.status();
1476 let local_var_content = local_var_resp.text().await?;
1477
1478 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1479 serde_json::from_str(&local_var_content).map_err(Error::from)
1480 } else {
1481 let local_var_entity: Option<IssueCreateIssueDependenciesError> = serde_json::from_str(&local_var_content).ok();
1482 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1483 Err(Error::ResponseError(local_var_error))
1484 }
1485}
1486
1487pub async fn issue_create_label(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option<models::CreateLabelOption>) -> Result<models::Label, Error<IssueCreateLabelError>> {
1488 let local_var_configuration = configuration;
1489
1490 let local_var_client = &local_var_configuration.client;
1491
1492 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1493 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1494
1495 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1496 let local_var_key = local_var_apikey.key.clone();
1497 let local_var_value = match local_var_apikey.prefix {
1498 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1499 None => local_var_key,
1500 };
1501 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1502 }
1503 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1504 let local_var_key = local_var_apikey.key.clone();
1505 let local_var_value = match local_var_apikey.prefix {
1506 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1507 None => local_var_key,
1508 };
1509 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1510 }
1511 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1512 let local_var_key = local_var_apikey.key.clone();
1513 let local_var_value = match local_var_apikey.prefix {
1514 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1515 None => local_var_key,
1516 };
1517 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1518 }
1519 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1520 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1521 }
1522 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1523 let local_var_key = local_var_apikey.key.clone();
1524 let local_var_value = match local_var_apikey.prefix {
1525 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1526 None => local_var_key,
1527 };
1528 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1529 };
1530 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1531 let local_var_key = local_var_apikey.key.clone();
1532 let local_var_value = match local_var_apikey.prefix {
1533 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1534 None => local_var_key,
1535 };
1536 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1537 };
1538 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1539 let local_var_key = local_var_apikey.key.clone();
1540 let local_var_value = match local_var_apikey.prefix {
1541 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1542 None => local_var_key,
1543 };
1544 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1545 };
1546 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1547 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1548 };
1549 local_var_req_builder = local_var_req_builder.json(&body);
1550
1551 let local_var_req = local_var_req_builder.build()?;
1552 let local_var_resp = local_var_client.execute(local_var_req).await?;
1553
1554 let local_var_status = local_var_resp.status();
1555 let local_var_content = local_var_resp.text().await?;
1556
1557 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1558 serde_json::from_str(&local_var_content).map_err(Error::from)
1559 } else {
1560 let local_var_entity: Option<IssueCreateLabelError> = serde_json::from_str(&local_var_content).ok();
1561 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1562 Err(Error::ResponseError(local_var_error))
1563 }
1564}
1565
1566pub async fn issue_create_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option<models::CreateMilestoneOption>) -> Result<models::Milestone, Error<IssueCreateMilestoneError>> {
1567 let local_var_configuration = configuration;
1568
1569 let local_var_client = &local_var_configuration.client;
1570
1571 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1572 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1573
1574 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1575 let local_var_key = local_var_apikey.key.clone();
1576 let local_var_value = match local_var_apikey.prefix {
1577 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1578 None => local_var_key,
1579 };
1580 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1581 }
1582 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1583 let local_var_key = local_var_apikey.key.clone();
1584 let local_var_value = match local_var_apikey.prefix {
1585 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1586 None => local_var_key,
1587 };
1588 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1589 }
1590 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1591 let local_var_key = local_var_apikey.key.clone();
1592 let local_var_value = match local_var_apikey.prefix {
1593 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1594 None => local_var_key,
1595 };
1596 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1597 }
1598 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1599 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1600 }
1601 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1602 let local_var_key = local_var_apikey.key.clone();
1603 let local_var_value = match local_var_apikey.prefix {
1604 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1605 None => local_var_key,
1606 };
1607 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1608 };
1609 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1610 let local_var_key = local_var_apikey.key.clone();
1611 let local_var_value = match local_var_apikey.prefix {
1612 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1613 None => local_var_key,
1614 };
1615 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1616 };
1617 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1618 let local_var_key = local_var_apikey.key.clone();
1619 let local_var_value = match local_var_apikey.prefix {
1620 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1621 None => local_var_key,
1622 };
1623 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1624 };
1625 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1626 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1627 };
1628 local_var_req_builder = local_var_req_builder.json(&body);
1629
1630 let local_var_req = local_var_req_builder.build()?;
1631 let local_var_resp = local_var_client.execute(local_var_req).await?;
1632
1633 let local_var_status = local_var_resp.status();
1634 let local_var_content = local_var_resp.text().await?;
1635
1636 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1637 serde_json::from_str(&local_var_content).map_err(Error::from)
1638 } else {
1639 let local_var_entity: Option<IssueCreateMilestoneError> = serde_json::from_str(&local_var_content).ok();
1640 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1641 Err(Error::ResponseError(local_var_error))
1642 }
1643}
1644
1645pub async fn issue_delete(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<IssueDeleteError>> {
1646 let local_var_configuration = configuration;
1647
1648 let local_var_client = &local_var_configuration.client;
1649
1650 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
1651 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1652
1653 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1654 let local_var_key = local_var_apikey.key.clone();
1655 let local_var_value = match local_var_apikey.prefix {
1656 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1657 None => local_var_key,
1658 };
1659 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1660 }
1661 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1662 let local_var_key = local_var_apikey.key.clone();
1663 let local_var_value = match local_var_apikey.prefix {
1664 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1665 None => local_var_key,
1666 };
1667 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1668 }
1669 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1670 let local_var_key = local_var_apikey.key.clone();
1671 let local_var_value = match local_var_apikey.prefix {
1672 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1673 None => local_var_key,
1674 };
1675 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1676 }
1677 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1678 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1679 }
1680 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1681 let local_var_key = local_var_apikey.key.clone();
1682 let local_var_value = match local_var_apikey.prefix {
1683 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1684 None => local_var_key,
1685 };
1686 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1687 };
1688 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1689 let local_var_key = local_var_apikey.key.clone();
1690 let local_var_value = match local_var_apikey.prefix {
1691 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1692 None => local_var_key,
1693 };
1694 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1695 };
1696 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1697 let local_var_key = local_var_apikey.key.clone();
1698 let local_var_value = match local_var_apikey.prefix {
1699 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1700 None => local_var_key,
1701 };
1702 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1703 };
1704 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1705 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1706 };
1707
1708 let local_var_req = local_var_req_builder.build()?;
1709 let local_var_resp = local_var_client.execute(local_var_req).await?;
1710
1711 let local_var_status = local_var_resp.status();
1712 let local_var_content = local_var_resp.text().await?;
1713
1714 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1715 Ok(())
1716 } else {
1717 let local_var_entity: Option<IssueDeleteError> = serde_json::from_str(&local_var_content).ok();
1718 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1719 Err(Error::ResponseError(local_var_error))
1720 }
1721}
1722
1723pub async fn issue_delete_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error<IssueDeleteCommentError>> {
1724 let local_var_configuration = configuration;
1725
1726 let local_var_client = &local_var_configuration.client;
1727
1728 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
1729 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1730
1731 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1732 let local_var_key = local_var_apikey.key.clone();
1733 let local_var_value = match local_var_apikey.prefix {
1734 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1735 None => local_var_key,
1736 };
1737 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1738 }
1739 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1740 let local_var_key = local_var_apikey.key.clone();
1741 let local_var_value = match local_var_apikey.prefix {
1742 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1743 None => local_var_key,
1744 };
1745 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1746 }
1747 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1748 let local_var_key = local_var_apikey.key.clone();
1749 let local_var_value = match local_var_apikey.prefix {
1750 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1751 None => local_var_key,
1752 };
1753 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1754 }
1755 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1756 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1757 }
1758 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1759 let local_var_key = local_var_apikey.key.clone();
1760 let local_var_value = match local_var_apikey.prefix {
1761 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1762 None => local_var_key,
1763 };
1764 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1765 };
1766 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1767 let local_var_key = local_var_apikey.key.clone();
1768 let local_var_value = match local_var_apikey.prefix {
1769 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1770 None => local_var_key,
1771 };
1772 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1773 };
1774 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1775 let local_var_key = local_var_apikey.key.clone();
1776 let local_var_value = match local_var_apikey.prefix {
1777 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1778 None => local_var_key,
1779 };
1780 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1781 };
1782 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1783 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1784 };
1785
1786 let local_var_req = local_var_req_builder.build()?;
1787 let local_var_resp = local_var_client.execute(local_var_req).await?;
1788
1789 let local_var_status = local_var_resp.status();
1790 let local_var_content = local_var_resp.text().await?;
1791
1792 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1793 Ok(())
1794 } else {
1795 let local_var_entity: Option<IssueDeleteCommentError> = serde_json::from_str(&local_var_content).ok();
1796 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1797 Err(Error::ResponseError(local_var_error))
1798 }
1799}
1800
1801pub async fn issue_delete_comment_deprecated(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i32, id: i64) -> Result<(), Error<IssueDeleteCommentDeprecatedError>> {
1802 let local_var_configuration = configuration;
1803
1804 let local_var_client = &local_var_configuration.client;
1805
1806 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id);
1807 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1808
1809 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1810 let local_var_key = local_var_apikey.key.clone();
1811 let local_var_value = match local_var_apikey.prefix {
1812 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1813 None => local_var_key,
1814 };
1815 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1816 }
1817 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1818 let local_var_key = local_var_apikey.key.clone();
1819 let local_var_value = match local_var_apikey.prefix {
1820 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1821 None => local_var_key,
1822 };
1823 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1824 }
1825 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1826 let local_var_key = local_var_apikey.key.clone();
1827 let local_var_value = match local_var_apikey.prefix {
1828 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1829 None => local_var_key,
1830 };
1831 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1832 }
1833 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1834 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1835 }
1836 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1837 let local_var_key = local_var_apikey.key.clone();
1838 let local_var_value = match local_var_apikey.prefix {
1839 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1840 None => local_var_key,
1841 };
1842 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1843 };
1844 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1845 let local_var_key = local_var_apikey.key.clone();
1846 let local_var_value = match local_var_apikey.prefix {
1847 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1848 None => local_var_key,
1849 };
1850 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1851 };
1852 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1853 let local_var_key = local_var_apikey.key.clone();
1854 let local_var_value = match local_var_apikey.prefix {
1855 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1856 None => local_var_key,
1857 };
1858 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1859 };
1860 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1861 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1862 };
1863
1864 let local_var_req = local_var_req_builder.build()?;
1865 let local_var_resp = local_var_client.execute(local_var_req).await?;
1866
1867 let local_var_status = local_var_resp.status();
1868 let local_var_content = local_var_resp.text().await?;
1869
1870 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1871 Ok(())
1872 } else {
1873 let local_var_entity: Option<IssueDeleteCommentDeprecatedError> = serde_json::from_str(&local_var_content).ok();
1874 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1875 Err(Error::ResponseError(local_var_error))
1876 }
1877}
1878
1879pub async fn issue_delete_comment_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, content: Option<models::EditReactionOption>) -> Result<(), Error<IssueDeleteCommentReactionError>> {
1880 let local_var_configuration = configuration;
1881
1882 let local_var_client = &local_var_configuration.client;
1883
1884 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
1885 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1886
1887 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1888 let local_var_key = local_var_apikey.key.clone();
1889 let local_var_value = match local_var_apikey.prefix {
1890 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1891 None => local_var_key,
1892 };
1893 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1894 }
1895 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1896 let local_var_key = local_var_apikey.key.clone();
1897 let local_var_value = match local_var_apikey.prefix {
1898 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1899 None => local_var_key,
1900 };
1901 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1902 }
1903 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1904 let local_var_key = local_var_apikey.key.clone();
1905 let local_var_value = match local_var_apikey.prefix {
1906 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1907 None => local_var_key,
1908 };
1909 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1910 }
1911 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1912 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1913 }
1914 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1915 let local_var_key = local_var_apikey.key.clone();
1916 let local_var_value = match local_var_apikey.prefix {
1917 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1918 None => local_var_key,
1919 };
1920 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
1921 };
1922 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1923 let local_var_key = local_var_apikey.key.clone();
1924 let local_var_value = match local_var_apikey.prefix {
1925 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1926 None => local_var_key,
1927 };
1928 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1929 };
1930 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1931 let local_var_key = local_var_apikey.key.clone();
1932 let local_var_value = match local_var_apikey.prefix {
1933 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1934 None => local_var_key,
1935 };
1936 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
1937 };
1938 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1939 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
1940 };
1941 local_var_req_builder = local_var_req_builder.json(&content);
1942
1943 let local_var_req = local_var_req_builder.build()?;
1944 let local_var_resp = local_var_client.execute(local_var_req).await?;
1945
1946 let local_var_status = local_var_resp.status();
1947 let local_var_content = local_var_resp.text().await?;
1948
1949 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1950 Ok(())
1951 } else {
1952 let local_var_entity: Option<IssueDeleteCommentReactionError> = serde_json::from_str(&local_var_content).ok();
1953 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1954 Err(Error::ResponseError(local_var_error))
1955 }
1956}
1957
1958pub async fn issue_delete_issue_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, attachment_id: i64) -> Result<(), Error<IssueDeleteIssueAttachmentError>> {
1959 let local_var_configuration = configuration;
1960
1961 let local_var_client = &local_var_configuration.client;
1962
1963 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, attachment_id=attachment_id);
1964 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1965
1966 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1967 let local_var_key = local_var_apikey.key.clone();
1968 let local_var_value = match local_var_apikey.prefix {
1969 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1970 None => local_var_key,
1971 };
1972 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
1973 }
1974 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1975 let local_var_key = local_var_apikey.key.clone();
1976 let local_var_value = match local_var_apikey.prefix {
1977 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1978 None => local_var_key,
1979 };
1980 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
1981 }
1982 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1983 let local_var_key = local_var_apikey.key.clone();
1984 let local_var_value = match local_var_apikey.prefix {
1985 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1986 None => local_var_key,
1987 };
1988 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
1989 }
1990 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1991 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1992 }
1993 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1994 let local_var_key = local_var_apikey.key.clone();
1995 let local_var_value = match local_var_apikey.prefix {
1996 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1997 None => local_var_key,
1998 };
1999 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2000 };
2001 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2002 let local_var_key = local_var_apikey.key.clone();
2003 let local_var_value = match local_var_apikey.prefix {
2004 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2005 None => local_var_key,
2006 };
2007 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2008 };
2009 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2010 let local_var_key = local_var_apikey.key.clone();
2011 let local_var_value = match local_var_apikey.prefix {
2012 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2013 None => local_var_key,
2014 };
2015 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2016 };
2017 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2018 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2019 };
2020
2021 let local_var_req = local_var_req_builder.build()?;
2022 let local_var_resp = local_var_client.execute(local_var_req).await?;
2023
2024 let local_var_status = local_var_resp.status();
2025 let local_var_content = local_var_resp.text().await?;
2026
2027 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2028 Ok(())
2029 } else {
2030 let local_var_entity: Option<IssueDeleteIssueAttachmentError> = serde_json::from_str(&local_var_content).ok();
2031 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2032 Err(Error::ResponseError(local_var_error))
2033 }
2034}
2035
2036pub async fn issue_delete_issue_comment_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Result<(), Error<IssueDeleteIssueCommentAttachmentError>> {
2037 let local_var_configuration = configuration;
2038
2039 let local_var_client = &local_var_configuration.client;
2040
2041 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id, attachment_id=attachment_id);
2042 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2043
2044 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2045 let local_var_key = local_var_apikey.key.clone();
2046 let local_var_value = match local_var_apikey.prefix {
2047 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2048 None => local_var_key,
2049 };
2050 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2051 }
2052 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2053 let local_var_key = local_var_apikey.key.clone();
2054 let local_var_value = match local_var_apikey.prefix {
2055 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2056 None => local_var_key,
2057 };
2058 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2059 }
2060 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2061 let local_var_key = local_var_apikey.key.clone();
2062 let local_var_value = match local_var_apikey.prefix {
2063 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2064 None => local_var_key,
2065 };
2066 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2067 }
2068 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2069 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2070 }
2071 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2072 let local_var_key = local_var_apikey.key.clone();
2073 let local_var_value = match local_var_apikey.prefix {
2074 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2075 None => local_var_key,
2076 };
2077 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2078 };
2079 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2080 let local_var_key = local_var_apikey.key.clone();
2081 let local_var_value = match local_var_apikey.prefix {
2082 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2083 None => local_var_key,
2084 };
2085 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2086 };
2087 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2088 let local_var_key = local_var_apikey.key.clone();
2089 let local_var_value = match local_var_apikey.prefix {
2090 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2091 None => local_var_key,
2092 };
2093 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2094 };
2095 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2096 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2097 };
2098
2099 let local_var_req = local_var_req_builder.build()?;
2100 let local_var_resp = local_var_client.execute(local_var_req).await?;
2101
2102 let local_var_status = local_var_resp.status();
2103 let local_var_content = local_var_resp.text().await?;
2104
2105 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2106 Ok(())
2107 } else {
2108 let local_var_entity: Option<IssueDeleteIssueCommentAttachmentError> = serde_json::from_str(&local_var_content).ok();
2109 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2110 Err(Error::ResponseError(local_var_error))
2111 }
2112}
2113
2114pub async fn issue_delete_issue_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, content: Option<models::EditReactionOption>) -> Result<(), Error<IssueDeleteIssueReactionError>> {
2115 let local_var_configuration = configuration;
2116
2117 let local_var_client = &local_var_configuration.client;
2118
2119 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
2120 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2121
2122 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2123 let local_var_key = local_var_apikey.key.clone();
2124 let local_var_value = match local_var_apikey.prefix {
2125 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2126 None => local_var_key,
2127 };
2128 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2129 }
2130 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2131 let local_var_key = local_var_apikey.key.clone();
2132 let local_var_value = match local_var_apikey.prefix {
2133 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2134 None => local_var_key,
2135 };
2136 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2137 }
2138 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2139 let local_var_key = local_var_apikey.key.clone();
2140 let local_var_value = match local_var_apikey.prefix {
2141 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2142 None => local_var_key,
2143 };
2144 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2145 }
2146 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2147 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2148 }
2149 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2150 let local_var_key = local_var_apikey.key.clone();
2151 let local_var_value = match local_var_apikey.prefix {
2152 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2153 None => local_var_key,
2154 };
2155 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2156 };
2157 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2158 let local_var_key = local_var_apikey.key.clone();
2159 let local_var_value = match local_var_apikey.prefix {
2160 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2161 None => local_var_key,
2162 };
2163 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2164 };
2165 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2166 let local_var_key = local_var_apikey.key.clone();
2167 let local_var_value = match local_var_apikey.prefix {
2168 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2169 None => local_var_key,
2170 };
2171 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2172 };
2173 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2174 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2175 };
2176 local_var_req_builder = local_var_req_builder.json(&content);
2177
2178 let local_var_req = local_var_req_builder.build()?;
2179 let local_var_resp = local_var_client.execute(local_var_req).await?;
2180
2181 let local_var_status = local_var_resp.status();
2182 let local_var_content = local_var_resp.text().await?;
2183
2184 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2185 Ok(())
2186 } else {
2187 let local_var_entity: Option<IssueDeleteIssueReactionError> = serde_json::from_str(&local_var_content).ok();
2188 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2189 Err(Error::ResponseError(local_var_error))
2190 }
2191}
2192
2193pub async fn issue_delete_label(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error<IssueDeleteLabelError>> {
2194 let local_var_configuration = configuration;
2195
2196 let local_var_client = &local_var_configuration.client;
2197
2198 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
2199 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2200
2201 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2202 let local_var_key = local_var_apikey.key.clone();
2203 let local_var_value = match local_var_apikey.prefix {
2204 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2205 None => local_var_key,
2206 };
2207 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2208 }
2209 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2210 let local_var_key = local_var_apikey.key.clone();
2211 let local_var_value = match local_var_apikey.prefix {
2212 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2213 None => local_var_key,
2214 };
2215 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2216 }
2217 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2218 let local_var_key = local_var_apikey.key.clone();
2219 let local_var_value = match local_var_apikey.prefix {
2220 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2221 None => local_var_key,
2222 };
2223 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2224 }
2225 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2226 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2227 }
2228 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2229 let local_var_key = local_var_apikey.key.clone();
2230 let local_var_value = match local_var_apikey.prefix {
2231 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2232 None => local_var_key,
2233 };
2234 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2235 };
2236 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2237 let local_var_key = local_var_apikey.key.clone();
2238 let local_var_value = match local_var_apikey.prefix {
2239 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2240 None => local_var_key,
2241 };
2242 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2243 };
2244 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2245 let local_var_key = local_var_apikey.key.clone();
2246 let local_var_value = match local_var_apikey.prefix {
2247 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2248 None => local_var_key,
2249 };
2250 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2251 };
2252 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2253 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2254 };
2255
2256 let local_var_req = local_var_req_builder.build()?;
2257 let local_var_resp = local_var_client.execute(local_var_req).await?;
2258
2259 let local_var_status = local_var_resp.status();
2260 let local_var_content = local_var_resp.text().await?;
2261
2262 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2263 Ok(())
2264 } else {
2265 let local_var_entity: Option<IssueDeleteLabelError> = serde_json::from_str(&local_var_content).ok();
2266 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2267 Err(Error::ResponseError(local_var_error))
2268 }
2269}
2270
2271pub async fn issue_delete_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str) -> Result<(), Error<IssueDeleteMilestoneError>> {
2272 let local_var_configuration = configuration;
2273
2274 let local_var_client = &local_var_configuration.client;
2275
2276 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id));
2277 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2278
2279 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2280 let local_var_key = local_var_apikey.key.clone();
2281 let local_var_value = match local_var_apikey.prefix {
2282 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2283 None => local_var_key,
2284 };
2285 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2286 }
2287 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2288 let local_var_key = local_var_apikey.key.clone();
2289 let local_var_value = match local_var_apikey.prefix {
2290 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2291 None => local_var_key,
2292 };
2293 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2294 }
2295 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2296 let local_var_key = local_var_apikey.key.clone();
2297 let local_var_value = match local_var_apikey.prefix {
2298 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2299 None => local_var_key,
2300 };
2301 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2302 }
2303 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2304 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2305 }
2306 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2307 let local_var_key = local_var_apikey.key.clone();
2308 let local_var_value = match local_var_apikey.prefix {
2309 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2310 None => local_var_key,
2311 };
2312 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2313 };
2314 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2315 let local_var_key = local_var_apikey.key.clone();
2316 let local_var_value = match local_var_apikey.prefix {
2317 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2318 None => local_var_key,
2319 };
2320 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2321 };
2322 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2323 let local_var_key = local_var_apikey.key.clone();
2324 let local_var_value = match local_var_apikey.prefix {
2325 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2326 None => local_var_key,
2327 };
2328 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2329 };
2330 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2331 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2332 };
2333
2334 let local_var_req = local_var_req_builder.build()?;
2335 let local_var_resp = local_var_client.execute(local_var_req).await?;
2336
2337 let local_var_status = local_var_resp.status();
2338 let local_var_content = local_var_resp.text().await?;
2339
2340 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2341 Ok(())
2342 } else {
2343 let local_var_entity: Option<IssueDeleteMilestoneError> = serde_json::from_str(&local_var_content).ok();
2344 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2345 Err(Error::ResponseError(local_var_error))
2346 }
2347}
2348
2349pub async fn issue_delete_stop_watch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<IssueDeleteStopWatchError>> {
2350 let local_var_configuration = configuration;
2351
2352 let local_var_client = &local_var_configuration.client;
2353
2354 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/delete", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
2355 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2356
2357 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2358 let local_var_key = local_var_apikey.key.clone();
2359 let local_var_value = match local_var_apikey.prefix {
2360 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2361 None => local_var_key,
2362 };
2363 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2364 }
2365 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2366 let local_var_key = local_var_apikey.key.clone();
2367 let local_var_value = match local_var_apikey.prefix {
2368 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2369 None => local_var_key,
2370 };
2371 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2372 }
2373 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2374 let local_var_key = local_var_apikey.key.clone();
2375 let local_var_value = match local_var_apikey.prefix {
2376 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2377 None => local_var_key,
2378 };
2379 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2380 }
2381 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2382 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2383 }
2384 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2385 let local_var_key = local_var_apikey.key.clone();
2386 let local_var_value = match local_var_apikey.prefix {
2387 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2388 None => local_var_key,
2389 };
2390 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2391 };
2392 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2393 let local_var_key = local_var_apikey.key.clone();
2394 let local_var_value = match local_var_apikey.prefix {
2395 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2396 None => local_var_key,
2397 };
2398 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2399 };
2400 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2401 let local_var_key = local_var_apikey.key.clone();
2402 let local_var_value = match local_var_apikey.prefix {
2403 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2404 None => local_var_key,
2405 };
2406 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2407 };
2408 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2409 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2410 };
2411
2412 let local_var_req = local_var_req_builder.build()?;
2413 let local_var_resp = local_var_client.execute(local_var_req).await?;
2414
2415 let local_var_status = local_var_resp.status();
2416 let local_var_content = local_var_resp.text().await?;
2417
2418 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2419 Ok(())
2420 } else {
2421 let local_var_entity: Option<IssueDeleteStopWatchError> = serde_json::from_str(&local_var_content).ok();
2422 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2423 Err(Error::ResponseError(local_var_error))
2424 }
2425}
2426
2427pub async fn issue_delete_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, user: &str) -> Result<(), Error<IssueDeleteSubscriptionError>> {
2428 let local_var_configuration = configuration;
2429
2430 let local_var_client = &local_var_configuration.client;
2431
2432 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, user=crate::apis::urlencode(user));
2433 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2434
2435 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2436 let local_var_key = local_var_apikey.key.clone();
2437 let local_var_value = match local_var_apikey.prefix {
2438 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2439 None => local_var_key,
2440 };
2441 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2442 }
2443 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2444 let local_var_key = local_var_apikey.key.clone();
2445 let local_var_value = match local_var_apikey.prefix {
2446 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2447 None => local_var_key,
2448 };
2449 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2450 }
2451 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2452 let local_var_key = local_var_apikey.key.clone();
2453 let local_var_value = match local_var_apikey.prefix {
2454 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2455 None => local_var_key,
2456 };
2457 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2458 }
2459 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2460 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2461 }
2462 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2463 let local_var_key = local_var_apikey.key.clone();
2464 let local_var_value = match local_var_apikey.prefix {
2465 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2466 None => local_var_key,
2467 };
2468 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2469 };
2470 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2471 let local_var_key = local_var_apikey.key.clone();
2472 let local_var_value = match local_var_apikey.prefix {
2473 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2474 None => local_var_key,
2475 };
2476 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2477 };
2478 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2479 let local_var_key = local_var_apikey.key.clone();
2480 let local_var_value = match local_var_apikey.prefix {
2481 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2482 None => local_var_key,
2483 };
2484 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2485 };
2486 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2487 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2488 };
2489
2490 let local_var_req = local_var_req_builder.build()?;
2491 let local_var_resp = local_var_client.execute(local_var_req).await?;
2492
2493 let local_var_status = local_var_resp.status();
2494 let local_var_content = local_var_resp.text().await?;
2495
2496 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2497 Ok(())
2498 } else {
2499 let local_var_entity: Option<IssueDeleteSubscriptionError> = serde_json::from_str(&local_var_content).ok();
2500 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2501 Err(Error::ResponseError(local_var_error))
2502 }
2503}
2504
2505pub async fn issue_delete_time(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result<(), Error<IssueDeleteTimeError>> {
2506 let local_var_configuration = configuration;
2507
2508 let local_var_client = &local_var_configuration.client;
2509
2510 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id);
2511 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2512
2513 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2514 let local_var_key = local_var_apikey.key.clone();
2515 let local_var_value = match local_var_apikey.prefix {
2516 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2517 None => local_var_key,
2518 };
2519 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2520 }
2521 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2522 let local_var_key = local_var_apikey.key.clone();
2523 let local_var_value = match local_var_apikey.prefix {
2524 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2525 None => local_var_key,
2526 };
2527 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2528 }
2529 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2530 let local_var_key = local_var_apikey.key.clone();
2531 let local_var_value = match local_var_apikey.prefix {
2532 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2533 None => local_var_key,
2534 };
2535 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2536 }
2537 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2538 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2539 }
2540 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2541 let local_var_key = local_var_apikey.key.clone();
2542 let local_var_value = match local_var_apikey.prefix {
2543 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2544 None => local_var_key,
2545 };
2546 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2547 };
2548 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2549 let local_var_key = local_var_apikey.key.clone();
2550 let local_var_value = match local_var_apikey.prefix {
2551 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2552 None => local_var_key,
2553 };
2554 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2555 };
2556 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2557 let local_var_key = local_var_apikey.key.clone();
2558 let local_var_value = match local_var_apikey.prefix {
2559 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2560 None => local_var_key,
2561 };
2562 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2563 };
2564 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2565 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2566 };
2567
2568 let local_var_req = local_var_req_builder.build()?;
2569 let local_var_resp = local_var_client.execute(local_var_req).await?;
2570
2571 let local_var_status = local_var_resp.status();
2572 let local_var_content = local_var_resp.text().await?;
2573
2574 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2575 Ok(())
2576 } else {
2577 let local_var_entity: Option<IssueDeleteTimeError> = serde_json::from_str(&local_var_content).ok();
2578 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2579 Err(Error::ResponseError(local_var_error))
2580 }
2581}
2582
2583pub async fn issue_edit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, body: Option<models::EditIssueCommentOption>) -> Result<models::Comment, Error<IssueEditCommentError>> {
2584 let local_var_configuration = configuration;
2585
2586 let local_var_client = &local_var_configuration.client;
2587
2588 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
2589 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2590
2591 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2592 let local_var_key = local_var_apikey.key.clone();
2593 let local_var_value = match local_var_apikey.prefix {
2594 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2595 None => local_var_key,
2596 };
2597 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2598 }
2599 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2600 let local_var_key = local_var_apikey.key.clone();
2601 let local_var_value = match local_var_apikey.prefix {
2602 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2603 None => local_var_key,
2604 };
2605 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2606 }
2607 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2608 let local_var_key = local_var_apikey.key.clone();
2609 let local_var_value = match local_var_apikey.prefix {
2610 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2611 None => local_var_key,
2612 };
2613 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2614 }
2615 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2616 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2617 }
2618 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2619 let local_var_key = local_var_apikey.key.clone();
2620 let local_var_value = match local_var_apikey.prefix {
2621 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2622 None => local_var_key,
2623 };
2624 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2625 };
2626 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2627 let local_var_key = local_var_apikey.key.clone();
2628 let local_var_value = match local_var_apikey.prefix {
2629 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2630 None => local_var_key,
2631 };
2632 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2633 };
2634 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2635 let local_var_key = local_var_apikey.key.clone();
2636 let local_var_value = match local_var_apikey.prefix {
2637 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2638 None => local_var_key,
2639 };
2640 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2641 };
2642 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2643 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2644 };
2645 local_var_req_builder = local_var_req_builder.json(&body);
2646
2647 let local_var_req = local_var_req_builder.build()?;
2648 let local_var_resp = local_var_client.execute(local_var_req).await?;
2649
2650 let local_var_status = local_var_resp.status();
2651 let local_var_content = local_var_resp.text().await?;
2652
2653 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2654 serde_json::from_str(&local_var_content).map_err(Error::from)
2655 } else {
2656 let local_var_entity: Option<IssueEditCommentError> = serde_json::from_str(&local_var_content).ok();
2657 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2658 Err(Error::ResponseError(local_var_error))
2659 }
2660}
2661
2662pub async fn issue_edit_comment_deprecated(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i32, id: i64, body: Option<models::EditIssueCommentOption>) -> Result<models::Comment, Error<IssueEditCommentDeprecatedError>> {
2663 let local_var_configuration = configuration;
2664
2665 let local_var_client = &local_var_configuration.client;
2666
2667 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id);
2668 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2669
2670 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2671 let local_var_key = local_var_apikey.key.clone();
2672 let local_var_value = match local_var_apikey.prefix {
2673 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2674 None => local_var_key,
2675 };
2676 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2677 }
2678 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2679 let local_var_key = local_var_apikey.key.clone();
2680 let local_var_value = match local_var_apikey.prefix {
2681 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2682 None => local_var_key,
2683 };
2684 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2685 }
2686 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2687 let local_var_key = local_var_apikey.key.clone();
2688 let local_var_value = match local_var_apikey.prefix {
2689 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2690 None => local_var_key,
2691 };
2692 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2693 }
2694 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2695 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2696 }
2697 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2698 let local_var_key = local_var_apikey.key.clone();
2699 let local_var_value = match local_var_apikey.prefix {
2700 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2701 None => local_var_key,
2702 };
2703 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2704 };
2705 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2706 let local_var_key = local_var_apikey.key.clone();
2707 let local_var_value = match local_var_apikey.prefix {
2708 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2709 None => local_var_key,
2710 };
2711 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2712 };
2713 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2714 let local_var_key = local_var_apikey.key.clone();
2715 let local_var_value = match local_var_apikey.prefix {
2716 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2717 None => local_var_key,
2718 };
2719 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2720 };
2721 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2722 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2723 };
2724 local_var_req_builder = local_var_req_builder.json(&body);
2725
2726 let local_var_req = local_var_req_builder.build()?;
2727 let local_var_resp = local_var_client.execute(local_var_req).await?;
2728
2729 let local_var_status = local_var_resp.status();
2730 let local_var_content = local_var_resp.text().await?;
2731
2732 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2733 serde_json::from_str(&local_var_content).map_err(Error::from)
2734 } else {
2735 let local_var_entity: Option<IssueEditCommentDeprecatedError> = serde_json::from_str(&local_var_content).ok();
2736 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2737 Err(Error::ResponseError(local_var_error))
2738 }
2739}
2740
2741pub async fn issue_edit_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option<models::EditIssueOption>) -> Result<models::Issue, Error<IssueEditIssueError>> {
2742 let local_var_configuration = configuration;
2743
2744 let local_var_client = &local_var_configuration.client;
2745
2746 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
2747 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2748
2749 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2750 let local_var_key = local_var_apikey.key.clone();
2751 let local_var_value = match local_var_apikey.prefix {
2752 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2753 None => local_var_key,
2754 };
2755 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2756 }
2757 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2758 let local_var_key = local_var_apikey.key.clone();
2759 let local_var_value = match local_var_apikey.prefix {
2760 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2761 None => local_var_key,
2762 };
2763 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2764 }
2765 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2766 let local_var_key = local_var_apikey.key.clone();
2767 let local_var_value = match local_var_apikey.prefix {
2768 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2769 None => local_var_key,
2770 };
2771 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2772 }
2773 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2774 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2775 }
2776 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2777 let local_var_key = local_var_apikey.key.clone();
2778 let local_var_value = match local_var_apikey.prefix {
2779 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2780 None => local_var_key,
2781 };
2782 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2783 };
2784 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2785 let local_var_key = local_var_apikey.key.clone();
2786 let local_var_value = match local_var_apikey.prefix {
2787 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2788 None => local_var_key,
2789 };
2790 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2791 };
2792 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2793 let local_var_key = local_var_apikey.key.clone();
2794 let local_var_value = match local_var_apikey.prefix {
2795 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2796 None => local_var_key,
2797 };
2798 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2799 };
2800 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2801 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2802 };
2803 local_var_req_builder = local_var_req_builder.json(&body);
2804
2805 let local_var_req = local_var_req_builder.build()?;
2806 let local_var_resp = local_var_client.execute(local_var_req).await?;
2807
2808 let local_var_status = local_var_resp.status();
2809 let local_var_content = local_var_resp.text().await?;
2810
2811 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2812 serde_json::from_str(&local_var_content).map_err(Error::from)
2813 } else {
2814 let local_var_entity: Option<IssueEditIssueError> = serde_json::from_str(&local_var_content).ok();
2815 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2816 Err(Error::ResponseError(local_var_error))
2817 }
2818}
2819
2820pub async fn issue_edit_issue_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, attachment_id: i64, body: Option<models::EditAttachmentOptions>) -> Result<models::Attachment, Error<IssueEditIssueAttachmentError>> {
2821 let local_var_configuration = configuration;
2822
2823 let local_var_client = &local_var_configuration.client;
2824
2825 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, attachment_id=attachment_id);
2826 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2827
2828 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2829 let local_var_key = local_var_apikey.key.clone();
2830 let local_var_value = match local_var_apikey.prefix {
2831 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2832 None => local_var_key,
2833 };
2834 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2835 }
2836 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2837 let local_var_key = local_var_apikey.key.clone();
2838 let local_var_value = match local_var_apikey.prefix {
2839 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2840 None => local_var_key,
2841 };
2842 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2843 }
2844 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2845 let local_var_key = local_var_apikey.key.clone();
2846 let local_var_value = match local_var_apikey.prefix {
2847 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2848 None => local_var_key,
2849 };
2850 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2851 }
2852 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2853 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2854 }
2855 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2856 let local_var_key = local_var_apikey.key.clone();
2857 let local_var_value = match local_var_apikey.prefix {
2858 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2859 None => local_var_key,
2860 };
2861 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2862 };
2863 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2864 let local_var_key = local_var_apikey.key.clone();
2865 let local_var_value = match local_var_apikey.prefix {
2866 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2867 None => local_var_key,
2868 };
2869 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2870 };
2871 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2872 let local_var_key = local_var_apikey.key.clone();
2873 let local_var_value = match local_var_apikey.prefix {
2874 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2875 None => local_var_key,
2876 };
2877 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2878 };
2879 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2880 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2881 };
2882 local_var_req_builder = local_var_req_builder.json(&body);
2883
2884 let local_var_req = local_var_req_builder.build()?;
2885 let local_var_resp = local_var_client.execute(local_var_req).await?;
2886
2887 let local_var_status = local_var_resp.status();
2888 let local_var_content = local_var_resp.text().await?;
2889
2890 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2891 serde_json::from_str(&local_var_content).map_err(Error::from)
2892 } else {
2893 let local_var_entity: Option<IssueEditIssueAttachmentError> = serde_json::from_str(&local_var_content).ok();
2894 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2895 Err(Error::ResponseError(local_var_error))
2896 }
2897}
2898
2899pub async fn issue_edit_issue_comment_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment_id: i64, body: Option<models::EditAttachmentOptions>) -> Result<models::Attachment, Error<IssueEditIssueCommentAttachmentError>> {
2900 let local_var_configuration = configuration;
2901
2902 let local_var_client = &local_var_configuration.client;
2903
2904 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id, attachment_id=attachment_id);
2905 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2906
2907 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2908 let local_var_key = local_var_apikey.key.clone();
2909 let local_var_value = match local_var_apikey.prefix {
2910 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2911 None => local_var_key,
2912 };
2913 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2914 }
2915 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2916 let local_var_key = local_var_apikey.key.clone();
2917 let local_var_value = match local_var_apikey.prefix {
2918 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2919 None => local_var_key,
2920 };
2921 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
2922 }
2923 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2924 let local_var_key = local_var_apikey.key.clone();
2925 let local_var_value = match local_var_apikey.prefix {
2926 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2927 None => local_var_key,
2928 };
2929 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
2930 }
2931 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2932 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2933 }
2934 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2935 let local_var_key = local_var_apikey.key.clone();
2936 let local_var_value = match local_var_apikey.prefix {
2937 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2938 None => local_var_key,
2939 };
2940 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
2941 };
2942 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2943 let local_var_key = local_var_apikey.key.clone();
2944 let local_var_value = match local_var_apikey.prefix {
2945 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2946 None => local_var_key,
2947 };
2948 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2949 };
2950 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2951 let local_var_key = local_var_apikey.key.clone();
2952 let local_var_value = match local_var_apikey.prefix {
2953 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2954 None => local_var_key,
2955 };
2956 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
2957 };
2958 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
2959 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
2960 };
2961 local_var_req_builder = local_var_req_builder.json(&body);
2962
2963 let local_var_req = local_var_req_builder.build()?;
2964 let local_var_resp = local_var_client.execute(local_var_req).await?;
2965
2966 let local_var_status = local_var_resp.status();
2967 let local_var_content = local_var_resp.text().await?;
2968
2969 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2970 serde_json::from_str(&local_var_content).map_err(Error::from)
2971 } else {
2972 let local_var_entity: Option<IssueEditIssueCommentAttachmentError> = serde_json::from_str(&local_var_content).ok();
2973 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2974 Err(Error::ResponseError(local_var_error))
2975 }
2976}
2977
2978pub async fn issue_edit_issue_deadline(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option<models::EditDeadlineOption>) -> Result<models::IssueDeadline, Error<IssueEditIssueDeadlineError>> {
2979 let local_var_configuration = configuration;
2980
2981 let local_var_client = &local_var_configuration.client;
2982
2983 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/deadline", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
2984 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2985
2986 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2987 let local_var_key = local_var_apikey.key.clone();
2988 let local_var_value = match local_var_apikey.prefix {
2989 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2990 None => local_var_key,
2991 };
2992 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
2993 }
2994 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2995 let local_var_key = local_var_apikey.key.clone();
2996 let local_var_value = match local_var_apikey.prefix {
2997 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2998 None => local_var_key,
2999 };
3000 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3001 }
3002 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3003 let local_var_key = local_var_apikey.key.clone();
3004 let local_var_value = match local_var_apikey.prefix {
3005 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3006 None => local_var_key,
3007 };
3008 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3009 }
3010 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3011 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3012 }
3013 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3014 let local_var_key = local_var_apikey.key.clone();
3015 let local_var_value = match local_var_apikey.prefix {
3016 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3017 None => local_var_key,
3018 };
3019 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3020 };
3021 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3022 let local_var_key = local_var_apikey.key.clone();
3023 let local_var_value = match local_var_apikey.prefix {
3024 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3025 None => local_var_key,
3026 };
3027 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3028 };
3029 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3030 let local_var_key = local_var_apikey.key.clone();
3031 let local_var_value = match local_var_apikey.prefix {
3032 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3033 None => local_var_key,
3034 };
3035 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3036 };
3037 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3038 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3039 };
3040 local_var_req_builder = local_var_req_builder.json(&body);
3041
3042 let local_var_req = local_var_req_builder.build()?;
3043 let local_var_resp = local_var_client.execute(local_var_req).await?;
3044
3045 let local_var_status = local_var_resp.status();
3046 let local_var_content = local_var_resp.text().await?;
3047
3048 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3049 serde_json::from_str(&local_var_content).map_err(Error::from)
3050 } else {
3051 let local_var_entity: Option<IssueEditIssueDeadlineError> = serde_json::from_str(&local_var_content).ok();
3052 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3053 Err(Error::ResponseError(local_var_error))
3054 }
3055}
3056
3057pub async fn issue_edit_label(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, body: Option<models::EditLabelOption>) -> Result<models::Label, Error<IssueEditLabelError>> {
3058 let local_var_configuration = configuration;
3059
3060 let local_var_client = &local_var_configuration.client;
3061
3062 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
3063 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
3064
3065 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3066 let local_var_key = local_var_apikey.key.clone();
3067 let local_var_value = match local_var_apikey.prefix {
3068 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3069 None => local_var_key,
3070 };
3071 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3072 }
3073 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3074 let local_var_key = local_var_apikey.key.clone();
3075 let local_var_value = match local_var_apikey.prefix {
3076 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3077 None => local_var_key,
3078 };
3079 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3080 }
3081 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3082 let local_var_key = local_var_apikey.key.clone();
3083 let local_var_value = match local_var_apikey.prefix {
3084 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3085 None => local_var_key,
3086 };
3087 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3088 }
3089 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3090 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3091 }
3092 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3093 let local_var_key = local_var_apikey.key.clone();
3094 let local_var_value = match local_var_apikey.prefix {
3095 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3096 None => local_var_key,
3097 };
3098 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3099 };
3100 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3101 let local_var_key = local_var_apikey.key.clone();
3102 let local_var_value = match local_var_apikey.prefix {
3103 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3104 None => local_var_key,
3105 };
3106 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3107 };
3108 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3109 let local_var_key = local_var_apikey.key.clone();
3110 let local_var_value = match local_var_apikey.prefix {
3111 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3112 None => local_var_key,
3113 };
3114 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3115 };
3116 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3117 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3118 };
3119 local_var_req_builder = local_var_req_builder.json(&body);
3120
3121 let local_var_req = local_var_req_builder.build()?;
3122 let local_var_resp = local_var_client.execute(local_var_req).await?;
3123
3124 let local_var_status = local_var_resp.status();
3125 let local_var_content = local_var_resp.text().await?;
3126
3127 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3128 serde_json::from_str(&local_var_content).map_err(Error::from)
3129 } else {
3130 let local_var_entity: Option<IssueEditLabelError> = serde_json::from_str(&local_var_content).ok();
3131 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3132 Err(Error::ResponseError(local_var_error))
3133 }
3134}
3135
3136pub async fn issue_edit_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str, body: Option<models::EditMilestoneOption>) -> Result<models::Milestone, Error<IssueEditMilestoneError>> {
3137 let local_var_configuration = configuration;
3138
3139 let local_var_client = &local_var_configuration.client;
3140
3141 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id));
3142 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
3143
3144 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3145 let local_var_key = local_var_apikey.key.clone();
3146 let local_var_value = match local_var_apikey.prefix {
3147 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3148 None => local_var_key,
3149 };
3150 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3151 }
3152 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3153 let local_var_key = local_var_apikey.key.clone();
3154 let local_var_value = match local_var_apikey.prefix {
3155 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3156 None => local_var_key,
3157 };
3158 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3159 }
3160 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3161 let local_var_key = local_var_apikey.key.clone();
3162 let local_var_value = match local_var_apikey.prefix {
3163 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3164 None => local_var_key,
3165 };
3166 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3167 }
3168 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3169 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3170 }
3171 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3172 let local_var_key = local_var_apikey.key.clone();
3173 let local_var_value = match local_var_apikey.prefix {
3174 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3175 None => local_var_key,
3176 };
3177 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3178 };
3179 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3180 let local_var_key = local_var_apikey.key.clone();
3181 let local_var_value = match local_var_apikey.prefix {
3182 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3183 None => local_var_key,
3184 };
3185 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3186 };
3187 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3188 let local_var_key = local_var_apikey.key.clone();
3189 let local_var_value = match local_var_apikey.prefix {
3190 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3191 None => local_var_key,
3192 };
3193 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3194 };
3195 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3196 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3197 };
3198 local_var_req_builder = local_var_req_builder.json(&body);
3199
3200 let local_var_req = local_var_req_builder.build()?;
3201 let local_var_resp = local_var_client.execute(local_var_req).await?;
3202
3203 let local_var_status = local_var_resp.status();
3204 let local_var_content = local_var_resp.text().await?;
3205
3206 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3207 serde_json::from_str(&local_var_content).map_err(Error::from)
3208 } else {
3209 let local_var_entity: Option<IssueEditMilestoneError> = serde_json::from_str(&local_var_content).ok();
3210 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3211 Err(Error::ResponseError(local_var_error))
3212 }
3213}
3214
3215pub async fn issue_get_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<models::Comment, Error<IssueGetCommentError>> {
3216 let local_var_configuration = configuration;
3217
3218 let local_var_client = &local_var_configuration.client;
3219
3220 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
3221 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3222
3223 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3224 let local_var_key = local_var_apikey.key.clone();
3225 let local_var_value = match local_var_apikey.prefix {
3226 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3227 None => local_var_key,
3228 };
3229 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3230 }
3231 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3232 let local_var_key = local_var_apikey.key.clone();
3233 let local_var_value = match local_var_apikey.prefix {
3234 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3235 None => local_var_key,
3236 };
3237 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3238 }
3239 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3240 let local_var_key = local_var_apikey.key.clone();
3241 let local_var_value = match local_var_apikey.prefix {
3242 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3243 None => local_var_key,
3244 };
3245 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3246 }
3247 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3248 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3249 }
3250 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3251 let local_var_key = local_var_apikey.key.clone();
3252 let local_var_value = match local_var_apikey.prefix {
3253 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3254 None => local_var_key,
3255 };
3256 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3257 };
3258 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3259 let local_var_key = local_var_apikey.key.clone();
3260 let local_var_value = match local_var_apikey.prefix {
3261 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3262 None => local_var_key,
3263 };
3264 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3265 };
3266 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3267 let local_var_key = local_var_apikey.key.clone();
3268 let local_var_value = match local_var_apikey.prefix {
3269 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3270 None => local_var_key,
3271 };
3272 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3273 };
3274 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3275 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3276 };
3277
3278 let local_var_req = local_var_req_builder.build()?;
3279 let local_var_resp = local_var_client.execute(local_var_req).await?;
3280
3281 let local_var_status = local_var_resp.status();
3282 let local_var_content = local_var_resp.text().await?;
3283
3284 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3285 serde_json::from_str(&local_var_content).map_err(Error::from)
3286 } else {
3287 let local_var_entity: Option<IssueGetCommentError> = serde_json::from_str(&local_var_content).ok();
3288 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3289 Err(Error::ResponseError(local_var_error))
3290 }
3291}
3292
3293pub async fn issue_get_comment_reactions(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<Vec<models::Reaction>, Error<IssueGetCommentReactionsError>> {
3294 let local_var_configuration = configuration;
3295
3296 let local_var_client = &local_var_configuration.client;
3297
3298 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
3299 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3300
3301 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3302 let local_var_key = local_var_apikey.key.clone();
3303 let local_var_value = match local_var_apikey.prefix {
3304 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3305 None => local_var_key,
3306 };
3307 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3308 }
3309 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3310 let local_var_key = local_var_apikey.key.clone();
3311 let local_var_value = match local_var_apikey.prefix {
3312 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3313 None => local_var_key,
3314 };
3315 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3316 }
3317 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3318 let local_var_key = local_var_apikey.key.clone();
3319 let local_var_value = match local_var_apikey.prefix {
3320 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3321 None => local_var_key,
3322 };
3323 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3324 }
3325 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3326 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3327 }
3328 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3329 let local_var_key = local_var_apikey.key.clone();
3330 let local_var_value = match local_var_apikey.prefix {
3331 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3332 None => local_var_key,
3333 };
3334 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3335 };
3336 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3337 let local_var_key = local_var_apikey.key.clone();
3338 let local_var_value = match local_var_apikey.prefix {
3339 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3340 None => local_var_key,
3341 };
3342 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3343 };
3344 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3345 let local_var_key = local_var_apikey.key.clone();
3346 let local_var_value = match local_var_apikey.prefix {
3347 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3348 None => local_var_key,
3349 };
3350 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3351 };
3352 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3353 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3354 };
3355
3356 let local_var_req = local_var_req_builder.build()?;
3357 let local_var_resp = local_var_client.execute(local_var_req).await?;
3358
3359 let local_var_status = local_var_resp.status();
3360 let local_var_content = local_var_resp.text().await?;
3361
3362 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3363 serde_json::from_str(&local_var_content).map_err(Error::from)
3364 } else {
3365 let local_var_entity: Option<IssueGetCommentReactionsError> = serde_json::from_str(&local_var_content).ok();
3366 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3367 Err(Error::ResponseError(local_var_error))
3368 }
3369}
3370
3371pub async fn issue_get_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, since: Option<String>, before: Option<String>) -> Result<Vec<models::Comment>, Error<IssueGetCommentsError>> {
3372 let local_var_configuration = configuration;
3373
3374 let local_var_client = &local_var_configuration.client;
3375
3376 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
3377 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3378
3379 if let Some(ref local_var_str) = since {
3380 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
3381 }
3382 if let Some(ref local_var_str) = before {
3383 local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
3384 }
3385 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3386 let local_var_key = local_var_apikey.key.clone();
3387 let local_var_value = match local_var_apikey.prefix {
3388 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3389 None => local_var_key,
3390 };
3391 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3392 }
3393 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3394 let local_var_key = local_var_apikey.key.clone();
3395 let local_var_value = match local_var_apikey.prefix {
3396 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3397 None => local_var_key,
3398 };
3399 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3400 }
3401 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3402 let local_var_key = local_var_apikey.key.clone();
3403 let local_var_value = match local_var_apikey.prefix {
3404 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3405 None => local_var_key,
3406 };
3407 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3408 }
3409 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3410 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3411 }
3412 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3413 let local_var_key = local_var_apikey.key.clone();
3414 let local_var_value = match local_var_apikey.prefix {
3415 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3416 None => local_var_key,
3417 };
3418 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3419 };
3420 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3421 let local_var_key = local_var_apikey.key.clone();
3422 let local_var_value = match local_var_apikey.prefix {
3423 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3424 None => local_var_key,
3425 };
3426 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3427 };
3428 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3429 let local_var_key = local_var_apikey.key.clone();
3430 let local_var_value = match local_var_apikey.prefix {
3431 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3432 None => local_var_key,
3433 };
3434 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3435 };
3436 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3437 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3438 };
3439
3440 let local_var_req = local_var_req_builder.build()?;
3441 let local_var_resp = local_var_client.execute(local_var_req).await?;
3442
3443 let local_var_status = local_var_resp.status();
3444 let local_var_content = local_var_resp.text().await?;
3445
3446 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3447 serde_json::from_str(&local_var_content).map_err(Error::from)
3448 } else {
3449 let local_var_entity: Option<IssueGetCommentsError> = serde_json::from_str(&local_var_content).ok();
3450 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3451 Err(Error::ResponseError(local_var_error))
3452 }
3453}
3454
3455pub async fn issue_get_comments_and_timeline(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, since: Option<String>, page: Option<i32>, limit: Option<i32>, before: Option<String>) -> Result<Vec<models::TimelineComment>, Error<IssueGetCommentsAndTimelineError>> {
3456 let local_var_configuration = configuration;
3457
3458 let local_var_client = &local_var_configuration.client;
3459
3460 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/timeline", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
3461 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3462
3463 if let Some(ref local_var_str) = since {
3464 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
3465 }
3466 if let Some(ref local_var_str) = page {
3467 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3468 }
3469 if let Some(ref local_var_str) = limit {
3470 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
3471 }
3472 if let Some(ref local_var_str) = before {
3473 local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
3474 }
3475 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3476 let local_var_key = local_var_apikey.key.clone();
3477 let local_var_value = match local_var_apikey.prefix {
3478 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3479 None => local_var_key,
3480 };
3481 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3482 }
3483 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3484 let local_var_key = local_var_apikey.key.clone();
3485 let local_var_value = match local_var_apikey.prefix {
3486 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3487 None => local_var_key,
3488 };
3489 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3490 }
3491 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3492 let local_var_key = local_var_apikey.key.clone();
3493 let local_var_value = match local_var_apikey.prefix {
3494 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3495 None => local_var_key,
3496 };
3497 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3498 }
3499 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3500 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3501 }
3502 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3503 let local_var_key = local_var_apikey.key.clone();
3504 let local_var_value = match local_var_apikey.prefix {
3505 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3506 None => local_var_key,
3507 };
3508 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3509 };
3510 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3511 let local_var_key = local_var_apikey.key.clone();
3512 let local_var_value = match local_var_apikey.prefix {
3513 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3514 None => local_var_key,
3515 };
3516 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3517 };
3518 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3519 let local_var_key = local_var_apikey.key.clone();
3520 let local_var_value = match local_var_apikey.prefix {
3521 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3522 None => local_var_key,
3523 };
3524 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3525 };
3526 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3527 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3528 };
3529
3530 let local_var_req = local_var_req_builder.build()?;
3531 let local_var_resp = local_var_client.execute(local_var_req).await?;
3532
3533 let local_var_status = local_var_resp.status();
3534 let local_var_content = local_var_resp.text().await?;
3535
3536 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3537 serde_json::from_str(&local_var_content).map_err(Error::from)
3538 } else {
3539 let local_var_entity: Option<IssueGetCommentsAndTimelineError> = serde_json::from_str(&local_var_content).ok();
3540 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3541 Err(Error::ResponseError(local_var_error))
3542 }
3543}
3544
3545pub async fn issue_get_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<models::Issue, Error<IssueGetIssueError>> {
3546 let local_var_configuration = configuration;
3547
3548 let local_var_client = &local_var_configuration.client;
3549
3550 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
3551 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3552
3553 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3554 let local_var_key = local_var_apikey.key.clone();
3555 let local_var_value = match local_var_apikey.prefix {
3556 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3557 None => local_var_key,
3558 };
3559 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3560 }
3561 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3562 let local_var_key = local_var_apikey.key.clone();
3563 let local_var_value = match local_var_apikey.prefix {
3564 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3565 None => local_var_key,
3566 };
3567 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3568 }
3569 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3570 let local_var_key = local_var_apikey.key.clone();
3571 let local_var_value = match local_var_apikey.prefix {
3572 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3573 None => local_var_key,
3574 };
3575 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3576 }
3577 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3578 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3579 }
3580 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3581 let local_var_key = local_var_apikey.key.clone();
3582 let local_var_value = match local_var_apikey.prefix {
3583 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3584 None => local_var_key,
3585 };
3586 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3587 };
3588 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3589 let local_var_key = local_var_apikey.key.clone();
3590 let local_var_value = match local_var_apikey.prefix {
3591 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3592 None => local_var_key,
3593 };
3594 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3595 };
3596 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3597 let local_var_key = local_var_apikey.key.clone();
3598 let local_var_value = match local_var_apikey.prefix {
3599 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3600 None => local_var_key,
3601 };
3602 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3603 };
3604 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3605 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3606 };
3607
3608 let local_var_req = local_var_req_builder.build()?;
3609 let local_var_resp = local_var_client.execute(local_var_req).await?;
3610
3611 let local_var_status = local_var_resp.status();
3612 let local_var_content = local_var_resp.text().await?;
3613
3614 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3615 serde_json::from_str(&local_var_content).map_err(Error::from)
3616 } else {
3617 let local_var_entity: Option<IssueGetIssueError> = serde_json::from_str(&local_var_content).ok();
3618 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3619 Err(Error::ResponseError(local_var_error))
3620 }
3621}
3622
3623pub async fn issue_get_issue_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, attachment_id: i64) -> Result<models::Attachment, Error<IssueGetIssueAttachmentError>> {
3624 let local_var_configuration = configuration;
3625
3626 let local_var_client = &local_var_configuration.client;
3627
3628 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, attachment_id=attachment_id);
3629 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3630
3631 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3632 let local_var_key = local_var_apikey.key.clone();
3633 let local_var_value = match local_var_apikey.prefix {
3634 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3635 None => local_var_key,
3636 };
3637 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3638 }
3639 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3640 let local_var_key = local_var_apikey.key.clone();
3641 let local_var_value = match local_var_apikey.prefix {
3642 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3643 None => local_var_key,
3644 };
3645 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3646 }
3647 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3648 let local_var_key = local_var_apikey.key.clone();
3649 let local_var_value = match local_var_apikey.prefix {
3650 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3651 None => local_var_key,
3652 };
3653 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3654 }
3655 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3656 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3657 }
3658 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3659 let local_var_key = local_var_apikey.key.clone();
3660 let local_var_value = match local_var_apikey.prefix {
3661 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3662 None => local_var_key,
3663 };
3664 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3665 };
3666 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3667 let local_var_key = local_var_apikey.key.clone();
3668 let local_var_value = match local_var_apikey.prefix {
3669 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3670 None => local_var_key,
3671 };
3672 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3673 };
3674 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3675 let local_var_key = local_var_apikey.key.clone();
3676 let local_var_value = match local_var_apikey.prefix {
3677 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3678 None => local_var_key,
3679 };
3680 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3681 };
3682 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3683 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3684 };
3685
3686 let local_var_req = local_var_req_builder.build()?;
3687 let local_var_resp = local_var_client.execute(local_var_req).await?;
3688
3689 let local_var_status = local_var_resp.status();
3690 let local_var_content = local_var_resp.text().await?;
3691
3692 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3693 serde_json::from_str(&local_var_content).map_err(Error::from)
3694 } else {
3695 let local_var_entity: Option<IssueGetIssueAttachmentError> = serde_json::from_str(&local_var_content).ok();
3696 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3697 Err(Error::ResponseError(local_var_error))
3698 }
3699}
3700
3701pub async fn issue_get_issue_comment_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Result<models::Attachment, Error<IssueGetIssueCommentAttachmentError>> {
3702 let local_var_configuration = configuration;
3703
3704 let local_var_client = &local_var_configuration.client;
3705
3706 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id, attachment_id=attachment_id);
3707 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3708
3709 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3710 let local_var_key = local_var_apikey.key.clone();
3711 let local_var_value = match local_var_apikey.prefix {
3712 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3713 None => local_var_key,
3714 };
3715 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3716 }
3717 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3718 let local_var_key = local_var_apikey.key.clone();
3719 let local_var_value = match local_var_apikey.prefix {
3720 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3721 None => local_var_key,
3722 };
3723 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3724 }
3725 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3726 let local_var_key = local_var_apikey.key.clone();
3727 let local_var_value = match local_var_apikey.prefix {
3728 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3729 None => local_var_key,
3730 };
3731 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3732 }
3733 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3734 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3735 }
3736 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3737 let local_var_key = local_var_apikey.key.clone();
3738 let local_var_value = match local_var_apikey.prefix {
3739 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3740 None => local_var_key,
3741 };
3742 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3743 };
3744 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3745 let local_var_key = local_var_apikey.key.clone();
3746 let local_var_value = match local_var_apikey.prefix {
3747 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3748 None => local_var_key,
3749 };
3750 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3751 };
3752 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3753 let local_var_key = local_var_apikey.key.clone();
3754 let local_var_value = match local_var_apikey.prefix {
3755 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3756 None => local_var_key,
3757 };
3758 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3759 };
3760 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3761 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3762 };
3763
3764 let local_var_req = local_var_req_builder.build()?;
3765 let local_var_resp = local_var_client.execute(local_var_req).await?;
3766
3767 let local_var_status = local_var_resp.status();
3768 let local_var_content = local_var_resp.text().await?;
3769
3770 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3771 serde_json::from_str(&local_var_content).map_err(Error::from)
3772 } else {
3773 let local_var_entity: Option<IssueGetIssueCommentAttachmentError> = serde_json::from_str(&local_var_content).ok();
3774 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3775 Err(Error::ResponseError(local_var_error))
3776 }
3777}
3778
3779pub async fn issue_get_issue_reactions(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Reaction>, Error<IssueGetIssueReactionsError>> {
3780 let local_var_configuration = configuration;
3781
3782 let local_var_client = &local_var_configuration.client;
3783
3784 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
3785 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3786
3787 if let Some(ref local_var_str) = page {
3788 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3789 }
3790 if let Some(ref local_var_str) = limit {
3791 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
3792 }
3793 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3794 let local_var_key = local_var_apikey.key.clone();
3795 let local_var_value = match local_var_apikey.prefix {
3796 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3797 None => local_var_key,
3798 };
3799 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3800 }
3801 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3802 let local_var_key = local_var_apikey.key.clone();
3803 let local_var_value = match local_var_apikey.prefix {
3804 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3805 None => local_var_key,
3806 };
3807 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3808 }
3809 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3810 let local_var_key = local_var_apikey.key.clone();
3811 let local_var_value = match local_var_apikey.prefix {
3812 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3813 None => local_var_key,
3814 };
3815 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3816 }
3817 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3818 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3819 }
3820 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3821 let local_var_key = local_var_apikey.key.clone();
3822 let local_var_value = match local_var_apikey.prefix {
3823 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3824 None => local_var_key,
3825 };
3826 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3827 };
3828 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3829 let local_var_key = local_var_apikey.key.clone();
3830 let local_var_value = match local_var_apikey.prefix {
3831 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3832 None => local_var_key,
3833 };
3834 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3835 };
3836 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3837 let local_var_key = local_var_apikey.key.clone();
3838 let local_var_value = match local_var_apikey.prefix {
3839 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3840 None => local_var_key,
3841 };
3842 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3843 };
3844 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3845 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3846 };
3847
3848 let local_var_req = local_var_req_builder.build()?;
3849 let local_var_resp = local_var_client.execute(local_var_req).await?;
3850
3851 let local_var_status = local_var_resp.status();
3852 let local_var_content = local_var_resp.text().await?;
3853
3854 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3855 serde_json::from_str(&local_var_content).map_err(Error::from)
3856 } else {
3857 let local_var_entity: Option<IssueGetIssueReactionsError> = serde_json::from_str(&local_var_content).ok();
3858 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3859 Err(Error::ResponseError(local_var_error))
3860 }
3861}
3862
3863pub async fn issue_get_label(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<models::Label, Error<IssueGetLabelError>> {
3864 let local_var_configuration = configuration;
3865
3866 let local_var_client = &local_var_configuration.client;
3867
3868 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
3869 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3870
3871 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3872 let local_var_key = local_var_apikey.key.clone();
3873 let local_var_value = match local_var_apikey.prefix {
3874 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3875 None => local_var_key,
3876 };
3877 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3878 }
3879 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3880 let local_var_key = local_var_apikey.key.clone();
3881 let local_var_value = match local_var_apikey.prefix {
3882 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3883 None => local_var_key,
3884 };
3885 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3886 }
3887 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3888 let local_var_key = local_var_apikey.key.clone();
3889 let local_var_value = match local_var_apikey.prefix {
3890 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3891 None => local_var_key,
3892 };
3893 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3894 }
3895 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3896 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3897 }
3898 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3899 let local_var_key = local_var_apikey.key.clone();
3900 let local_var_value = match local_var_apikey.prefix {
3901 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3902 None => local_var_key,
3903 };
3904 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3905 };
3906 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3907 let local_var_key = local_var_apikey.key.clone();
3908 let local_var_value = match local_var_apikey.prefix {
3909 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3910 None => local_var_key,
3911 };
3912 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3913 };
3914 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3915 let local_var_key = local_var_apikey.key.clone();
3916 let local_var_value = match local_var_apikey.prefix {
3917 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3918 None => local_var_key,
3919 };
3920 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3921 };
3922 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
3923 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
3924 };
3925
3926 let local_var_req = local_var_req_builder.build()?;
3927 let local_var_resp = local_var_client.execute(local_var_req).await?;
3928
3929 let local_var_status = local_var_resp.status();
3930 let local_var_content = local_var_resp.text().await?;
3931
3932 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3933 serde_json::from_str(&local_var_content).map_err(Error::from)
3934 } else {
3935 let local_var_entity: Option<IssueGetLabelError> = serde_json::from_str(&local_var_content).ok();
3936 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3937 Err(Error::ResponseError(local_var_error))
3938 }
3939}
3940
3941pub async fn issue_get_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<Vec<models::Label>, Error<IssueGetLabelsError>> {
3942 let local_var_configuration = configuration;
3943
3944 let local_var_client = &local_var_configuration.client;
3945
3946 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
3947 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3948
3949 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3950 let local_var_key = local_var_apikey.key.clone();
3951 let local_var_value = match local_var_apikey.prefix {
3952 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3953 None => local_var_key,
3954 };
3955 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
3956 }
3957 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3958 let local_var_key = local_var_apikey.key.clone();
3959 let local_var_value = match local_var_apikey.prefix {
3960 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3961 None => local_var_key,
3962 };
3963 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
3964 }
3965 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3966 let local_var_key = local_var_apikey.key.clone();
3967 let local_var_value = match local_var_apikey.prefix {
3968 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3969 None => local_var_key,
3970 };
3971 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
3972 }
3973 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3974 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3975 }
3976 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3977 let local_var_key = local_var_apikey.key.clone();
3978 let local_var_value = match local_var_apikey.prefix {
3979 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3980 None => local_var_key,
3981 };
3982 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
3983 };
3984 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3985 let local_var_key = local_var_apikey.key.clone();
3986 let local_var_value = match local_var_apikey.prefix {
3987 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3988 None => local_var_key,
3989 };
3990 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
3991 };
3992 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
3993 let local_var_key = local_var_apikey.key.clone();
3994 let local_var_value = match local_var_apikey.prefix {
3995 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
3996 None => local_var_key,
3997 };
3998 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
3999 };
4000 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4001 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4002 };
4003
4004 let local_var_req = local_var_req_builder.build()?;
4005 let local_var_resp = local_var_client.execute(local_var_req).await?;
4006
4007 let local_var_status = local_var_resp.status();
4008 let local_var_content = local_var_resp.text().await?;
4009
4010 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4011 serde_json::from_str(&local_var_content).map_err(Error::from)
4012 } else {
4013 let local_var_entity: Option<IssueGetLabelsError> = serde_json::from_str(&local_var_content).ok();
4014 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4015 Err(Error::ResponseError(local_var_error))
4016 }
4017}
4018
4019pub async fn issue_get_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str) -> Result<models::Milestone, Error<IssueGetMilestoneError>> {
4020 let local_var_configuration = configuration;
4021
4022 let local_var_client = &local_var_configuration.client;
4023
4024 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id));
4025 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4026
4027 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4028 let local_var_key = local_var_apikey.key.clone();
4029 let local_var_value = match local_var_apikey.prefix {
4030 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4031 None => local_var_key,
4032 };
4033 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4034 }
4035 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4036 let local_var_key = local_var_apikey.key.clone();
4037 let local_var_value = match local_var_apikey.prefix {
4038 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4039 None => local_var_key,
4040 };
4041 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4042 }
4043 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4044 let local_var_key = local_var_apikey.key.clone();
4045 let local_var_value = match local_var_apikey.prefix {
4046 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4047 None => local_var_key,
4048 };
4049 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4050 }
4051 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4052 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4053 }
4054 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4055 let local_var_key = local_var_apikey.key.clone();
4056 let local_var_value = match local_var_apikey.prefix {
4057 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4058 None => local_var_key,
4059 };
4060 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4061 };
4062 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4063 let local_var_key = local_var_apikey.key.clone();
4064 let local_var_value = match local_var_apikey.prefix {
4065 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4066 None => local_var_key,
4067 };
4068 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4069 };
4070 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4071 let local_var_key = local_var_apikey.key.clone();
4072 let local_var_value = match local_var_apikey.prefix {
4073 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4074 None => local_var_key,
4075 };
4076 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4077 };
4078 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4079 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4080 };
4081
4082 let local_var_req = local_var_req_builder.build()?;
4083 let local_var_resp = local_var_client.execute(local_var_req).await?;
4084
4085 let local_var_status = local_var_resp.status();
4086 let local_var_content = local_var_resp.text().await?;
4087
4088 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4089 serde_json::from_str(&local_var_content).map_err(Error::from)
4090 } else {
4091 let local_var_entity: Option<IssueGetMilestoneError> = serde_json::from_str(&local_var_content).ok();
4092 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4093 Err(Error::ResponseError(local_var_error))
4094 }
4095}
4096
4097pub async fn issue_get_milestones_list(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, name: Option<&str>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Milestone>, Error<IssueGetMilestonesListError>> {
4098 let local_var_configuration = configuration;
4099
4100 let local_var_client = &local_var_configuration.client;
4101
4102 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4103 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4104
4105 if let Some(ref local_var_str) = state {
4106 local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
4107 }
4108 if let Some(ref local_var_str) = name {
4109 local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
4110 }
4111 if let Some(ref local_var_str) = page {
4112 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4113 }
4114 if let Some(ref local_var_str) = limit {
4115 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
4116 }
4117 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4118 let local_var_key = local_var_apikey.key.clone();
4119 let local_var_value = match local_var_apikey.prefix {
4120 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4121 None => local_var_key,
4122 };
4123 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4124 }
4125 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4126 let local_var_key = local_var_apikey.key.clone();
4127 let local_var_value = match local_var_apikey.prefix {
4128 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4129 None => local_var_key,
4130 };
4131 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4132 }
4133 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4134 let local_var_key = local_var_apikey.key.clone();
4135 let local_var_value = match local_var_apikey.prefix {
4136 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4137 None => local_var_key,
4138 };
4139 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4140 }
4141 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4142 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4143 }
4144 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4145 let local_var_key = local_var_apikey.key.clone();
4146 let local_var_value = match local_var_apikey.prefix {
4147 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4148 None => local_var_key,
4149 };
4150 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4151 };
4152 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4153 let local_var_key = local_var_apikey.key.clone();
4154 let local_var_value = match local_var_apikey.prefix {
4155 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4156 None => local_var_key,
4157 };
4158 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4159 };
4160 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4161 let local_var_key = local_var_apikey.key.clone();
4162 let local_var_value = match local_var_apikey.prefix {
4163 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4164 None => local_var_key,
4165 };
4166 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4167 };
4168 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4169 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4170 };
4171
4172 let local_var_req = local_var_req_builder.build()?;
4173 let local_var_resp = local_var_client.execute(local_var_req).await?;
4174
4175 let local_var_status = local_var_resp.status();
4176 let local_var_content = local_var_resp.text().await?;
4177
4178 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4179 serde_json::from_str(&local_var_content).map_err(Error::from)
4180 } else {
4181 let local_var_entity: Option<IssueGetMilestonesListError> = serde_json::from_str(&local_var_content).ok();
4182 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4183 Err(Error::ResponseError(local_var_error))
4184 }
4185}
4186
4187pub async fn issue_get_repo_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, since: Option<String>, before: Option<String>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Comment>, Error<IssueGetRepoCommentsError>> {
4188 let local_var_configuration = configuration;
4189
4190 let local_var_client = &local_var_configuration.client;
4191
4192 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4193 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4194
4195 if let Some(ref local_var_str) = since {
4196 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
4197 }
4198 if let Some(ref local_var_str) = before {
4199 local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
4200 }
4201 if let Some(ref local_var_str) = page {
4202 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4203 }
4204 if let Some(ref local_var_str) = limit {
4205 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
4206 }
4207 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4208 let local_var_key = local_var_apikey.key.clone();
4209 let local_var_value = match local_var_apikey.prefix {
4210 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4211 None => local_var_key,
4212 };
4213 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4214 }
4215 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4216 let local_var_key = local_var_apikey.key.clone();
4217 let local_var_value = match local_var_apikey.prefix {
4218 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4219 None => local_var_key,
4220 };
4221 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4222 }
4223 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4224 let local_var_key = local_var_apikey.key.clone();
4225 let local_var_value = match local_var_apikey.prefix {
4226 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4227 None => local_var_key,
4228 };
4229 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4230 }
4231 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4232 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4233 }
4234 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4235 let local_var_key = local_var_apikey.key.clone();
4236 let local_var_value = match local_var_apikey.prefix {
4237 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4238 None => local_var_key,
4239 };
4240 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4241 };
4242 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4243 let local_var_key = local_var_apikey.key.clone();
4244 let local_var_value = match local_var_apikey.prefix {
4245 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4246 None => local_var_key,
4247 };
4248 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4249 };
4250 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4251 let local_var_key = local_var_apikey.key.clone();
4252 let local_var_value = match local_var_apikey.prefix {
4253 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4254 None => local_var_key,
4255 };
4256 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4257 };
4258 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4259 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4260 };
4261
4262 let local_var_req = local_var_req_builder.build()?;
4263 let local_var_resp = local_var_client.execute(local_var_req).await?;
4264
4265 let local_var_status = local_var_resp.status();
4266 let local_var_content = local_var_resp.text().await?;
4267
4268 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4269 serde_json::from_str(&local_var_content).map_err(Error::from)
4270 } else {
4271 let local_var_entity: Option<IssueGetRepoCommentsError> = serde_json::from_str(&local_var_content).ok();
4272 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4273 Err(Error::ResponseError(local_var_error))
4274 }
4275}
4276
4277pub async fn issue_list_blocks(configuration: &configuration::Configuration, owner: &str, repo: &str, index: &str, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Issue>, Error<IssueListBlocksError>> {
4278 let local_var_configuration = configuration;
4279
4280 let local_var_client = &local_var_configuration.client;
4281
4282 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/blocks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=crate::apis::urlencode(index));
4283 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4284
4285 if let Some(ref local_var_str) = page {
4286 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4287 }
4288 if let Some(ref local_var_str) = limit {
4289 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
4290 }
4291 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4292 let local_var_key = local_var_apikey.key.clone();
4293 let local_var_value = match local_var_apikey.prefix {
4294 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4295 None => local_var_key,
4296 };
4297 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4298 }
4299 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4300 let local_var_key = local_var_apikey.key.clone();
4301 let local_var_value = match local_var_apikey.prefix {
4302 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4303 None => local_var_key,
4304 };
4305 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4306 }
4307 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4308 let local_var_key = local_var_apikey.key.clone();
4309 let local_var_value = match local_var_apikey.prefix {
4310 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4311 None => local_var_key,
4312 };
4313 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4314 }
4315 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4316 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4317 }
4318 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4319 let local_var_key = local_var_apikey.key.clone();
4320 let local_var_value = match local_var_apikey.prefix {
4321 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4322 None => local_var_key,
4323 };
4324 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4325 };
4326 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4327 let local_var_key = local_var_apikey.key.clone();
4328 let local_var_value = match local_var_apikey.prefix {
4329 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4330 None => local_var_key,
4331 };
4332 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4333 };
4334 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4335 let local_var_key = local_var_apikey.key.clone();
4336 let local_var_value = match local_var_apikey.prefix {
4337 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4338 None => local_var_key,
4339 };
4340 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4341 };
4342 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4343 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4344 };
4345
4346 let local_var_req = local_var_req_builder.build()?;
4347 let local_var_resp = local_var_client.execute(local_var_req).await?;
4348
4349 let local_var_status = local_var_resp.status();
4350 let local_var_content = local_var_resp.text().await?;
4351
4352 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4353 serde_json::from_str(&local_var_content).map_err(Error::from)
4354 } else {
4355 let local_var_entity: Option<IssueListBlocksError> = serde_json::from_str(&local_var_content).ok();
4356 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4357 Err(Error::ResponseError(local_var_error))
4358 }
4359}
4360
4361pub async fn issue_list_issue_attachments(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<Vec<models::Attachment>, Error<IssueListIssueAttachmentsError>> {
4362 let local_var_configuration = configuration;
4363
4364 let local_var_client = &local_var_configuration.client;
4365
4366 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
4367 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4368
4369 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4370 let local_var_key = local_var_apikey.key.clone();
4371 let local_var_value = match local_var_apikey.prefix {
4372 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4373 None => local_var_key,
4374 };
4375 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4376 }
4377 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4378 let local_var_key = local_var_apikey.key.clone();
4379 let local_var_value = match local_var_apikey.prefix {
4380 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4381 None => local_var_key,
4382 };
4383 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4384 }
4385 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4386 let local_var_key = local_var_apikey.key.clone();
4387 let local_var_value = match local_var_apikey.prefix {
4388 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4389 None => local_var_key,
4390 };
4391 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4392 }
4393 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4394 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4395 }
4396 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4397 let local_var_key = local_var_apikey.key.clone();
4398 let local_var_value = match local_var_apikey.prefix {
4399 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4400 None => local_var_key,
4401 };
4402 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4403 };
4404 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4405 let local_var_key = local_var_apikey.key.clone();
4406 let local_var_value = match local_var_apikey.prefix {
4407 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4408 None => local_var_key,
4409 };
4410 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4411 };
4412 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4413 let local_var_key = local_var_apikey.key.clone();
4414 let local_var_value = match local_var_apikey.prefix {
4415 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4416 None => local_var_key,
4417 };
4418 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4419 };
4420 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4421 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4422 };
4423
4424 let local_var_req = local_var_req_builder.build()?;
4425 let local_var_resp = local_var_client.execute(local_var_req).await?;
4426
4427 let local_var_status = local_var_resp.status();
4428 let local_var_content = local_var_resp.text().await?;
4429
4430 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4431 serde_json::from_str(&local_var_content).map_err(Error::from)
4432 } else {
4433 let local_var_entity: Option<IssueListIssueAttachmentsError> = serde_json::from_str(&local_var_content).ok();
4434 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4435 Err(Error::ResponseError(local_var_error))
4436 }
4437}
4438
4439pub async fn issue_list_issue_comment_attachments(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<Vec<models::Attachment>, Error<IssueListIssueCommentAttachmentsError>> {
4440 let local_var_configuration = configuration;
4441
4442 let local_var_client = &local_var_configuration.client;
4443
4444 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
4445 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4446
4447 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4448 let local_var_key = local_var_apikey.key.clone();
4449 let local_var_value = match local_var_apikey.prefix {
4450 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4451 None => local_var_key,
4452 };
4453 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4454 }
4455 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4456 let local_var_key = local_var_apikey.key.clone();
4457 let local_var_value = match local_var_apikey.prefix {
4458 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4459 None => local_var_key,
4460 };
4461 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4462 }
4463 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4464 let local_var_key = local_var_apikey.key.clone();
4465 let local_var_value = match local_var_apikey.prefix {
4466 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4467 None => local_var_key,
4468 };
4469 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4470 }
4471 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4472 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4473 }
4474 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4475 let local_var_key = local_var_apikey.key.clone();
4476 let local_var_value = match local_var_apikey.prefix {
4477 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4478 None => local_var_key,
4479 };
4480 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4481 };
4482 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4483 let local_var_key = local_var_apikey.key.clone();
4484 let local_var_value = match local_var_apikey.prefix {
4485 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4486 None => local_var_key,
4487 };
4488 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4489 };
4490 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4491 let local_var_key = local_var_apikey.key.clone();
4492 let local_var_value = match local_var_apikey.prefix {
4493 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4494 None => local_var_key,
4495 };
4496 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4497 };
4498 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4499 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4500 };
4501
4502 let local_var_req = local_var_req_builder.build()?;
4503 let local_var_resp = local_var_client.execute(local_var_req).await?;
4504
4505 let local_var_status = local_var_resp.status();
4506 let local_var_content = local_var_resp.text().await?;
4507
4508 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4509 serde_json::from_str(&local_var_content).map_err(Error::from)
4510 } else {
4511 let local_var_entity: Option<IssueListIssueCommentAttachmentsError> = serde_json::from_str(&local_var_content).ok();
4512 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4513 Err(Error::ResponseError(local_var_error))
4514 }
4515}
4516
4517pub async fn issue_list_issue_dependencies(configuration: &configuration::Configuration, owner: &str, repo: &str, index: &str, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Issue>, Error<IssueListIssueDependenciesError>> {
4518 let local_var_configuration = configuration;
4519
4520 let local_var_client = &local_var_configuration.client;
4521
4522 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/dependencies", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=crate::apis::urlencode(index));
4523 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4524
4525 if let Some(ref local_var_str) = page {
4526 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4527 }
4528 if let Some(ref local_var_str) = limit {
4529 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
4530 }
4531 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4532 let local_var_key = local_var_apikey.key.clone();
4533 let local_var_value = match local_var_apikey.prefix {
4534 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4535 None => local_var_key,
4536 };
4537 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4538 }
4539 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4540 let local_var_key = local_var_apikey.key.clone();
4541 let local_var_value = match local_var_apikey.prefix {
4542 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4543 None => local_var_key,
4544 };
4545 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4546 }
4547 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4548 let local_var_key = local_var_apikey.key.clone();
4549 let local_var_value = match local_var_apikey.prefix {
4550 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4551 None => local_var_key,
4552 };
4553 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4554 }
4555 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4556 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4557 }
4558 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4559 let local_var_key = local_var_apikey.key.clone();
4560 let local_var_value = match local_var_apikey.prefix {
4561 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4562 None => local_var_key,
4563 };
4564 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4565 };
4566 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4567 let local_var_key = local_var_apikey.key.clone();
4568 let local_var_value = match local_var_apikey.prefix {
4569 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4570 None => local_var_key,
4571 };
4572 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4573 };
4574 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4575 let local_var_key = local_var_apikey.key.clone();
4576 let local_var_value = match local_var_apikey.prefix {
4577 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4578 None => local_var_key,
4579 };
4580 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4581 };
4582 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4583 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4584 };
4585
4586 let local_var_req = local_var_req_builder.build()?;
4587 let local_var_resp = local_var_client.execute(local_var_req).await?;
4588
4589 let local_var_status = local_var_resp.status();
4590 let local_var_content = local_var_resp.text().await?;
4591
4592 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4593 serde_json::from_str(&local_var_content).map_err(Error::from)
4594 } else {
4595 let local_var_entity: Option<IssueListIssueDependenciesError> = serde_json::from_str(&local_var_content).ok();
4596 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4597 Err(Error::ResponseError(local_var_error))
4598 }
4599}
4600
4601pub async fn issue_list_issues(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, labels: Option<&str>, q: Option<&str>, r#type: Option<&str>, milestones: Option<&str>, since: Option<String>, before: Option<String>, created_by: Option<&str>, assigned_by: Option<&str>, mentioned_by: Option<&str>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Issue>, Error<IssueListIssuesError>> {
4602 let local_var_configuration = configuration;
4603
4604 let local_var_client = &local_var_configuration.client;
4605
4606 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4607 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4608
4609 if let Some(ref local_var_str) = state {
4610 local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
4611 }
4612 if let Some(ref local_var_str) = labels {
4613 local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]);
4614 }
4615 if let Some(ref local_var_str) = q {
4616 local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]);
4617 }
4618 if let Some(ref local_var_str) = r#type {
4619 local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
4620 }
4621 if let Some(ref local_var_str) = milestones {
4622 local_var_req_builder = local_var_req_builder.query(&[("milestones", &local_var_str.to_string())]);
4623 }
4624 if let Some(ref local_var_str) = since {
4625 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
4626 }
4627 if let Some(ref local_var_str) = before {
4628 local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
4629 }
4630 if let Some(ref local_var_str) = created_by {
4631 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
4632 }
4633 if let Some(ref local_var_str) = assigned_by {
4634 local_var_req_builder = local_var_req_builder.query(&[("assigned_by", &local_var_str.to_string())]);
4635 }
4636 if let Some(ref local_var_str) = mentioned_by {
4637 local_var_req_builder = local_var_req_builder.query(&[("mentioned_by", &local_var_str.to_string())]);
4638 }
4639 if let Some(ref local_var_str) = page {
4640 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4641 }
4642 if let Some(ref local_var_str) = limit {
4643 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
4644 }
4645 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4646 let local_var_key = local_var_apikey.key.clone();
4647 let local_var_value = match local_var_apikey.prefix {
4648 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4649 None => local_var_key,
4650 };
4651 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4652 }
4653 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4654 let local_var_key = local_var_apikey.key.clone();
4655 let local_var_value = match local_var_apikey.prefix {
4656 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4657 None => local_var_key,
4658 };
4659 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4660 }
4661 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4662 let local_var_key = local_var_apikey.key.clone();
4663 let local_var_value = match local_var_apikey.prefix {
4664 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4665 None => local_var_key,
4666 };
4667 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4668 }
4669 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4670 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4671 }
4672 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4673 let local_var_key = local_var_apikey.key.clone();
4674 let local_var_value = match local_var_apikey.prefix {
4675 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4676 None => local_var_key,
4677 };
4678 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4679 };
4680 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4681 let local_var_key = local_var_apikey.key.clone();
4682 let local_var_value = match local_var_apikey.prefix {
4683 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4684 None => local_var_key,
4685 };
4686 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4687 };
4688 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4689 let local_var_key = local_var_apikey.key.clone();
4690 let local_var_value = match local_var_apikey.prefix {
4691 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4692 None => local_var_key,
4693 };
4694 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4695 };
4696 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4697 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4698 };
4699
4700 let local_var_req = local_var_req_builder.build()?;
4701 let local_var_resp = local_var_client.execute(local_var_req).await?;
4702
4703 let local_var_status = local_var_resp.status();
4704 let local_var_content = local_var_resp.text().await?;
4705
4706 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4707 serde_json::from_str(&local_var_content).map_err(Error::from)
4708 } else {
4709 let local_var_entity: Option<IssueListIssuesError> = serde_json::from_str(&local_var_content).ok();
4710 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4711 Err(Error::ResponseError(local_var_error))
4712 }
4713}
4714
4715pub async fn issue_list_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Label>, Error<IssueListLabelsError>> {
4716 let local_var_configuration = configuration;
4717
4718 let local_var_client = &local_var_configuration.client;
4719
4720 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
4721 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4722
4723 if let Some(ref local_var_str) = page {
4724 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4725 }
4726 if let Some(ref local_var_str) = limit {
4727 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
4728 }
4729 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4730 let local_var_key = local_var_apikey.key.clone();
4731 let local_var_value = match local_var_apikey.prefix {
4732 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4733 None => local_var_key,
4734 };
4735 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4736 }
4737 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4738 let local_var_key = local_var_apikey.key.clone();
4739 let local_var_value = match local_var_apikey.prefix {
4740 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4741 None => local_var_key,
4742 };
4743 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4744 }
4745 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4746 let local_var_key = local_var_apikey.key.clone();
4747 let local_var_value = match local_var_apikey.prefix {
4748 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4749 None => local_var_key,
4750 };
4751 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4752 }
4753 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4754 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4755 }
4756 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4757 let local_var_key = local_var_apikey.key.clone();
4758 let local_var_value = match local_var_apikey.prefix {
4759 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4760 None => local_var_key,
4761 };
4762 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4763 };
4764 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4765 let local_var_key = local_var_apikey.key.clone();
4766 let local_var_value = match local_var_apikey.prefix {
4767 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4768 None => local_var_key,
4769 };
4770 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4771 };
4772 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4773 let local_var_key = local_var_apikey.key.clone();
4774 let local_var_value = match local_var_apikey.prefix {
4775 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4776 None => local_var_key,
4777 };
4778 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4779 };
4780 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4781 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4782 };
4783
4784 let local_var_req = local_var_req_builder.build()?;
4785 let local_var_resp = local_var_client.execute(local_var_req).await?;
4786
4787 let local_var_status = local_var_resp.status();
4788 let local_var_content = local_var_resp.text().await?;
4789
4790 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4791 serde_json::from_str(&local_var_content).map_err(Error::from)
4792 } else {
4793 let local_var_entity: Option<IssueListLabelsError> = serde_json::from_str(&local_var_content).ok();
4794 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4795 Err(Error::ResponseError(local_var_error))
4796 }
4797}
4798
4799pub async fn issue_post_comment_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, content: Option<models::EditReactionOption>) -> Result<models::Reaction, Error<IssuePostCommentReactionError>> {
4800 let local_var_configuration = configuration;
4801
4802 let local_var_client = &local_var_configuration.client;
4803
4804 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id);
4805 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4806
4807 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4808 let local_var_key = local_var_apikey.key.clone();
4809 let local_var_value = match local_var_apikey.prefix {
4810 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4811 None => local_var_key,
4812 };
4813 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4814 }
4815 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4816 let local_var_key = local_var_apikey.key.clone();
4817 let local_var_value = match local_var_apikey.prefix {
4818 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4819 None => local_var_key,
4820 };
4821 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4822 }
4823 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4824 let local_var_key = local_var_apikey.key.clone();
4825 let local_var_value = match local_var_apikey.prefix {
4826 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4827 None => local_var_key,
4828 };
4829 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4830 }
4831 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4832 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4833 }
4834 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4835 let local_var_key = local_var_apikey.key.clone();
4836 let local_var_value = match local_var_apikey.prefix {
4837 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4838 None => local_var_key,
4839 };
4840 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4841 };
4842 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4843 let local_var_key = local_var_apikey.key.clone();
4844 let local_var_value = match local_var_apikey.prefix {
4845 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4846 None => local_var_key,
4847 };
4848 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4849 };
4850 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4851 let local_var_key = local_var_apikey.key.clone();
4852 let local_var_value = match local_var_apikey.prefix {
4853 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4854 None => local_var_key,
4855 };
4856 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4857 };
4858 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4859 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4860 };
4861 local_var_req_builder = local_var_req_builder.json(&content);
4862
4863 let local_var_req = local_var_req_builder.build()?;
4864 let local_var_resp = local_var_client.execute(local_var_req).await?;
4865
4866 let local_var_status = local_var_resp.status();
4867 let local_var_content = local_var_resp.text().await?;
4868
4869 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4870 serde_json::from_str(&local_var_content).map_err(Error::from)
4871 } else {
4872 let local_var_entity: Option<IssuePostCommentReactionError> = serde_json::from_str(&local_var_content).ok();
4873 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4874 Err(Error::ResponseError(local_var_error))
4875 }
4876}
4877
4878pub async fn issue_post_issue_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, content: Option<models::EditReactionOption>) -> Result<models::Reaction, Error<IssuePostIssueReactionError>> {
4879 let local_var_configuration = configuration;
4880
4881 let local_var_client = &local_var_configuration.client;
4882
4883 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
4884 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4885
4886 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4887 let local_var_key = local_var_apikey.key.clone();
4888 let local_var_value = match local_var_apikey.prefix {
4889 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4890 None => local_var_key,
4891 };
4892 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4893 }
4894 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4895 let local_var_key = local_var_apikey.key.clone();
4896 let local_var_value = match local_var_apikey.prefix {
4897 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4898 None => local_var_key,
4899 };
4900 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4901 }
4902 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4903 let local_var_key = local_var_apikey.key.clone();
4904 let local_var_value = match local_var_apikey.prefix {
4905 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4906 None => local_var_key,
4907 };
4908 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4909 }
4910 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4911 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4912 }
4913 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4914 let local_var_key = local_var_apikey.key.clone();
4915 let local_var_value = match local_var_apikey.prefix {
4916 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4917 None => local_var_key,
4918 };
4919 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4920 };
4921 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4922 let local_var_key = local_var_apikey.key.clone();
4923 let local_var_value = match local_var_apikey.prefix {
4924 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4925 None => local_var_key,
4926 };
4927 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
4928 };
4929 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4930 let local_var_key = local_var_apikey.key.clone();
4931 let local_var_value = match local_var_apikey.prefix {
4932 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4933 None => local_var_key,
4934 };
4935 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
4936 };
4937 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
4938 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
4939 };
4940 local_var_req_builder = local_var_req_builder.json(&content);
4941
4942 let local_var_req = local_var_req_builder.build()?;
4943 let local_var_resp = local_var_client.execute(local_var_req).await?;
4944
4945 let local_var_status = local_var_resp.status();
4946 let local_var_content = local_var_resp.text().await?;
4947
4948 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4949 serde_json::from_str(&local_var_content).map_err(Error::from)
4950 } else {
4951 let local_var_entity: Option<IssuePostIssueReactionError> = serde_json::from_str(&local_var_content).ok();
4952 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4953 Err(Error::ResponseError(local_var_error))
4954 }
4955}
4956
4957pub async fn issue_remove_issue_blocking(configuration: &configuration::Configuration, owner: &str, repo: &str, index: &str, body: Option<models::IssueMeta>) -> Result<models::Issue, Error<IssueRemoveIssueBlockingError>> {
4958 let local_var_configuration = configuration;
4959
4960 let local_var_client = &local_var_configuration.client;
4961
4962 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/blocks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=crate::apis::urlencode(index));
4963 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
4964
4965 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4966 let local_var_key = local_var_apikey.key.clone();
4967 let local_var_value = match local_var_apikey.prefix {
4968 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4969 None => local_var_key,
4970 };
4971 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
4972 }
4973 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4974 let local_var_key = local_var_apikey.key.clone();
4975 let local_var_value = match local_var_apikey.prefix {
4976 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4977 None => local_var_key,
4978 };
4979 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
4980 }
4981 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4982 let local_var_key = local_var_apikey.key.clone();
4983 let local_var_value = match local_var_apikey.prefix {
4984 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4985 None => local_var_key,
4986 };
4987 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
4988 }
4989 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4990 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4991 }
4992 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
4993 let local_var_key = local_var_apikey.key.clone();
4994 let local_var_value = match local_var_apikey.prefix {
4995 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
4996 None => local_var_key,
4997 };
4998 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
4999 };
5000 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5001 let local_var_key = local_var_apikey.key.clone();
5002 let local_var_value = match local_var_apikey.prefix {
5003 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5004 None => local_var_key,
5005 };
5006 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5007 };
5008 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5009 let local_var_key = local_var_apikey.key.clone();
5010 let local_var_value = match local_var_apikey.prefix {
5011 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5012 None => local_var_key,
5013 };
5014 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5015 };
5016 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5017 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5018 };
5019 local_var_req_builder = local_var_req_builder.json(&body);
5020
5021 let local_var_req = local_var_req_builder.build()?;
5022 let local_var_resp = local_var_client.execute(local_var_req).await?;
5023
5024 let local_var_status = local_var_resp.status();
5025 let local_var_content = local_var_resp.text().await?;
5026
5027 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5028 serde_json::from_str(&local_var_content).map_err(Error::from)
5029 } else {
5030 let local_var_entity: Option<IssueRemoveIssueBlockingError> = serde_json::from_str(&local_var_content).ok();
5031 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5032 Err(Error::ResponseError(local_var_error))
5033 }
5034}
5035
5036pub async fn issue_remove_issue_dependencies(configuration: &configuration::Configuration, owner: &str, repo: &str, index: &str, body: Option<models::IssueMeta>) -> Result<models::Issue, Error<IssueRemoveIssueDependenciesError>> {
5037 let local_var_configuration = configuration;
5038
5039 let local_var_client = &local_var_configuration.client;
5040
5041 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/dependencies", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=crate::apis::urlencode(index));
5042 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
5043
5044 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5045 let local_var_key = local_var_apikey.key.clone();
5046 let local_var_value = match local_var_apikey.prefix {
5047 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5048 None => local_var_key,
5049 };
5050 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5051 }
5052 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5053 let local_var_key = local_var_apikey.key.clone();
5054 let local_var_value = match local_var_apikey.prefix {
5055 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5056 None => local_var_key,
5057 };
5058 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5059 }
5060 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5061 let local_var_key = local_var_apikey.key.clone();
5062 let local_var_value = match local_var_apikey.prefix {
5063 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5064 None => local_var_key,
5065 };
5066 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5067 }
5068 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5069 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5070 }
5071 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5072 let local_var_key = local_var_apikey.key.clone();
5073 let local_var_value = match local_var_apikey.prefix {
5074 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5075 None => local_var_key,
5076 };
5077 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5078 };
5079 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5080 let local_var_key = local_var_apikey.key.clone();
5081 let local_var_value = match local_var_apikey.prefix {
5082 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5083 None => local_var_key,
5084 };
5085 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5086 };
5087 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5088 let local_var_key = local_var_apikey.key.clone();
5089 let local_var_value = match local_var_apikey.prefix {
5090 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5091 None => local_var_key,
5092 };
5093 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5094 };
5095 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5096 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5097 };
5098 local_var_req_builder = local_var_req_builder.json(&body);
5099
5100 let local_var_req = local_var_req_builder.build()?;
5101 let local_var_resp = local_var_client.execute(local_var_req).await?;
5102
5103 let local_var_status = local_var_resp.status();
5104 let local_var_content = local_var_resp.text().await?;
5105
5106 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5107 serde_json::from_str(&local_var_content).map_err(Error::from)
5108 } else {
5109 let local_var_entity: Option<IssueRemoveIssueDependenciesError> = serde_json::from_str(&local_var_content).ok();
5110 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5111 Err(Error::ResponseError(local_var_error))
5112 }
5113}
5114
5115pub async fn issue_remove_label(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result<(), Error<IssueRemoveLabelError>> {
5116 let local_var_configuration = configuration;
5117
5118 let local_var_client = &local_var_configuration.client;
5119
5120 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id);
5121 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
5122
5123 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5124 let local_var_key = local_var_apikey.key.clone();
5125 let local_var_value = match local_var_apikey.prefix {
5126 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5127 None => local_var_key,
5128 };
5129 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5130 }
5131 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5132 let local_var_key = local_var_apikey.key.clone();
5133 let local_var_value = match local_var_apikey.prefix {
5134 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5135 None => local_var_key,
5136 };
5137 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5138 }
5139 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5140 let local_var_key = local_var_apikey.key.clone();
5141 let local_var_value = match local_var_apikey.prefix {
5142 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5143 None => local_var_key,
5144 };
5145 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5146 }
5147 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5148 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5149 }
5150 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5151 let local_var_key = local_var_apikey.key.clone();
5152 let local_var_value = match local_var_apikey.prefix {
5153 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5154 None => local_var_key,
5155 };
5156 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5157 };
5158 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5159 let local_var_key = local_var_apikey.key.clone();
5160 let local_var_value = match local_var_apikey.prefix {
5161 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5162 None => local_var_key,
5163 };
5164 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5165 };
5166 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5167 let local_var_key = local_var_apikey.key.clone();
5168 let local_var_value = match local_var_apikey.prefix {
5169 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5170 None => local_var_key,
5171 };
5172 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5173 };
5174 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5175 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5176 };
5177
5178 let local_var_req = local_var_req_builder.build()?;
5179 let local_var_resp = local_var_client.execute(local_var_req).await?;
5180
5181 let local_var_status = local_var_resp.status();
5182 let local_var_content = local_var_resp.text().await?;
5183
5184 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5185 Ok(())
5186 } else {
5187 let local_var_entity: Option<IssueRemoveLabelError> = serde_json::from_str(&local_var_content).ok();
5188 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5189 Err(Error::ResponseError(local_var_error))
5190 }
5191}
5192
5193pub async fn issue_replace_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option<models::IssueLabelsOption>) -> Result<Vec<models::Label>, Error<IssueReplaceLabelsError>> {
5194 let local_var_configuration = configuration;
5195
5196 let local_var_client = &local_var_configuration.client;
5197
5198 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5199 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
5200
5201 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5202 let local_var_key = local_var_apikey.key.clone();
5203 let local_var_value = match local_var_apikey.prefix {
5204 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5205 None => local_var_key,
5206 };
5207 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5208 }
5209 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5210 let local_var_key = local_var_apikey.key.clone();
5211 let local_var_value = match local_var_apikey.prefix {
5212 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5213 None => local_var_key,
5214 };
5215 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5216 }
5217 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5218 let local_var_key = local_var_apikey.key.clone();
5219 let local_var_value = match local_var_apikey.prefix {
5220 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5221 None => local_var_key,
5222 };
5223 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5224 }
5225 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5226 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5227 }
5228 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5229 let local_var_key = local_var_apikey.key.clone();
5230 let local_var_value = match local_var_apikey.prefix {
5231 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5232 None => local_var_key,
5233 };
5234 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5235 };
5236 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5237 let local_var_key = local_var_apikey.key.clone();
5238 let local_var_value = match local_var_apikey.prefix {
5239 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5240 None => local_var_key,
5241 };
5242 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5243 };
5244 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5245 let local_var_key = local_var_apikey.key.clone();
5246 let local_var_value = match local_var_apikey.prefix {
5247 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5248 None => local_var_key,
5249 };
5250 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5251 };
5252 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5253 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5254 };
5255 local_var_req_builder = local_var_req_builder.json(&body);
5256
5257 let local_var_req = local_var_req_builder.build()?;
5258 let local_var_resp = local_var_client.execute(local_var_req).await?;
5259
5260 let local_var_status = local_var_resp.status();
5261 let local_var_content = local_var_resp.text().await?;
5262
5263 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5264 serde_json::from_str(&local_var_content).map_err(Error::from)
5265 } else {
5266 let local_var_entity: Option<IssueReplaceLabelsError> = serde_json::from_str(&local_var_content).ok();
5267 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5268 Err(Error::ResponseError(local_var_error))
5269 }
5270}
5271
5272pub async fn issue_reset_time(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<IssueResetTimeError>> {
5273 let local_var_configuration = configuration;
5274
5275 let local_var_client = &local_var_configuration.client;
5276
5277 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5278 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
5279
5280 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5281 let local_var_key = local_var_apikey.key.clone();
5282 let local_var_value = match local_var_apikey.prefix {
5283 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5284 None => local_var_key,
5285 };
5286 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5287 }
5288 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5289 let local_var_key = local_var_apikey.key.clone();
5290 let local_var_value = match local_var_apikey.prefix {
5291 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5292 None => local_var_key,
5293 };
5294 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5295 }
5296 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5297 let local_var_key = local_var_apikey.key.clone();
5298 let local_var_value = match local_var_apikey.prefix {
5299 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5300 None => local_var_key,
5301 };
5302 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5303 }
5304 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5305 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5306 }
5307 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5308 let local_var_key = local_var_apikey.key.clone();
5309 let local_var_value = match local_var_apikey.prefix {
5310 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5311 None => local_var_key,
5312 };
5313 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5314 };
5315 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5316 let local_var_key = local_var_apikey.key.clone();
5317 let local_var_value = match local_var_apikey.prefix {
5318 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5319 None => local_var_key,
5320 };
5321 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5322 };
5323 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5324 let local_var_key = local_var_apikey.key.clone();
5325 let local_var_value = match local_var_apikey.prefix {
5326 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5327 None => local_var_key,
5328 };
5329 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5330 };
5331 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5332 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5333 };
5334
5335 let local_var_req = local_var_req_builder.build()?;
5336 let local_var_resp = local_var_client.execute(local_var_req).await?;
5337
5338 let local_var_status = local_var_resp.status();
5339 let local_var_content = local_var_resp.text().await?;
5340
5341 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5342 Ok(())
5343 } else {
5344 let local_var_entity: Option<IssueResetTimeError> = serde_json::from_str(&local_var_content).ok();
5345 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5346 Err(Error::ResponseError(local_var_error))
5347 }
5348}
5349
5350pub async fn issue_search_issues(configuration: &configuration::Configuration, state: Option<&str>, labels: Option<&str>, milestones: Option<&str>, q: Option<&str>, priority_repo_id: Option<i64>, r#type: Option<&str>, since: Option<String>, before: Option<String>, assigned: Option<bool>, created: Option<bool>, mentioned: Option<bool>, review_requested: Option<bool>, reviewed: Option<bool>, owner: Option<&str>, team: Option<&str>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::Issue>, Error<IssueSearchIssuesError>> {
5351 let local_var_configuration = configuration;
5352
5353 let local_var_client = &local_var_configuration.client;
5354
5355 let local_var_uri_str = format!("{}/repos/issues/search", local_var_configuration.base_path);
5356 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5357
5358 if let Some(ref local_var_str) = state {
5359 local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
5360 }
5361 if let Some(ref local_var_str) = labels {
5362 local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]);
5363 }
5364 if let Some(ref local_var_str) = milestones {
5365 local_var_req_builder = local_var_req_builder.query(&[("milestones", &local_var_str.to_string())]);
5366 }
5367 if let Some(ref local_var_str) = q {
5368 local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]);
5369 }
5370 if let Some(ref local_var_str) = priority_repo_id {
5371 local_var_req_builder = local_var_req_builder.query(&[("priority_repo_id", &local_var_str.to_string())]);
5372 }
5373 if let Some(ref local_var_str) = r#type {
5374 local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
5375 }
5376 if let Some(ref local_var_str) = since {
5377 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
5378 }
5379 if let Some(ref local_var_str) = before {
5380 local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
5381 }
5382 if let Some(ref local_var_str) = assigned {
5383 local_var_req_builder = local_var_req_builder.query(&[("assigned", &local_var_str.to_string())]);
5384 }
5385 if let Some(ref local_var_str) = created {
5386 local_var_req_builder = local_var_req_builder.query(&[("created", &local_var_str.to_string())]);
5387 }
5388 if let Some(ref local_var_str) = mentioned {
5389 local_var_req_builder = local_var_req_builder.query(&[("mentioned", &local_var_str.to_string())]);
5390 }
5391 if let Some(ref local_var_str) = review_requested {
5392 local_var_req_builder = local_var_req_builder.query(&[("review_requested", &local_var_str.to_string())]);
5393 }
5394 if let Some(ref local_var_str) = reviewed {
5395 local_var_req_builder = local_var_req_builder.query(&[("reviewed", &local_var_str.to_string())]);
5396 }
5397 if let Some(ref local_var_str) = owner {
5398 local_var_req_builder = local_var_req_builder.query(&[("owner", &local_var_str.to_string())]);
5399 }
5400 if let Some(ref local_var_str) = team {
5401 local_var_req_builder = local_var_req_builder.query(&[("team", &local_var_str.to_string())]);
5402 }
5403 if let Some(ref local_var_str) = page {
5404 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5405 }
5406 if let Some(ref local_var_str) = limit {
5407 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
5408 }
5409 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5410 let local_var_key = local_var_apikey.key.clone();
5411 let local_var_value = match local_var_apikey.prefix {
5412 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5413 None => local_var_key,
5414 };
5415 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5416 }
5417 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5418 let local_var_key = local_var_apikey.key.clone();
5419 let local_var_value = match local_var_apikey.prefix {
5420 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5421 None => local_var_key,
5422 };
5423 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5424 }
5425 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5426 let local_var_key = local_var_apikey.key.clone();
5427 let local_var_value = match local_var_apikey.prefix {
5428 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5429 None => local_var_key,
5430 };
5431 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5432 }
5433 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5434 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5435 }
5436 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5437 let local_var_key = local_var_apikey.key.clone();
5438 let local_var_value = match local_var_apikey.prefix {
5439 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5440 None => local_var_key,
5441 };
5442 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5443 };
5444 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5445 let local_var_key = local_var_apikey.key.clone();
5446 let local_var_value = match local_var_apikey.prefix {
5447 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5448 None => local_var_key,
5449 };
5450 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5451 };
5452 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5453 let local_var_key = local_var_apikey.key.clone();
5454 let local_var_value = match local_var_apikey.prefix {
5455 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5456 None => local_var_key,
5457 };
5458 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5459 };
5460 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5461 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5462 };
5463
5464 let local_var_req = local_var_req_builder.build()?;
5465 let local_var_resp = local_var_client.execute(local_var_req).await?;
5466
5467 let local_var_status = local_var_resp.status();
5468 let local_var_content = local_var_resp.text().await?;
5469
5470 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5471 serde_json::from_str(&local_var_content).map_err(Error::from)
5472 } else {
5473 let local_var_entity: Option<IssueSearchIssuesError> = serde_json::from_str(&local_var_content).ok();
5474 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5475 Err(Error::ResponseError(local_var_error))
5476 }
5477}
5478
5479pub async fn issue_start_stop_watch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<IssueStartStopWatchError>> {
5480 let local_var_configuration = configuration;
5481
5482 let local_var_client = &local_var_configuration.client;
5483
5484 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/start", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5485 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5486
5487 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5488 let local_var_key = local_var_apikey.key.clone();
5489 let local_var_value = match local_var_apikey.prefix {
5490 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5491 None => local_var_key,
5492 };
5493 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5494 }
5495 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5496 let local_var_key = local_var_apikey.key.clone();
5497 let local_var_value = match local_var_apikey.prefix {
5498 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5499 None => local_var_key,
5500 };
5501 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5502 }
5503 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5504 let local_var_key = local_var_apikey.key.clone();
5505 let local_var_value = match local_var_apikey.prefix {
5506 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5507 None => local_var_key,
5508 };
5509 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5510 }
5511 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5512 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5513 }
5514 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5515 let local_var_key = local_var_apikey.key.clone();
5516 let local_var_value = match local_var_apikey.prefix {
5517 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5518 None => local_var_key,
5519 };
5520 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5521 };
5522 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5523 let local_var_key = local_var_apikey.key.clone();
5524 let local_var_value = match local_var_apikey.prefix {
5525 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5526 None => local_var_key,
5527 };
5528 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5529 };
5530 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5531 let local_var_key = local_var_apikey.key.clone();
5532 let local_var_value = match local_var_apikey.prefix {
5533 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5534 None => local_var_key,
5535 };
5536 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5537 };
5538 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5539 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5540 };
5541
5542 let local_var_req = local_var_req_builder.build()?;
5543 let local_var_resp = local_var_client.execute(local_var_req).await?;
5544
5545 let local_var_status = local_var_resp.status();
5546 let local_var_content = local_var_resp.text().await?;
5547
5548 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5549 Ok(())
5550 } else {
5551 let local_var_entity: Option<IssueStartStopWatchError> = serde_json::from_str(&local_var_content).ok();
5552 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5553 Err(Error::ResponseError(local_var_error))
5554 }
5555}
5556
5557pub async fn issue_stop_stop_watch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<IssueStopStopWatchError>> {
5558 let local_var_configuration = configuration;
5559
5560 let local_var_client = &local_var_configuration.client;
5561
5562 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/stop", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5563 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5564
5565 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5566 let local_var_key = local_var_apikey.key.clone();
5567 let local_var_value = match local_var_apikey.prefix {
5568 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5569 None => local_var_key,
5570 };
5571 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5572 }
5573 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5574 let local_var_key = local_var_apikey.key.clone();
5575 let local_var_value = match local_var_apikey.prefix {
5576 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5577 None => local_var_key,
5578 };
5579 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5580 }
5581 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5582 let local_var_key = local_var_apikey.key.clone();
5583 let local_var_value = match local_var_apikey.prefix {
5584 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5585 None => local_var_key,
5586 };
5587 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5588 }
5589 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5590 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5591 }
5592 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5593 let local_var_key = local_var_apikey.key.clone();
5594 let local_var_value = match local_var_apikey.prefix {
5595 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5596 None => local_var_key,
5597 };
5598 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5599 };
5600 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5601 let local_var_key = local_var_apikey.key.clone();
5602 let local_var_value = match local_var_apikey.prefix {
5603 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5604 None => local_var_key,
5605 };
5606 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5607 };
5608 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5609 let local_var_key = local_var_apikey.key.clone();
5610 let local_var_value = match local_var_apikey.prefix {
5611 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5612 None => local_var_key,
5613 };
5614 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5615 };
5616 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5617 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5618 };
5619
5620 let local_var_req = local_var_req_builder.build()?;
5621 let local_var_resp = local_var_client.execute(local_var_req).await?;
5622
5623 let local_var_status = local_var_resp.status();
5624 let local_var_content = local_var_resp.text().await?;
5625
5626 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5627 Ok(())
5628 } else {
5629 let local_var_entity: Option<IssueStopStopWatchError> = serde_json::from_str(&local_var_content).ok();
5630 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5631 Err(Error::ResponseError(local_var_error))
5632 }
5633}
5634
5635pub async fn issue_subscriptions(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::User>, Error<IssueSubscriptionsError>> {
5636 let local_var_configuration = configuration;
5637
5638 let local_var_client = &local_var_configuration.client;
5639
5640 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5641 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5642
5643 if let Some(ref local_var_str) = page {
5644 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5645 }
5646 if let Some(ref local_var_str) = limit {
5647 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
5648 }
5649 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5650 let local_var_key = local_var_apikey.key.clone();
5651 let local_var_value = match local_var_apikey.prefix {
5652 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5653 None => local_var_key,
5654 };
5655 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5656 }
5657 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5658 let local_var_key = local_var_apikey.key.clone();
5659 let local_var_value = match local_var_apikey.prefix {
5660 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5661 None => local_var_key,
5662 };
5663 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5664 }
5665 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5666 let local_var_key = local_var_apikey.key.clone();
5667 let local_var_value = match local_var_apikey.prefix {
5668 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5669 None => local_var_key,
5670 };
5671 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5672 }
5673 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5674 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5675 }
5676 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5677 let local_var_key = local_var_apikey.key.clone();
5678 let local_var_value = match local_var_apikey.prefix {
5679 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5680 None => local_var_key,
5681 };
5682 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5683 };
5684 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5685 let local_var_key = local_var_apikey.key.clone();
5686 let local_var_value = match local_var_apikey.prefix {
5687 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5688 None => local_var_key,
5689 };
5690 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5691 };
5692 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5693 let local_var_key = local_var_apikey.key.clone();
5694 let local_var_value = match local_var_apikey.prefix {
5695 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5696 None => local_var_key,
5697 };
5698 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5699 };
5700 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5701 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5702 };
5703
5704 let local_var_req = local_var_req_builder.build()?;
5705 let local_var_resp = local_var_client.execute(local_var_req).await?;
5706
5707 let local_var_status = local_var_resp.status();
5708 let local_var_content = local_var_resp.text().await?;
5709
5710 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5711 serde_json::from_str(&local_var_content).map_err(Error::from)
5712 } else {
5713 let local_var_entity: Option<IssueSubscriptionsError> = serde_json::from_str(&local_var_content).ok();
5714 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5715 Err(Error::ResponseError(local_var_error))
5716 }
5717}
5718
5719pub async fn issue_tracked_times(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, user: Option<&str>, since: Option<String>, before: Option<String>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::TrackedTime>, Error<IssueTrackedTimesError>> {
5720 let local_var_configuration = configuration;
5721
5722 let local_var_client = &local_var_configuration.client;
5723
5724 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5725 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5726
5727 if let Some(ref local_var_str) = user {
5728 local_var_req_builder = local_var_req_builder.query(&[("user", &local_var_str.to_string())]);
5729 }
5730 if let Some(ref local_var_str) = since {
5731 local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
5732 }
5733 if let Some(ref local_var_str) = before {
5734 local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
5735 }
5736 if let Some(ref local_var_str) = page {
5737 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
5738 }
5739 if let Some(ref local_var_str) = limit {
5740 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
5741 }
5742 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5743 let local_var_key = local_var_apikey.key.clone();
5744 let local_var_value = match local_var_apikey.prefix {
5745 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5746 None => local_var_key,
5747 };
5748 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5749 }
5750 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5751 let local_var_key = local_var_apikey.key.clone();
5752 let local_var_value = match local_var_apikey.prefix {
5753 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5754 None => local_var_key,
5755 };
5756 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5757 }
5758 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5759 let local_var_key = local_var_apikey.key.clone();
5760 let local_var_value = match local_var_apikey.prefix {
5761 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5762 None => local_var_key,
5763 };
5764 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5765 }
5766 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5767 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5768 }
5769 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5770 let local_var_key = local_var_apikey.key.clone();
5771 let local_var_value = match local_var_apikey.prefix {
5772 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5773 None => local_var_key,
5774 };
5775 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5776 };
5777 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5778 let local_var_key = local_var_apikey.key.clone();
5779 let local_var_value = match local_var_apikey.prefix {
5780 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5781 None => local_var_key,
5782 };
5783 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5784 };
5785 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5786 let local_var_key = local_var_apikey.key.clone();
5787 let local_var_value = match local_var_apikey.prefix {
5788 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5789 None => local_var_key,
5790 };
5791 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5792 };
5793 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5794 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5795 };
5796
5797 let local_var_req = local_var_req_builder.build()?;
5798 let local_var_resp = local_var_client.execute(local_var_req).await?;
5799
5800 let local_var_status = local_var_resp.status();
5801 let local_var_content = local_var_resp.text().await?;
5802
5803 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5804 serde_json::from_str(&local_var_content).map_err(Error::from)
5805 } else {
5806 let local_var_entity: Option<IssueTrackedTimesError> = serde_json::from_str(&local_var_content).ok();
5807 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5808 Err(Error::ResponseError(local_var_error))
5809 }
5810}
5811
5812pub async fn move_issue_pin(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, position: i64) -> Result<(), Error<MoveIssuePinError>> {
5813 let local_var_configuration = configuration;
5814
5815 let local_var_client = &local_var_configuration.client;
5816
5817 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/pin/{position}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, position=position);
5818 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
5819
5820 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5821 let local_var_key = local_var_apikey.key.clone();
5822 let local_var_value = match local_var_apikey.prefix {
5823 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5824 None => local_var_key,
5825 };
5826 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5827 }
5828 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5829 let local_var_key = local_var_apikey.key.clone();
5830 let local_var_value = match local_var_apikey.prefix {
5831 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5832 None => local_var_key,
5833 };
5834 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5835 }
5836 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5837 let local_var_key = local_var_apikey.key.clone();
5838 let local_var_value = match local_var_apikey.prefix {
5839 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5840 None => local_var_key,
5841 };
5842 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5843 }
5844 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5845 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5846 }
5847 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5848 let local_var_key = local_var_apikey.key.clone();
5849 let local_var_value = match local_var_apikey.prefix {
5850 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5851 None => local_var_key,
5852 };
5853 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5854 };
5855 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5856 let local_var_key = local_var_apikey.key.clone();
5857 let local_var_value = match local_var_apikey.prefix {
5858 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5859 None => local_var_key,
5860 };
5861 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5862 };
5863 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5864 let local_var_key = local_var_apikey.key.clone();
5865 let local_var_value = match local_var_apikey.prefix {
5866 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5867 None => local_var_key,
5868 };
5869 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5870 };
5871 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5872 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5873 };
5874
5875 let local_var_req = local_var_req_builder.build()?;
5876 let local_var_resp = local_var_client.execute(local_var_req).await?;
5877
5878 let local_var_status = local_var_resp.status();
5879 let local_var_content = local_var_resp.text().await?;
5880
5881 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5882 Ok(())
5883 } else {
5884 let local_var_entity: Option<MoveIssuePinError> = serde_json::from_str(&local_var_content).ok();
5885 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5886 Err(Error::ResponseError(local_var_error))
5887 }
5888}
5889
5890pub async fn pin_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<PinIssueError>> {
5891 let local_var_configuration = configuration;
5892
5893 let local_var_client = &local_var_configuration.client;
5894
5895 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/pin", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5896 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5897
5898 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5899 let local_var_key = local_var_apikey.key.clone();
5900 let local_var_value = match local_var_apikey.prefix {
5901 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5902 None => local_var_key,
5903 };
5904 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5905 }
5906 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5907 let local_var_key = local_var_apikey.key.clone();
5908 let local_var_value = match local_var_apikey.prefix {
5909 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5910 None => local_var_key,
5911 };
5912 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5913 }
5914 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5915 let local_var_key = local_var_apikey.key.clone();
5916 let local_var_value = match local_var_apikey.prefix {
5917 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5918 None => local_var_key,
5919 };
5920 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5921 }
5922 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5923 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5924 }
5925 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5926 let local_var_key = local_var_apikey.key.clone();
5927 let local_var_value = match local_var_apikey.prefix {
5928 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5929 None => local_var_key,
5930 };
5931 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
5932 };
5933 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5934 let local_var_key = local_var_apikey.key.clone();
5935 let local_var_value = match local_var_apikey.prefix {
5936 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5937 None => local_var_key,
5938 };
5939 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
5940 };
5941 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5942 let local_var_key = local_var_apikey.key.clone();
5943 let local_var_value = match local_var_apikey.prefix {
5944 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5945 None => local_var_key,
5946 };
5947 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
5948 };
5949 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
5950 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
5951 };
5952
5953 let local_var_req = local_var_req_builder.build()?;
5954 let local_var_resp = local_var_client.execute(local_var_req).await?;
5955
5956 let local_var_status = local_var_resp.status();
5957 let local_var_content = local_var_resp.text().await?;
5958
5959 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5960 Ok(())
5961 } else {
5962 let local_var_entity: Option<PinIssueError> = serde_json::from_str(&local_var_content).ok();
5963 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5964 Err(Error::ResponseError(local_var_error))
5965 }
5966}
5967
5968pub async fn unpin_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error<UnpinIssueError>> {
5969 let local_var_configuration = configuration;
5970
5971 let local_var_client = &local_var_configuration.client;
5972
5973 let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/pin", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index);
5974 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
5975
5976 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5977 let local_var_key = local_var_apikey.key.clone();
5978 let local_var_value = match local_var_apikey.prefix {
5979 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5980 None => local_var_key,
5981 };
5982 local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
5983 }
5984 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5985 let local_var_key = local_var_apikey.key.clone();
5986 let local_var_value = match local_var_apikey.prefix {
5987 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5988 None => local_var_key,
5989 };
5990 local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
5991 }
5992 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
5993 let local_var_key = local_var_apikey.key.clone();
5994 let local_var_value = match local_var_apikey.prefix {
5995 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
5996 None => local_var_key,
5997 };
5998 local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
5999 }
6000 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
6001 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
6002 }
6003 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
6004 let local_var_key = local_var_apikey.key.clone();
6005 let local_var_value = match local_var_apikey.prefix {
6006 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
6007 None => local_var_key,
6008 };
6009 local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
6010 };
6011 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
6012 let local_var_key = local_var_apikey.key.clone();
6013 let local_var_value = match local_var_apikey.prefix {
6014 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
6015 None => local_var_key,
6016 };
6017 local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
6018 };
6019 if let Some(ref local_var_apikey) = local_var_configuration.api_key {
6020 let local_var_key = local_var_apikey.key.clone();
6021 let local_var_value = match local_var_apikey.prefix {
6022 Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
6023 None => local_var_key,
6024 };
6025 local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
6026 };
6027 if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
6028 local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
6029 };
6030
6031 let local_var_req = local_var_req_builder.build()?;
6032 let local_var_resp = local_var_client.execute(local_var_req).await?;
6033
6034 let local_var_status = local_var_resp.status();
6035 let local_var_content = local_var_resp.text().await?;
6036
6037 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
6038 Ok(())
6039 } else {
6040 let local_var_entity: Option<UnpinIssueError> = serde_json::from_str(&local_var_content).ok();
6041 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
6042 Err(Error::ResponseError(local_var_error))
6043 }
6044}
6045