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