roctogen/endpoints/
reactions.rs

1//! Method, error and parameter types for the Reactions endpoint.
2#![allow(
3    clippy::all
4)]
5/* 
6 * GitHub v3 REST API
7 *
8 * GitHub's v3 REST API.
9 *
10 * OpenAPI spec version: 1.1.4
11 * 
12 * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 */
14
15use serde::Deserialize;
16
17use roctokit::adapters::{AdapterError, Client, GitHubRequest, GitHubResponseExt};
18use crate::models::*;
19
20use super::PerPage;
21
22use std::collections::HashMap;
23use serde_json::value::Value;
24
25pub struct Reactions<'api, C: Client> where AdapterError: From<<C as Client>::Err> {
26    client: &'api C
27}
28
29pub fn new<C: Client>(client: &C) -> Reactions<C> where AdapterError: From<<C as Client>::Err> {
30    Reactions { client }
31}
32
33/// Errors for the [Create reaction for a commit comment](Reactions::create_for_commit_comment_async()) endpoint.
34#[derive(Debug, thiserror::Error)]
35pub enum ReactionsCreateForCommitCommentError {
36    #[error("Reaction created")]
37    Status201(Reaction),
38    #[error("Validation failed, or the endpoint has been spammed.")]
39    Status422(ValidationError),
40    #[error("Status code: {}", code)]
41    Generic { code: u16 },
42}
43
44impl From<ReactionsCreateForCommitCommentError> for AdapterError {
45    fn from(err: ReactionsCreateForCommitCommentError) -> Self {
46        let (description, status_code) = match err {
47            ReactionsCreateForCommitCommentError::Status201(_) => (String::from("Reaction created"), 201),
48            ReactionsCreateForCommitCommentError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
49            ReactionsCreateForCommitCommentError::Generic { code } => (String::from("Generic"), code)
50        };
51
52        Self::Endpoint {
53            description,
54            status_code,
55            source: Some(Box::new(err))
56        }
57    }
58}
59
60/// Errors for the [Create reaction for an issue](Reactions::create_for_issue_async()) endpoint.
61#[derive(Debug, thiserror::Error)]
62pub enum ReactionsCreateForIssueError {
63    #[error("Response")]
64    Status201(Reaction),
65    #[error("Validation failed, or the endpoint has been spammed.")]
66    Status422(ValidationError),
67    #[error("Status code: {}", code)]
68    Generic { code: u16 },
69}
70
71impl From<ReactionsCreateForIssueError> for AdapterError {
72    fn from(err: ReactionsCreateForIssueError) -> Self {
73        let (description, status_code) = match err {
74            ReactionsCreateForIssueError::Status201(_) => (String::from("Response"), 201),
75            ReactionsCreateForIssueError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
76            ReactionsCreateForIssueError::Generic { code } => (String::from("Generic"), code)
77        };
78
79        Self::Endpoint {
80            description,
81            status_code,
82            source: Some(Box::new(err))
83        }
84    }
85}
86
87/// Errors for the [Create reaction for an issue comment](Reactions::create_for_issue_comment_async()) endpoint.
88#[derive(Debug, thiserror::Error)]
89pub enum ReactionsCreateForIssueCommentError {
90    #[error("Reaction created")]
91    Status201(Reaction),
92    #[error("Validation failed, or the endpoint has been spammed.")]
93    Status422(ValidationError),
94    #[error("Status code: {}", code)]
95    Generic { code: u16 },
96}
97
98impl From<ReactionsCreateForIssueCommentError> for AdapterError {
99    fn from(err: ReactionsCreateForIssueCommentError) -> Self {
100        let (description, status_code) = match err {
101            ReactionsCreateForIssueCommentError::Status201(_) => (String::from("Reaction created"), 201),
102            ReactionsCreateForIssueCommentError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
103            ReactionsCreateForIssueCommentError::Generic { code } => (String::from("Generic"), code)
104        };
105
106        Self::Endpoint {
107            description,
108            status_code,
109            source: Some(Box::new(err))
110        }
111    }
112}
113
114/// Errors for the [Create reaction for a pull request review comment](Reactions::create_for_pull_request_review_comment_async()) endpoint.
115#[derive(Debug, thiserror::Error)]
116pub enum ReactionsCreateForPullRequestReviewCommentError {
117    #[error("Reaction created")]
118    Status201(Reaction),
119    #[error("Validation failed, or the endpoint has been spammed.")]
120    Status422(ValidationError),
121    #[error("Status code: {}", code)]
122    Generic { code: u16 },
123}
124
125impl From<ReactionsCreateForPullRequestReviewCommentError> for AdapterError {
126    fn from(err: ReactionsCreateForPullRequestReviewCommentError) -> Self {
127        let (description, status_code) = match err {
128            ReactionsCreateForPullRequestReviewCommentError::Status201(_) => (String::from("Reaction created"), 201),
129            ReactionsCreateForPullRequestReviewCommentError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
130            ReactionsCreateForPullRequestReviewCommentError::Generic { code } => (String::from("Generic"), code)
131        };
132
133        Self::Endpoint {
134            description,
135            status_code,
136            source: Some(Box::new(err))
137        }
138    }
139}
140
141/// Errors for the [Create reaction for a release](Reactions::create_for_release_async()) endpoint.
142#[derive(Debug, thiserror::Error)]
143pub enum ReactionsCreateForReleaseError {
144    #[error("Reaction created")]
145    Status201(Reaction),
146    #[error("Validation failed, or the endpoint has been spammed.")]
147    Status422(ValidationError),
148    #[error("Status code: {}", code)]
149    Generic { code: u16 },
150}
151
152impl From<ReactionsCreateForReleaseError> for AdapterError {
153    fn from(err: ReactionsCreateForReleaseError) -> Self {
154        let (description, status_code) = match err {
155            ReactionsCreateForReleaseError::Status201(_) => (String::from("Reaction created"), 201),
156            ReactionsCreateForReleaseError::Status422(_) => (String::from("Validation failed, or the endpoint has been spammed."), 422),
157            ReactionsCreateForReleaseError::Generic { code } => (String::from("Generic"), code)
158        };
159
160        Self::Endpoint {
161            description,
162            status_code,
163            source: Some(Box::new(err))
164        }
165    }
166}
167
168/// Errors for the [Create reaction for a team discussion comment](Reactions::create_for_team_discussion_comment_in_org_async()) endpoint.
169#[derive(Debug, thiserror::Error)]
170pub enum ReactionsCreateForTeamDiscussionCommentInOrgError {
171    #[error("Response")]
172    Status201(Reaction),
173    #[error("Status code: {}", code)]
174    Generic { code: u16 },
175}
176
177impl From<ReactionsCreateForTeamDiscussionCommentInOrgError> for AdapterError {
178    fn from(err: ReactionsCreateForTeamDiscussionCommentInOrgError) -> Self {
179        let (description, status_code) = match err {
180            ReactionsCreateForTeamDiscussionCommentInOrgError::Status201(_) => (String::from("Response"), 201),
181            ReactionsCreateForTeamDiscussionCommentInOrgError::Generic { code } => (String::from("Generic"), code)
182        };
183
184        Self::Endpoint {
185            description,
186            status_code,
187            source: Some(Box::new(err))
188        }
189    }
190}
191
192/// Errors for the [Create reaction for a team discussion comment (Legacy)](Reactions::create_for_team_discussion_comment_legacy_async()) endpoint.
193#[derive(Debug, thiserror::Error)]
194pub enum ReactionsCreateForTeamDiscussionCommentLegacyError {
195    #[error("Status code: {}", code)]
196    Generic { code: u16 },
197}
198
199impl From<ReactionsCreateForTeamDiscussionCommentLegacyError> for AdapterError {
200    fn from(err: ReactionsCreateForTeamDiscussionCommentLegacyError) -> Self {
201        let (description, status_code) = match err {
202            ReactionsCreateForTeamDiscussionCommentLegacyError::Generic { code } => (String::from("Generic"), code)
203        };
204
205        Self::Endpoint {
206            description,
207            status_code,
208            source: Some(Box::new(err))
209        }
210    }
211}
212
213/// Errors for the [Create reaction for a team discussion](Reactions::create_for_team_discussion_in_org_async()) endpoint.
214#[derive(Debug, thiserror::Error)]
215pub enum ReactionsCreateForTeamDiscussionInOrgError {
216    #[error("Response")]
217    Status201(Reaction),
218    #[error("Status code: {}", code)]
219    Generic { code: u16 },
220}
221
222impl From<ReactionsCreateForTeamDiscussionInOrgError> for AdapterError {
223    fn from(err: ReactionsCreateForTeamDiscussionInOrgError) -> Self {
224        let (description, status_code) = match err {
225            ReactionsCreateForTeamDiscussionInOrgError::Status201(_) => (String::from("Response"), 201),
226            ReactionsCreateForTeamDiscussionInOrgError::Generic { code } => (String::from("Generic"), code)
227        };
228
229        Self::Endpoint {
230            description,
231            status_code,
232            source: Some(Box::new(err))
233        }
234    }
235}
236
237/// Errors for the [Create reaction for a team discussion (Legacy)](Reactions::create_for_team_discussion_legacy_async()) endpoint.
238#[derive(Debug, thiserror::Error)]
239pub enum ReactionsCreateForTeamDiscussionLegacyError {
240    #[error("Status code: {}", code)]
241    Generic { code: u16 },
242}
243
244impl From<ReactionsCreateForTeamDiscussionLegacyError> for AdapterError {
245    fn from(err: ReactionsCreateForTeamDiscussionLegacyError) -> Self {
246        let (description, status_code) = match err {
247            ReactionsCreateForTeamDiscussionLegacyError::Generic { code } => (String::from("Generic"), code)
248        };
249
250        Self::Endpoint {
251            description,
252            status_code,
253            source: Some(Box::new(err))
254        }
255    }
256}
257
258/// Errors for the [Delete a commit comment reaction](Reactions::delete_for_commit_comment_async()) endpoint.
259#[derive(Debug, thiserror::Error)]
260pub enum ReactionsDeleteForCommitCommentError {
261    #[error("Status code: {}", code)]
262    Generic { code: u16 },
263}
264
265impl From<ReactionsDeleteForCommitCommentError> for AdapterError {
266    fn from(err: ReactionsDeleteForCommitCommentError) -> Self {
267        let (description, status_code) = match err {
268            ReactionsDeleteForCommitCommentError::Generic { code } => (String::from("Generic"), code)
269        };
270
271        Self::Endpoint {
272            description,
273            status_code,
274            source: Some(Box::new(err))
275        }
276    }
277}
278
279/// Errors for the [Delete an issue reaction](Reactions::delete_for_issue_async()) endpoint.
280#[derive(Debug, thiserror::Error)]
281pub enum ReactionsDeleteForIssueError {
282    #[error("Status code: {}", code)]
283    Generic { code: u16 },
284}
285
286impl From<ReactionsDeleteForIssueError> for AdapterError {
287    fn from(err: ReactionsDeleteForIssueError) -> Self {
288        let (description, status_code) = match err {
289            ReactionsDeleteForIssueError::Generic { code } => (String::from("Generic"), code)
290        };
291
292        Self::Endpoint {
293            description,
294            status_code,
295            source: Some(Box::new(err))
296        }
297    }
298}
299
300/// Errors for the [Delete an issue comment reaction](Reactions::delete_for_issue_comment_async()) endpoint.
301#[derive(Debug, thiserror::Error)]
302pub enum ReactionsDeleteForIssueCommentError {
303    #[error("Status code: {}", code)]
304    Generic { code: u16 },
305}
306
307impl From<ReactionsDeleteForIssueCommentError> for AdapterError {
308    fn from(err: ReactionsDeleteForIssueCommentError) -> Self {
309        let (description, status_code) = match err {
310            ReactionsDeleteForIssueCommentError::Generic { code } => (String::from("Generic"), code)
311        };
312
313        Self::Endpoint {
314            description,
315            status_code,
316            source: Some(Box::new(err))
317        }
318    }
319}
320
321/// Errors for the [Delete a pull request comment reaction](Reactions::delete_for_pull_request_comment_async()) endpoint.
322#[derive(Debug, thiserror::Error)]
323pub enum ReactionsDeleteForPullRequestCommentError {
324    #[error("Status code: {}", code)]
325    Generic { code: u16 },
326}
327
328impl From<ReactionsDeleteForPullRequestCommentError> for AdapterError {
329    fn from(err: ReactionsDeleteForPullRequestCommentError) -> Self {
330        let (description, status_code) = match err {
331            ReactionsDeleteForPullRequestCommentError::Generic { code } => (String::from("Generic"), code)
332        };
333
334        Self::Endpoint {
335            description,
336            status_code,
337            source: Some(Box::new(err))
338        }
339    }
340}
341
342/// Errors for the [Delete a release reaction](Reactions::delete_for_release_async()) endpoint.
343#[derive(Debug, thiserror::Error)]
344pub enum ReactionsDeleteForReleaseError {
345    #[error("Status code: {}", code)]
346    Generic { code: u16 },
347}
348
349impl From<ReactionsDeleteForReleaseError> for AdapterError {
350    fn from(err: ReactionsDeleteForReleaseError) -> Self {
351        let (description, status_code) = match err {
352            ReactionsDeleteForReleaseError::Generic { code } => (String::from("Generic"), code)
353        };
354
355        Self::Endpoint {
356            description,
357            status_code,
358            source: Some(Box::new(err))
359        }
360    }
361}
362
363/// Errors for the [Delete team discussion reaction](Reactions::delete_for_team_discussion_async()) endpoint.
364#[derive(Debug, thiserror::Error)]
365pub enum ReactionsDeleteForTeamDiscussionError {
366    #[error("Status code: {}", code)]
367    Generic { code: u16 },
368}
369
370impl From<ReactionsDeleteForTeamDiscussionError> for AdapterError {
371    fn from(err: ReactionsDeleteForTeamDiscussionError) -> Self {
372        let (description, status_code) = match err {
373            ReactionsDeleteForTeamDiscussionError::Generic { code } => (String::from("Generic"), code)
374        };
375
376        Self::Endpoint {
377            description,
378            status_code,
379            source: Some(Box::new(err))
380        }
381    }
382}
383
384/// Errors for the [Delete team discussion comment reaction](Reactions::delete_for_team_discussion_comment_async()) endpoint.
385#[derive(Debug, thiserror::Error)]
386pub enum ReactionsDeleteForTeamDiscussionCommentError {
387    #[error("Status code: {}", code)]
388    Generic { code: u16 },
389}
390
391impl From<ReactionsDeleteForTeamDiscussionCommentError> for AdapterError {
392    fn from(err: ReactionsDeleteForTeamDiscussionCommentError) -> Self {
393        let (description, status_code) = match err {
394            ReactionsDeleteForTeamDiscussionCommentError::Generic { code } => (String::from("Generic"), code)
395        };
396
397        Self::Endpoint {
398            description,
399            status_code,
400            source: Some(Box::new(err))
401        }
402    }
403}
404
405/// Errors for the [List reactions for a commit comment](Reactions::list_for_commit_comment_async()) endpoint.
406#[derive(Debug, thiserror::Error)]
407pub enum ReactionsListForCommitCommentError {
408    #[error("Resource not found")]
409    Status404(BasicError),
410    #[error("Status code: {}", code)]
411    Generic { code: u16 },
412}
413
414impl From<ReactionsListForCommitCommentError> for AdapterError {
415    fn from(err: ReactionsListForCommitCommentError) -> Self {
416        let (description, status_code) = match err {
417            ReactionsListForCommitCommentError::Status404(_) => (String::from("Resource not found"), 404),
418            ReactionsListForCommitCommentError::Generic { code } => (String::from("Generic"), code)
419        };
420
421        Self::Endpoint {
422            description,
423            status_code,
424            source: Some(Box::new(err))
425        }
426    }
427}
428
429/// Errors for the [List reactions for an issue](Reactions::list_for_issue_async()) endpoint.
430#[derive(Debug, thiserror::Error)]
431pub enum ReactionsListForIssueError {
432    #[error("Resource not found")]
433    Status404(BasicError),
434    #[error("Gone")]
435    Status410(BasicError),
436    #[error("Status code: {}", code)]
437    Generic { code: u16 },
438}
439
440impl From<ReactionsListForIssueError> for AdapterError {
441    fn from(err: ReactionsListForIssueError) -> Self {
442        let (description, status_code) = match err {
443            ReactionsListForIssueError::Status404(_) => (String::from("Resource not found"), 404),
444            ReactionsListForIssueError::Status410(_) => (String::from("Gone"), 410),
445            ReactionsListForIssueError::Generic { code } => (String::from("Generic"), code)
446        };
447
448        Self::Endpoint {
449            description,
450            status_code,
451            source: Some(Box::new(err))
452        }
453    }
454}
455
456/// Errors for the [List reactions for an issue comment](Reactions::list_for_issue_comment_async()) endpoint.
457#[derive(Debug, thiserror::Error)]
458pub enum ReactionsListForIssueCommentError {
459    #[error("Resource not found")]
460    Status404(BasicError),
461    #[error("Status code: {}", code)]
462    Generic { code: u16 },
463}
464
465impl From<ReactionsListForIssueCommentError> for AdapterError {
466    fn from(err: ReactionsListForIssueCommentError) -> Self {
467        let (description, status_code) = match err {
468            ReactionsListForIssueCommentError::Status404(_) => (String::from("Resource not found"), 404),
469            ReactionsListForIssueCommentError::Generic { code } => (String::from("Generic"), code)
470        };
471
472        Self::Endpoint {
473            description,
474            status_code,
475            source: Some(Box::new(err))
476        }
477    }
478}
479
480/// Errors for the [List reactions for a pull request review comment](Reactions::list_for_pull_request_review_comment_async()) endpoint.
481#[derive(Debug, thiserror::Error)]
482pub enum ReactionsListForPullRequestReviewCommentError {
483    #[error("Resource not found")]
484    Status404(BasicError),
485    #[error("Status code: {}", code)]
486    Generic { code: u16 },
487}
488
489impl From<ReactionsListForPullRequestReviewCommentError> for AdapterError {
490    fn from(err: ReactionsListForPullRequestReviewCommentError) -> Self {
491        let (description, status_code) = match err {
492            ReactionsListForPullRequestReviewCommentError::Status404(_) => (String::from("Resource not found"), 404),
493            ReactionsListForPullRequestReviewCommentError::Generic { code } => (String::from("Generic"), code)
494        };
495
496        Self::Endpoint {
497            description,
498            status_code,
499            source: Some(Box::new(err))
500        }
501    }
502}
503
504/// Errors for the [List reactions for a release](Reactions::list_for_release_async()) endpoint.
505#[derive(Debug, thiserror::Error)]
506pub enum ReactionsListForReleaseError {
507    #[error("Resource not found")]
508    Status404(BasicError),
509    #[error("Status code: {}", code)]
510    Generic { code: u16 },
511}
512
513impl From<ReactionsListForReleaseError> for AdapterError {
514    fn from(err: ReactionsListForReleaseError) -> Self {
515        let (description, status_code) = match err {
516            ReactionsListForReleaseError::Status404(_) => (String::from("Resource not found"), 404),
517            ReactionsListForReleaseError::Generic { code } => (String::from("Generic"), code)
518        };
519
520        Self::Endpoint {
521            description,
522            status_code,
523            source: Some(Box::new(err))
524        }
525    }
526}
527
528/// Errors for the [List reactions for a team discussion comment](Reactions::list_for_team_discussion_comment_in_org_async()) endpoint.
529#[derive(Debug, thiserror::Error)]
530pub enum ReactionsListForTeamDiscussionCommentInOrgError {
531    #[error("Status code: {}", code)]
532    Generic { code: u16 },
533}
534
535impl From<ReactionsListForTeamDiscussionCommentInOrgError> for AdapterError {
536    fn from(err: ReactionsListForTeamDiscussionCommentInOrgError) -> Self {
537        let (description, status_code) = match err {
538            ReactionsListForTeamDiscussionCommentInOrgError::Generic { code } => (String::from("Generic"), code)
539        };
540
541        Self::Endpoint {
542            description,
543            status_code,
544            source: Some(Box::new(err))
545        }
546    }
547}
548
549/// Errors for the [List reactions for a team discussion comment (Legacy)](Reactions::list_for_team_discussion_comment_legacy_async()) endpoint.
550#[derive(Debug, thiserror::Error)]
551pub enum ReactionsListForTeamDiscussionCommentLegacyError {
552    #[error("Status code: {}", code)]
553    Generic { code: u16 },
554}
555
556impl From<ReactionsListForTeamDiscussionCommentLegacyError> for AdapterError {
557    fn from(err: ReactionsListForTeamDiscussionCommentLegacyError) -> Self {
558        let (description, status_code) = match err {
559            ReactionsListForTeamDiscussionCommentLegacyError::Generic { code } => (String::from("Generic"), code)
560        };
561
562        Self::Endpoint {
563            description,
564            status_code,
565            source: Some(Box::new(err))
566        }
567    }
568}
569
570/// Errors for the [List reactions for a team discussion](Reactions::list_for_team_discussion_in_org_async()) endpoint.
571#[derive(Debug, thiserror::Error)]
572pub enum ReactionsListForTeamDiscussionInOrgError {
573    #[error("Status code: {}", code)]
574    Generic { code: u16 },
575}
576
577impl From<ReactionsListForTeamDiscussionInOrgError> for AdapterError {
578    fn from(err: ReactionsListForTeamDiscussionInOrgError) -> Self {
579        let (description, status_code) = match err {
580            ReactionsListForTeamDiscussionInOrgError::Generic { code } => (String::from("Generic"), code)
581        };
582
583        Self::Endpoint {
584            description,
585            status_code,
586            source: Some(Box::new(err))
587        }
588    }
589}
590
591/// Errors for the [List reactions for a team discussion (Legacy)](Reactions::list_for_team_discussion_legacy_async()) endpoint.
592#[derive(Debug, thiserror::Error)]
593pub enum ReactionsListForTeamDiscussionLegacyError {
594    #[error("Status code: {}", code)]
595    Generic { code: u16 },
596}
597
598impl From<ReactionsListForTeamDiscussionLegacyError> for AdapterError {
599    fn from(err: ReactionsListForTeamDiscussionLegacyError) -> Self {
600        let (description, status_code) = match err {
601            ReactionsListForTeamDiscussionLegacyError::Generic { code } => (String::from("Generic"), code)
602        };
603
604        Self::Endpoint {
605            description,
606            status_code,
607            source: Some(Box::new(err))
608        }
609    }
610}
611
612
613/// Query parameters for the [List reactions for a commit comment](Reactions::list_for_commit_comment_async()) endpoint.
614#[derive(Default, Serialize)]
615pub struct ReactionsListForCommitCommentParams<'req> {
616    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment.
617    content: Option<&'req str>, 
618    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
619    per_page: Option<u16>, 
620    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
621    page: Option<u16>
622}
623
624impl<'req> ReactionsListForCommitCommentParams<'req> {
625    pub fn new() -> Self {
626        Self::default()
627    }
628
629    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment.
630    pub fn content(self, content: &'req str) -> Self {
631        Self {
632            content: Some(content),
633            per_page: self.per_page, 
634            page: self.page, 
635        }
636    }
637
638    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
639    pub fn per_page(self, per_page: u16) -> Self {
640        Self {
641            content: self.content, 
642            per_page: Some(per_page),
643            page: self.page, 
644        }
645    }
646
647    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
648    pub fn page(self, page: u16) -> Self {
649        Self {
650            content: self.content, 
651            per_page: self.per_page, 
652            page: Some(page),
653        }
654    }
655}
656
657impl<'enc> From<&'enc PerPage> for ReactionsListForCommitCommentParams<'enc> {
658    fn from(per_page: &'enc PerPage) -> Self {
659        Self {
660            per_page: Some(per_page.per_page),
661            page: Some(per_page.page),
662            ..Default::default()
663        }
664    }
665}
666/// Query parameters for the [List reactions for an issue](Reactions::list_for_issue_async()) endpoint.
667#[derive(Default, Serialize)]
668pub struct ReactionsListForIssueParams<'req> {
669    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue.
670    content: Option<&'req str>, 
671    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
672    per_page: Option<u16>, 
673    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
674    page: Option<u16>
675}
676
677impl<'req> ReactionsListForIssueParams<'req> {
678    pub fn new() -> Self {
679        Self::default()
680    }
681
682    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue.
683    pub fn content(self, content: &'req str) -> Self {
684        Self {
685            content: Some(content),
686            per_page: self.per_page, 
687            page: self.page, 
688        }
689    }
690
691    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
692    pub fn per_page(self, per_page: u16) -> Self {
693        Self {
694            content: self.content, 
695            per_page: Some(per_page),
696            page: self.page, 
697        }
698    }
699
700    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
701    pub fn page(self, page: u16) -> Self {
702        Self {
703            content: self.content, 
704            per_page: self.per_page, 
705            page: Some(page),
706        }
707    }
708}
709
710impl<'enc> From<&'enc PerPage> for ReactionsListForIssueParams<'enc> {
711    fn from(per_page: &'enc PerPage) -> Self {
712        Self {
713            per_page: Some(per_page.per_page),
714            page: Some(per_page.page),
715            ..Default::default()
716        }
717    }
718}
719/// Query parameters for the [List reactions for an issue comment](Reactions::list_for_issue_comment_async()) endpoint.
720#[derive(Default, Serialize)]
721pub struct ReactionsListForIssueCommentParams<'req> {
722    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment.
723    content: Option<&'req str>, 
724    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
725    per_page: Option<u16>, 
726    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
727    page: Option<u16>
728}
729
730impl<'req> ReactionsListForIssueCommentParams<'req> {
731    pub fn new() -> Self {
732        Self::default()
733    }
734
735    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment.
736    pub fn content(self, content: &'req str) -> Self {
737        Self {
738            content: Some(content),
739            per_page: self.per_page, 
740            page: self.page, 
741        }
742    }
743
744    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
745    pub fn per_page(self, per_page: u16) -> Self {
746        Self {
747            content: self.content, 
748            per_page: Some(per_page),
749            page: self.page, 
750        }
751    }
752
753    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
754    pub fn page(self, page: u16) -> Self {
755        Self {
756            content: self.content, 
757            per_page: self.per_page, 
758            page: Some(page),
759        }
760    }
761}
762
763impl<'enc> From<&'enc PerPage> for ReactionsListForIssueCommentParams<'enc> {
764    fn from(per_page: &'enc PerPage) -> Self {
765        Self {
766            per_page: Some(per_page.per_page),
767            page: Some(per_page.page),
768            ..Default::default()
769        }
770    }
771}
772/// Query parameters for the [List reactions for a pull request review comment](Reactions::list_for_pull_request_review_comment_async()) endpoint.
773#[derive(Default, Serialize)]
774pub struct ReactionsListForPullRequestReviewCommentParams<'req> {
775    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment.
776    content: Option<&'req str>, 
777    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
778    per_page: Option<u16>, 
779    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
780    page: Option<u16>
781}
782
783impl<'req> ReactionsListForPullRequestReviewCommentParams<'req> {
784    pub fn new() -> Self {
785        Self::default()
786    }
787
788    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment.
789    pub fn content(self, content: &'req str) -> Self {
790        Self {
791            content: Some(content),
792            per_page: self.per_page, 
793            page: self.page, 
794        }
795    }
796
797    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
798    pub fn per_page(self, per_page: u16) -> Self {
799        Self {
800            content: self.content, 
801            per_page: Some(per_page),
802            page: self.page, 
803        }
804    }
805
806    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
807    pub fn page(self, page: u16) -> Self {
808        Self {
809            content: self.content, 
810            per_page: self.per_page, 
811            page: Some(page),
812        }
813    }
814}
815
816impl<'enc> From<&'enc PerPage> for ReactionsListForPullRequestReviewCommentParams<'enc> {
817    fn from(per_page: &'enc PerPage) -> Self {
818        Self {
819            per_page: Some(per_page.per_page),
820            page: Some(per_page.page),
821            ..Default::default()
822        }
823    }
824}
825/// Query parameters for the [List reactions for a release](Reactions::list_for_release_async()) endpoint.
826#[derive(Default, Serialize)]
827pub struct ReactionsListForReleaseParams<'req> {
828    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release.
829    content: Option<&'req str>, 
830    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
831    per_page: Option<u16>, 
832    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
833    page: Option<u16>
834}
835
836impl<'req> ReactionsListForReleaseParams<'req> {
837    pub fn new() -> Self {
838        Self::default()
839    }
840
841    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release.
842    pub fn content(self, content: &'req str) -> Self {
843        Self {
844            content: Some(content),
845            per_page: self.per_page, 
846            page: self.page, 
847        }
848    }
849
850    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
851    pub fn per_page(self, per_page: u16) -> Self {
852        Self {
853            content: self.content, 
854            per_page: Some(per_page),
855            page: self.page, 
856        }
857    }
858
859    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
860    pub fn page(self, page: u16) -> Self {
861        Self {
862            content: self.content, 
863            per_page: self.per_page, 
864            page: Some(page),
865        }
866    }
867}
868
869impl<'enc> From<&'enc PerPage> for ReactionsListForReleaseParams<'enc> {
870    fn from(per_page: &'enc PerPage) -> Self {
871        Self {
872            per_page: Some(per_page.per_page),
873            page: Some(per_page.page),
874            ..Default::default()
875        }
876    }
877}
878/// Query parameters for the [List reactions for a team discussion comment](Reactions::list_for_team_discussion_comment_in_org_async()) endpoint.
879#[derive(Default, Serialize)]
880pub struct ReactionsListForTeamDiscussionCommentInOrgParams<'req> {
881    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment.
882    content: Option<&'req str>, 
883    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
884    per_page: Option<u16>, 
885    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
886    page: Option<u16>
887}
888
889impl<'req> ReactionsListForTeamDiscussionCommentInOrgParams<'req> {
890    pub fn new() -> Self {
891        Self::default()
892    }
893
894    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment.
895    pub fn content(self, content: &'req str) -> Self {
896        Self {
897            content: Some(content),
898            per_page: self.per_page, 
899            page: self.page, 
900        }
901    }
902
903    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
904    pub fn per_page(self, per_page: u16) -> Self {
905        Self {
906            content: self.content, 
907            per_page: Some(per_page),
908            page: self.page, 
909        }
910    }
911
912    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
913    pub fn page(self, page: u16) -> Self {
914        Self {
915            content: self.content, 
916            per_page: self.per_page, 
917            page: Some(page),
918        }
919    }
920}
921
922impl<'enc> From<&'enc PerPage> for ReactionsListForTeamDiscussionCommentInOrgParams<'enc> {
923    fn from(per_page: &'enc PerPage) -> Self {
924        Self {
925            per_page: Some(per_page.per_page),
926            page: Some(per_page.page),
927            ..Default::default()
928        }
929    }
930}
931/// Query parameters for the [List reactions for a team discussion comment (Legacy)](Reactions::list_for_team_discussion_comment_legacy_async()) endpoint.
932#[derive(Default, Serialize)]
933pub struct ReactionsListForTeamDiscussionCommentLegacyParams<'req> {
934    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment.
935    content: Option<&'req str>, 
936    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
937    per_page: Option<u16>, 
938    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
939    page: Option<u16>
940}
941
942impl<'req> ReactionsListForTeamDiscussionCommentLegacyParams<'req> {
943    pub fn new() -> Self {
944        Self::default()
945    }
946
947    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment.
948    pub fn content(self, content: &'req str) -> Self {
949        Self {
950            content: Some(content),
951            per_page: self.per_page, 
952            page: self.page, 
953        }
954    }
955
956    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
957    pub fn per_page(self, per_page: u16) -> Self {
958        Self {
959            content: self.content, 
960            per_page: Some(per_page),
961            page: self.page, 
962        }
963    }
964
965    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
966    pub fn page(self, page: u16) -> Self {
967        Self {
968            content: self.content, 
969            per_page: self.per_page, 
970            page: Some(page),
971        }
972    }
973}
974
975impl<'enc> From<&'enc PerPage> for ReactionsListForTeamDiscussionCommentLegacyParams<'enc> {
976    fn from(per_page: &'enc PerPage) -> Self {
977        Self {
978            per_page: Some(per_page.per_page),
979            page: Some(per_page.page),
980            ..Default::default()
981        }
982    }
983}
984/// Query parameters for the [List reactions for a team discussion](Reactions::list_for_team_discussion_in_org_async()) endpoint.
985#[derive(Default, Serialize)]
986pub struct ReactionsListForTeamDiscussionInOrgParams<'req> {
987    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion.
988    content: Option<&'req str>, 
989    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
990    per_page: Option<u16>, 
991    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
992    page: Option<u16>
993}
994
995impl<'req> ReactionsListForTeamDiscussionInOrgParams<'req> {
996    pub fn new() -> Self {
997        Self::default()
998    }
999
1000    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion.
1001    pub fn content(self, content: &'req str) -> Self {
1002        Self {
1003            content: Some(content),
1004            per_page: self.per_page, 
1005            page: self.page, 
1006        }
1007    }
1008
1009    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1010    pub fn per_page(self, per_page: u16) -> Self {
1011        Self {
1012            content: self.content, 
1013            per_page: Some(per_page),
1014            page: self.page, 
1015        }
1016    }
1017
1018    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1019    pub fn page(self, page: u16) -> Self {
1020        Self {
1021            content: self.content, 
1022            per_page: self.per_page, 
1023            page: Some(page),
1024        }
1025    }
1026}
1027
1028impl<'enc> From<&'enc PerPage> for ReactionsListForTeamDiscussionInOrgParams<'enc> {
1029    fn from(per_page: &'enc PerPage) -> Self {
1030        Self {
1031            per_page: Some(per_page.per_page),
1032            page: Some(per_page.page),
1033            ..Default::default()
1034        }
1035    }
1036}
1037/// Query parameters for the [List reactions for a team discussion (Legacy)](Reactions::list_for_team_discussion_legacy_async()) endpoint.
1038#[derive(Default, Serialize)]
1039pub struct ReactionsListForTeamDiscussionLegacyParams<'req> {
1040    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion.
1041    content: Option<&'req str>, 
1042    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1043    per_page: Option<u16>, 
1044    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1045    page: Option<u16>
1046}
1047
1048impl<'req> ReactionsListForTeamDiscussionLegacyParams<'req> {
1049    pub fn new() -> Self {
1050        Self::default()
1051    }
1052
1053    /// Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion.
1054    pub fn content(self, content: &'req str) -> Self {
1055        Self {
1056            content: Some(content),
1057            per_page: self.per_page, 
1058            page: self.page, 
1059        }
1060    }
1061
1062    /// The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1063    pub fn per_page(self, per_page: u16) -> Self {
1064        Self {
1065            content: self.content, 
1066            per_page: Some(per_page),
1067            page: self.page, 
1068        }
1069    }
1070
1071    /// The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"
1072    pub fn page(self, page: u16) -> Self {
1073        Self {
1074            content: self.content, 
1075            per_page: self.per_page, 
1076            page: Some(page),
1077        }
1078    }
1079}
1080
1081impl<'enc> From<&'enc PerPage> for ReactionsListForTeamDiscussionLegacyParams<'enc> {
1082    fn from(per_page: &'enc PerPage) -> Self {
1083        Self {
1084            per_page: Some(per_page.per_page),
1085            page: Some(per_page.page),
1086            ..Default::default()
1087        }
1088    }
1089}
1090
1091impl<'api, C: Client> Reactions<'api, C> where AdapterError: From<<C as Client>::Err> {
1092    /// ---
1093    ///
1094    /// # Create reaction for a commit comment
1095    ///
1096    /// Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment.
1097    ///
1098    /// [GitHub API docs for create_for_commit_comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment)
1099    ///
1100    /// ---
1101    pub async fn create_for_commit_comment_async(&self, owner: &str, repo: &str, comment_id: i64, body: PostReactionsCreateForCommitComment) -> Result<Reaction, AdapterError> {
1102
1103        let request_uri = format!("{}/repos/{}/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
1104
1105
1106        let req = GitHubRequest {
1107            uri: request_uri,
1108            body: Some(C::from_json::<PostReactionsCreateForCommitComment>(body)?),
1109            method: "POST",
1110            headers: vec![]
1111        };
1112
1113        let request = self.client.build(req)?;
1114
1115        // --
1116
1117        let github_response = self.client.fetch_async(request).await?;
1118
1119        // --
1120
1121        if github_response.is_success() {
1122            Ok(github_response.to_json_async().await?)
1123        } else {
1124            match github_response.status_code() {
1125                201 => Err(ReactionsCreateForCommitCommentError::Status201(github_response.to_json_async().await?).into()),
1126                422 => Err(ReactionsCreateForCommitCommentError::Status422(github_response.to_json_async().await?).into()),
1127                code => Err(ReactionsCreateForCommitCommentError::Generic { code }.into()),
1128            }
1129        }
1130    }
1131
1132    /// ---
1133    ///
1134    /// # Create reaction for a commit comment
1135    ///
1136    /// Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment.
1137    ///
1138    /// [GitHub API docs for create_for_commit_comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment)
1139    ///
1140    /// ---
1141    #[cfg(not(target_arch = "wasm32"))]
1142    pub fn create_for_commit_comment(&self, owner: &str, repo: &str, comment_id: i64, body: PostReactionsCreateForCommitComment) -> Result<Reaction, AdapterError> {
1143
1144        let request_uri = format!("{}/repos/{}/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
1145
1146
1147        let req = GitHubRequest {
1148            uri: request_uri,
1149            body: Some(C::from_json::<PostReactionsCreateForCommitComment>(body)?),
1150            method: "POST",
1151            headers: vec![]
1152        };
1153
1154        let request = self.client.build(req)?;
1155
1156        // --
1157
1158        let github_response = self.client.fetch(request)?;
1159
1160        // --
1161
1162        if github_response.is_success() {
1163            Ok(github_response.to_json()?)
1164        } else {
1165            match github_response.status_code() {
1166                201 => Err(ReactionsCreateForCommitCommentError::Status201(github_response.to_json()?).into()),
1167                422 => Err(ReactionsCreateForCommitCommentError::Status422(github_response.to_json()?).into()),
1168                code => Err(ReactionsCreateForCommitCommentError::Generic { code }.into()),
1169            }
1170        }
1171    }
1172
1173    /// ---
1174    ///
1175    /// # Create reaction for an issue
1176    ///
1177    /// Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue.
1178    ///
1179    /// [GitHub API docs for create_for_issue](https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue)
1180    ///
1181    /// ---
1182    pub async fn create_for_issue_async(&self, owner: &str, repo: &str, issue_number: i32, body: PostReactionsCreateForIssue) -> Result<Reaction, AdapterError> {
1183
1184        let request_uri = format!("{}/repos/{}/{}/issues/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, issue_number);
1185
1186
1187        let req = GitHubRequest {
1188            uri: request_uri,
1189            body: Some(C::from_json::<PostReactionsCreateForIssue>(body)?),
1190            method: "POST",
1191            headers: vec![]
1192        };
1193
1194        let request = self.client.build(req)?;
1195
1196        // --
1197
1198        let github_response = self.client.fetch_async(request).await?;
1199
1200        // --
1201
1202        if github_response.is_success() {
1203            Ok(github_response.to_json_async().await?)
1204        } else {
1205            match github_response.status_code() {
1206                201 => Err(ReactionsCreateForIssueError::Status201(github_response.to_json_async().await?).into()),
1207                422 => Err(ReactionsCreateForIssueError::Status422(github_response.to_json_async().await?).into()),
1208                code => Err(ReactionsCreateForIssueError::Generic { code }.into()),
1209            }
1210        }
1211    }
1212
1213    /// ---
1214    ///
1215    /// # Create reaction for an issue
1216    ///
1217    /// Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue.
1218    ///
1219    /// [GitHub API docs for create_for_issue](https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue)
1220    ///
1221    /// ---
1222    #[cfg(not(target_arch = "wasm32"))]
1223    pub fn create_for_issue(&self, owner: &str, repo: &str, issue_number: i32, body: PostReactionsCreateForIssue) -> Result<Reaction, AdapterError> {
1224
1225        let request_uri = format!("{}/repos/{}/{}/issues/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, issue_number);
1226
1227
1228        let req = GitHubRequest {
1229            uri: request_uri,
1230            body: Some(C::from_json::<PostReactionsCreateForIssue>(body)?),
1231            method: "POST",
1232            headers: vec![]
1233        };
1234
1235        let request = self.client.build(req)?;
1236
1237        // --
1238
1239        let github_response = self.client.fetch(request)?;
1240
1241        // --
1242
1243        if github_response.is_success() {
1244            Ok(github_response.to_json()?)
1245        } else {
1246            match github_response.status_code() {
1247                201 => Err(ReactionsCreateForIssueError::Status201(github_response.to_json()?).into()),
1248                422 => Err(ReactionsCreateForIssueError::Status422(github_response.to_json()?).into()),
1249                code => Err(ReactionsCreateForIssueError::Generic { code }.into()),
1250            }
1251        }
1252    }
1253
1254    /// ---
1255    ///
1256    /// # Create reaction for an issue comment
1257    ///
1258    /// Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment.
1259    ///
1260    /// [GitHub API docs for create_for_issue_comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment)
1261    ///
1262    /// ---
1263    pub async fn create_for_issue_comment_async(&self, owner: &str, repo: &str, comment_id: i64, body: PostReactionsCreateForIssueComment) -> Result<Reaction, AdapterError> {
1264
1265        let request_uri = format!("{}/repos/{}/{}/issues/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
1266
1267
1268        let req = GitHubRequest {
1269            uri: request_uri,
1270            body: Some(C::from_json::<PostReactionsCreateForIssueComment>(body)?),
1271            method: "POST",
1272            headers: vec![]
1273        };
1274
1275        let request = self.client.build(req)?;
1276
1277        // --
1278
1279        let github_response = self.client.fetch_async(request).await?;
1280
1281        // --
1282
1283        if github_response.is_success() {
1284            Ok(github_response.to_json_async().await?)
1285        } else {
1286            match github_response.status_code() {
1287                201 => Err(ReactionsCreateForIssueCommentError::Status201(github_response.to_json_async().await?).into()),
1288                422 => Err(ReactionsCreateForIssueCommentError::Status422(github_response.to_json_async().await?).into()),
1289                code => Err(ReactionsCreateForIssueCommentError::Generic { code }.into()),
1290            }
1291        }
1292    }
1293
1294    /// ---
1295    ///
1296    /// # Create reaction for an issue comment
1297    ///
1298    /// Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment.
1299    ///
1300    /// [GitHub API docs for create_for_issue_comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment)
1301    ///
1302    /// ---
1303    #[cfg(not(target_arch = "wasm32"))]
1304    pub fn create_for_issue_comment(&self, owner: &str, repo: &str, comment_id: i64, body: PostReactionsCreateForIssueComment) -> Result<Reaction, AdapterError> {
1305
1306        let request_uri = format!("{}/repos/{}/{}/issues/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
1307
1308
1309        let req = GitHubRequest {
1310            uri: request_uri,
1311            body: Some(C::from_json::<PostReactionsCreateForIssueComment>(body)?),
1312            method: "POST",
1313            headers: vec![]
1314        };
1315
1316        let request = self.client.build(req)?;
1317
1318        // --
1319
1320        let github_response = self.client.fetch(request)?;
1321
1322        // --
1323
1324        if github_response.is_success() {
1325            Ok(github_response.to_json()?)
1326        } else {
1327            match github_response.status_code() {
1328                201 => Err(ReactionsCreateForIssueCommentError::Status201(github_response.to_json()?).into()),
1329                422 => Err(ReactionsCreateForIssueCommentError::Status422(github_response.to_json()?).into()),
1330                code => Err(ReactionsCreateForIssueCommentError::Generic { code }.into()),
1331            }
1332        }
1333    }
1334
1335    /// ---
1336    ///
1337    /// # Create reaction for a pull request review comment
1338    ///
1339    /// Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment.
1340    ///
1341    /// [GitHub API docs for create_for_pull_request_review_comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment)
1342    ///
1343    /// ---
1344    pub async fn create_for_pull_request_review_comment_async(&self, owner: &str, repo: &str, comment_id: i64, body: PostReactionsCreateForPullRequestReviewComment) -> Result<Reaction, AdapterError> {
1345
1346        let request_uri = format!("{}/repos/{}/{}/pulls/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
1347
1348
1349        let req = GitHubRequest {
1350            uri: request_uri,
1351            body: Some(C::from_json::<PostReactionsCreateForPullRequestReviewComment>(body)?),
1352            method: "POST",
1353            headers: vec![]
1354        };
1355
1356        let request = self.client.build(req)?;
1357
1358        // --
1359
1360        let github_response = self.client.fetch_async(request).await?;
1361
1362        // --
1363
1364        if github_response.is_success() {
1365            Ok(github_response.to_json_async().await?)
1366        } else {
1367            match github_response.status_code() {
1368                201 => Err(ReactionsCreateForPullRequestReviewCommentError::Status201(github_response.to_json_async().await?).into()),
1369                422 => Err(ReactionsCreateForPullRequestReviewCommentError::Status422(github_response.to_json_async().await?).into()),
1370                code => Err(ReactionsCreateForPullRequestReviewCommentError::Generic { code }.into()),
1371            }
1372        }
1373    }
1374
1375    /// ---
1376    ///
1377    /// # Create reaction for a pull request review comment
1378    ///
1379    /// Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment.
1380    ///
1381    /// [GitHub API docs for create_for_pull_request_review_comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment)
1382    ///
1383    /// ---
1384    #[cfg(not(target_arch = "wasm32"))]
1385    pub fn create_for_pull_request_review_comment(&self, owner: &str, repo: &str, comment_id: i64, body: PostReactionsCreateForPullRequestReviewComment) -> Result<Reaction, AdapterError> {
1386
1387        let request_uri = format!("{}/repos/{}/{}/pulls/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
1388
1389
1390        let req = GitHubRequest {
1391            uri: request_uri,
1392            body: Some(C::from_json::<PostReactionsCreateForPullRequestReviewComment>(body)?),
1393            method: "POST",
1394            headers: vec![]
1395        };
1396
1397        let request = self.client.build(req)?;
1398
1399        // --
1400
1401        let github_response = self.client.fetch(request)?;
1402
1403        // --
1404
1405        if github_response.is_success() {
1406            Ok(github_response.to_json()?)
1407        } else {
1408            match github_response.status_code() {
1409                201 => Err(ReactionsCreateForPullRequestReviewCommentError::Status201(github_response.to_json()?).into()),
1410                422 => Err(ReactionsCreateForPullRequestReviewCommentError::Status422(github_response.to_json()?).into()),
1411                code => Err(ReactionsCreateForPullRequestReviewCommentError::Generic { code }.into()),
1412            }
1413        }
1414    }
1415
1416    /// ---
1417    ///
1418    /// # Create reaction for a release
1419    ///
1420    /// Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release.
1421    ///
1422    /// [GitHub API docs for create_for_release](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release)
1423    ///
1424    /// ---
1425    pub async fn create_for_release_async(&self, owner: &str, repo: &str, release_id: i32, body: PostReactionsCreateForRelease) -> Result<Reaction, AdapterError> {
1426
1427        let request_uri = format!("{}/repos/{}/{}/releases/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, release_id);
1428
1429
1430        let req = GitHubRequest {
1431            uri: request_uri,
1432            body: Some(C::from_json::<PostReactionsCreateForRelease>(body)?),
1433            method: "POST",
1434            headers: vec![]
1435        };
1436
1437        let request = self.client.build(req)?;
1438
1439        // --
1440
1441        let github_response = self.client.fetch_async(request).await?;
1442
1443        // --
1444
1445        if github_response.is_success() {
1446            Ok(github_response.to_json_async().await?)
1447        } else {
1448            match github_response.status_code() {
1449                201 => Err(ReactionsCreateForReleaseError::Status201(github_response.to_json_async().await?).into()),
1450                422 => Err(ReactionsCreateForReleaseError::Status422(github_response.to_json_async().await?).into()),
1451                code => Err(ReactionsCreateForReleaseError::Generic { code }.into()),
1452            }
1453        }
1454    }
1455
1456    /// ---
1457    ///
1458    /// # Create reaction for a release
1459    ///
1460    /// Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release.
1461    ///
1462    /// [GitHub API docs for create_for_release](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release)
1463    ///
1464    /// ---
1465    #[cfg(not(target_arch = "wasm32"))]
1466    pub fn create_for_release(&self, owner: &str, repo: &str, release_id: i32, body: PostReactionsCreateForRelease) -> Result<Reaction, AdapterError> {
1467
1468        let request_uri = format!("{}/repos/{}/{}/releases/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, release_id);
1469
1470
1471        let req = GitHubRequest {
1472            uri: request_uri,
1473            body: Some(C::from_json::<PostReactionsCreateForRelease>(body)?),
1474            method: "POST",
1475            headers: vec![]
1476        };
1477
1478        let request = self.client.build(req)?;
1479
1480        // --
1481
1482        let github_response = self.client.fetch(request)?;
1483
1484        // --
1485
1486        if github_response.is_success() {
1487            Ok(github_response.to_json()?)
1488        } else {
1489            match github_response.status_code() {
1490                201 => Err(ReactionsCreateForReleaseError::Status201(github_response.to_json()?).into()),
1491                422 => Err(ReactionsCreateForReleaseError::Status422(github_response.to_json()?).into()),
1492                code => Err(ReactionsCreateForReleaseError::Generic { code }.into()),
1493            }
1494        }
1495    }
1496
1497    /// ---
1498    ///
1499    /// # Create reaction for a team discussion comment
1500    ///
1501    /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
1502    /// 
1503    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.
1504    /// 
1505    /// > [!NOTE]
1506    /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.
1507    /// 
1508    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1509    ///
1510    /// [GitHub API docs for create_for_team_discussion_comment_in_org](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)
1511    ///
1512    /// ---
1513    pub async fn create_for_team_discussion_comment_in_org_async(&self, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, body: PostReactionsCreateForTeamDiscussionCommentInOrg) -> Result<Reaction, AdapterError> {
1514
1515        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, comment_number);
1516
1517
1518        let req = GitHubRequest {
1519            uri: request_uri,
1520            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionCommentInOrg>(body)?),
1521            method: "POST",
1522            headers: vec![]
1523        };
1524
1525        let request = self.client.build(req)?;
1526
1527        // --
1528
1529        let github_response = self.client.fetch_async(request).await?;
1530
1531        // --
1532
1533        if github_response.is_success() {
1534            Ok(github_response.to_json_async().await?)
1535        } else {
1536            match github_response.status_code() {
1537                201 => Err(ReactionsCreateForTeamDiscussionCommentInOrgError::Status201(github_response.to_json_async().await?).into()),
1538                code => Err(ReactionsCreateForTeamDiscussionCommentInOrgError::Generic { code }.into()),
1539            }
1540        }
1541    }
1542
1543    /// ---
1544    ///
1545    /// # Create reaction for a team discussion comment
1546    ///
1547    /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
1548    /// 
1549    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.
1550    /// 
1551    /// > [!NOTE]
1552    /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.
1553    /// 
1554    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1555    ///
1556    /// [GitHub API docs for create_for_team_discussion_comment_in_org](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)
1557    ///
1558    /// ---
1559    #[cfg(not(target_arch = "wasm32"))]
1560    pub fn create_for_team_discussion_comment_in_org(&self, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, body: PostReactionsCreateForTeamDiscussionCommentInOrg) -> Result<Reaction, AdapterError> {
1561
1562        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, comment_number);
1563
1564
1565        let req = GitHubRequest {
1566            uri: request_uri,
1567            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionCommentInOrg>(body)?),
1568            method: "POST",
1569            headers: vec![]
1570        };
1571
1572        let request = self.client.build(req)?;
1573
1574        // --
1575
1576        let github_response = self.client.fetch(request)?;
1577
1578        // --
1579
1580        if github_response.is_success() {
1581            Ok(github_response.to_json()?)
1582        } else {
1583            match github_response.status_code() {
1584                201 => Err(ReactionsCreateForTeamDiscussionCommentInOrgError::Status201(github_response.to_json()?).into()),
1585                code => Err(ReactionsCreateForTeamDiscussionCommentInOrgError::Generic { code }.into()),
1586            }
1587        }
1588    }
1589
1590    /// ---
1591    ///
1592    /// # Create reaction for a team discussion comment (Legacy)
1593    ///
1594    /// > [!WARNING]
1595    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.
1596    /// 
1597    /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
1598    /// 
1599    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.
1600    /// 
1601    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1602    ///
1603    /// [GitHub API docs for create_for_team_discussion_comment_legacy](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy)
1604    ///
1605    /// ---
1606    pub async fn create_for_team_discussion_comment_legacy_async(&self, team_id: i32, discussion_number: i32, comment_number: i32, body: PostReactionsCreateForTeamDiscussionCommentLegacy) -> Result<Reaction, AdapterError> {
1607
1608        let request_uri = format!("{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number, comment_number);
1609
1610
1611        let req = GitHubRequest {
1612            uri: request_uri,
1613            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionCommentLegacy>(body)?),
1614            method: "POST",
1615            headers: vec![]
1616        };
1617
1618        let request = self.client.build(req)?;
1619
1620        // --
1621
1622        let github_response = self.client.fetch_async(request).await?;
1623
1624        // --
1625
1626        if github_response.is_success() {
1627            Ok(github_response.to_json_async().await?)
1628        } else {
1629            match github_response.status_code() {
1630                code => Err(ReactionsCreateForTeamDiscussionCommentLegacyError::Generic { code }.into()),
1631            }
1632        }
1633    }
1634
1635    /// ---
1636    ///
1637    /// # Create reaction for a team discussion comment (Legacy)
1638    ///
1639    /// > [!WARNING]
1640    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.
1641    /// 
1642    /// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
1643    /// 
1644    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.
1645    /// 
1646    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1647    ///
1648    /// [GitHub API docs for create_for_team_discussion_comment_legacy](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy)
1649    ///
1650    /// ---
1651    #[cfg(not(target_arch = "wasm32"))]
1652    pub fn create_for_team_discussion_comment_legacy(&self, team_id: i32, discussion_number: i32, comment_number: i32, body: PostReactionsCreateForTeamDiscussionCommentLegacy) -> Result<Reaction, AdapterError> {
1653
1654        let request_uri = format!("{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number, comment_number);
1655
1656
1657        let req = GitHubRequest {
1658            uri: request_uri,
1659            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionCommentLegacy>(body)?),
1660            method: "POST",
1661            headers: vec![]
1662        };
1663
1664        let request = self.client.build(req)?;
1665
1666        // --
1667
1668        let github_response = self.client.fetch(request)?;
1669
1670        // --
1671
1672        if github_response.is_success() {
1673            Ok(github_response.to_json()?)
1674        } else {
1675            match github_response.status_code() {
1676                code => Err(ReactionsCreateForTeamDiscussionCommentLegacyError::Generic { code }.into()),
1677            }
1678        }
1679    }
1680
1681    /// ---
1682    ///
1683    /// # Create reaction for a team discussion
1684    ///
1685    /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
1686    /// 
1687    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion.
1688    /// 
1689    /// > [!NOTE]
1690    /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.
1691    /// 
1692    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1693    ///
1694    /// [GitHub API docs for create_for_team_discussion_in_org](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion)
1695    ///
1696    /// ---
1697    pub async fn create_for_team_discussion_in_org_async(&self, org: &str, team_slug: &str, discussion_number: i32, body: PostReactionsCreateForTeamDiscussionInOrg) -> Result<Reaction, AdapterError> {
1698
1699        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number);
1700
1701
1702        let req = GitHubRequest {
1703            uri: request_uri,
1704            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionInOrg>(body)?),
1705            method: "POST",
1706            headers: vec![]
1707        };
1708
1709        let request = self.client.build(req)?;
1710
1711        // --
1712
1713        let github_response = self.client.fetch_async(request).await?;
1714
1715        // --
1716
1717        if github_response.is_success() {
1718            Ok(github_response.to_json_async().await?)
1719        } else {
1720            match github_response.status_code() {
1721                201 => Err(ReactionsCreateForTeamDiscussionInOrgError::Status201(github_response.to_json_async().await?).into()),
1722                code => Err(ReactionsCreateForTeamDiscussionInOrgError::Generic { code }.into()),
1723            }
1724        }
1725    }
1726
1727    /// ---
1728    ///
1729    /// # Create reaction for a team discussion
1730    ///
1731    /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
1732    /// 
1733    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion.
1734    /// 
1735    /// > [!NOTE]
1736    /// > You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.
1737    /// 
1738    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1739    ///
1740    /// [GitHub API docs for create_for_team_discussion_in_org](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion)
1741    ///
1742    /// ---
1743    #[cfg(not(target_arch = "wasm32"))]
1744    pub fn create_for_team_discussion_in_org(&self, org: &str, team_slug: &str, discussion_number: i32, body: PostReactionsCreateForTeamDiscussionInOrg) -> Result<Reaction, AdapterError> {
1745
1746        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number);
1747
1748
1749        let req = GitHubRequest {
1750            uri: request_uri,
1751            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionInOrg>(body)?),
1752            method: "POST",
1753            headers: vec![]
1754        };
1755
1756        let request = self.client.build(req)?;
1757
1758        // --
1759
1760        let github_response = self.client.fetch(request)?;
1761
1762        // --
1763
1764        if github_response.is_success() {
1765            Ok(github_response.to_json()?)
1766        } else {
1767            match github_response.status_code() {
1768                201 => Err(ReactionsCreateForTeamDiscussionInOrgError::Status201(github_response.to_json()?).into()),
1769                code => Err(ReactionsCreateForTeamDiscussionInOrgError::Generic { code }.into()),
1770            }
1771        }
1772    }
1773
1774    /// ---
1775    ///
1776    /// # Create reaction for a team discussion (Legacy)
1777    ///
1778    /// > [!WARNING]
1779    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.
1780    /// 
1781    /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
1782    /// 
1783    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion.
1784    /// 
1785    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1786    ///
1787    /// [GitHub API docs for create_for_team_discussion_legacy](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy)
1788    ///
1789    /// ---
1790    pub async fn create_for_team_discussion_legacy_async(&self, team_id: i32, discussion_number: i32, body: PostReactionsCreateForTeamDiscussionLegacy) -> Result<Reaction, AdapterError> {
1791
1792        let request_uri = format!("{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number);
1793
1794
1795        let req = GitHubRequest {
1796            uri: request_uri,
1797            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionLegacy>(body)?),
1798            method: "POST",
1799            headers: vec![]
1800        };
1801
1802        let request = self.client.build(req)?;
1803
1804        // --
1805
1806        let github_response = self.client.fetch_async(request).await?;
1807
1808        // --
1809
1810        if github_response.is_success() {
1811            Ok(github_response.to_json_async().await?)
1812        } else {
1813            match github_response.status_code() {
1814                code => Err(ReactionsCreateForTeamDiscussionLegacyError::Generic { code }.into()),
1815            }
1816        }
1817    }
1818
1819    /// ---
1820    ///
1821    /// # Create reaction for a team discussion (Legacy)
1822    ///
1823    /// > [!WARNING]
1824    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.
1825    /// 
1826    /// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
1827    /// 
1828    /// A response with an HTTP `200` status means that you already added the reaction type to this team discussion.
1829    /// 
1830    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
1831    ///
1832    /// [GitHub API docs for create_for_team_discussion_legacy](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy)
1833    ///
1834    /// ---
1835    #[cfg(not(target_arch = "wasm32"))]
1836    pub fn create_for_team_discussion_legacy(&self, team_id: i32, discussion_number: i32, body: PostReactionsCreateForTeamDiscussionLegacy) -> Result<Reaction, AdapterError> {
1837
1838        let request_uri = format!("{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number);
1839
1840
1841        let req = GitHubRequest {
1842            uri: request_uri,
1843            body: Some(C::from_json::<PostReactionsCreateForTeamDiscussionLegacy>(body)?),
1844            method: "POST",
1845            headers: vec![]
1846        };
1847
1848        let request = self.client.build(req)?;
1849
1850        // --
1851
1852        let github_response = self.client.fetch(request)?;
1853
1854        // --
1855
1856        if github_response.is_success() {
1857            Ok(github_response.to_json()?)
1858        } else {
1859            match github_response.status_code() {
1860                code => Err(ReactionsCreateForTeamDiscussionLegacyError::Generic { code }.into()),
1861            }
1862        }
1863    }
1864
1865    /// ---
1866    ///
1867    /// # Delete a commit comment reaction
1868    ///
1869    /// > [!NOTE]
1870    /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.
1871    /// 
1872    /// Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
1873    ///
1874    /// [GitHub API docs for delete_for_commit_comment](https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction)
1875    ///
1876    /// ---
1877    pub async fn delete_for_commit_comment_async(&self, owner: &str, repo: &str, comment_id: i64, reaction_id: i32) -> Result<(), AdapterError> {
1878
1879        let request_uri = format!("{}/repos/{}/{}/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, comment_id, reaction_id);
1880
1881
1882        let req = GitHubRequest {
1883            uri: request_uri,
1884            body: None::<C::Body>,
1885            method: "DELETE",
1886            headers: vec![]
1887        };
1888
1889        let request = self.client.build(req)?;
1890
1891        // --
1892
1893        let github_response = self.client.fetch_async(request).await?;
1894
1895        // --
1896
1897        if github_response.is_success() {
1898            Ok(())
1899        } else {
1900            match github_response.status_code() {
1901                code => Err(ReactionsDeleteForCommitCommentError::Generic { code }.into()),
1902            }
1903        }
1904    }
1905
1906    /// ---
1907    ///
1908    /// # Delete a commit comment reaction
1909    ///
1910    /// > [!NOTE]
1911    /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.
1912    /// 
1913    /// Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
1914    ///
1915    /// [GitHub API docs for delete_for_commit_comment](https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction)
1916    ///
1917    /// ---
1918    #[cfg(not(target_arch = "wasm32"))]
1919    pub fn delete_for_commit_comment(&self, owner: &str, repo: &str, comment_id: i64, reaction_id: i32) -> Result<(), AdapterError> {
1920
1921        let request_uri = format!("{}/repos/{}/{}/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, comment_id, reaction_id);
1922
1923
1924        let req = GitHubRequest {
1925            uri: request_uri,
1926            body: None,
1927            method: "DELETE",
1928            headers: vec![]
1929        };
1930
1931        let request = self.client.build(req)?;
1932
1933        // --
1934
1935        let github_response = self.client.fetch(request)?;
1936
1937        // --
1938
1939        if github_response.is_success() {
1940            Ok(())
1941        } else {
1942            match github_response.status_code() {
1943                code => Err(ReactionsDeleteForCommitCommentError::Generic { code }.into()),
1944            }
1945        }
1946    }
1947
1948    /// ---
1949    ///
1950    /// # Delete an issue reaction
1951    ///
1952    /// > [!NOTE]
1953    /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.
1954    /// 
1955    /// Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
1956    ///
1957    /// [GitHub API docs for delete_for_issue](https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction)
1958    ///
1959    /// ---
1960    pub async fn delete_for_issue_async(&self, owner: &str, repo: &str, issue_number: i32, reaction_id: i32) -> Result<(), AdapterError> {
1961
1962        let request_uri = format!("{}/repos/{}/{}/issues/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, issue_number, reaction_id);
1963
1964
1965        let req = GitHubRequest {
1966            uri: request_uri,
1967            body: None::<C::Body>,
1968            method: "DELETE",
1969            headers: vec![]
1970        };
1971
1972        let request = self.client.build(req)?;
1973
1974        // --
1975
1976        let github_response = self.client.fetch_async(request).await?;
1977
1978        // --
1979
1980        if github_response.is_success() {
1981            Ok(())
1982        } else {
1983            match github_response.status_code() {
1984                code => Err(ReactionsDeleteForIssueError::Generic { code }.into()),
1985            }
1986        }
1987    }
1988
1989    /// ---
1990    ///
1991    /// # Delete an issue reaction
1992    ///
1993    /// > [!NOTE]
1994    /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.
1995    /// 
1996    /// Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
1997    ///
1998    /// [GitHub API docs for delete_for_issue](https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction)
1999    ///
2000    /// ---
2001    #[cfg(not(target_arch = "wasm32"))]
2002    pub fn delete_for_issue(&self, owner: &str, repo: &str, issue_number: i32, reaction_id: i32) -> Result<(), AdapterError> {
2003
2004        let request_uri = format!("{}/repos/{}/{}/issues/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, issue_number, reaction_id);
2005
2006
2007        let req = GitHubRequest {
2008            uri: request_uri,
2009            body: None,
2010            method: "DELETE",
2011            headers: vec![]
2012        };
2013
2014        let request = self.client.build(req)?;
2015
2016        // --
2017
2018        let github_response = self.client.fetch(request)?;
2019
2020        // --
2021
2022        if github_response.is_success() {
2023            Ok(())
2024        } else {
2025            match github_response.status_code() {
2026                code => Err(ReactionsDeleteForIssueError::Generic { code }.into()),
2027            }
2028        }
2029    }
2030
2031    /// ---
2032    ///
2033    /// # Delete an issue comment reaction
2034    ///
2035    /// > [!NOTE]
2036    /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.
2037    /// 
2038    /// Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
2039    ///
2040    /// [GitHub API docs for delete_for_issue_comment](https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction)
2041    ///
2042    /// ---
2043    pub async fn delete_for_issue_comment_async(&self, owner: &str, repo: &str, comment_id: i64, reaction_id: i32) -> Result<(), AdapterError> {
2044
2045        let request_uri = format!("{}/repos/{}/{}/issues/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, comment_id, reaction_id);
2046
2047
2048        let req = GitHubRequest {
2049            uri: request_uri,
2050            body: None::<C::Body>,
2051            method: "DELETE",
2052            headers: vec![]
2053        };
2054
2055        let request = self.client.build(req)?;
2056
2057        // --
2058
2059        let github_response = self.client.fetch_async(request).await?;
2060
2061        // --
2062
2063        if github_response.is_success() {
2064            Ok(())
2065        } else {
2066            match github_response.status_code() {
2067                code => Err(ReactionsDeleteForIssueCommentError::Generic { code }.into()),
2068            }
2069        }
2070    }
2071
2072    /// ---
2073    ///
2074    /// # Delete an issue comment reaction
2075    ///
2076    /// > [!NOTE]
2077    /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.
2078    /// 
2079    /// Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
2080    ///
2081    /// [GitHub API docs for delete_for_issue_comment](https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction)
2082    ///
2083    /// ---
2084    #[cfg(not(target_arch = "wasm32"))]
2085    pub fn delete_for_issue_comment(&self, owner: &str, repo: &str, comment_id: i64, reaction_id: i32) -> Result<(), AdapterError> {
2086
2087        let request_uri = format!("{}/repos/{}/{}/issues/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, comment_id, reaction_id);
2088
2089
2090        let req = GitHubRequest {
2091            uri: request_uri,
2092            body: None,
2093            method: "DELETE",
2094            headers: vec![]
2095        };
2096
2097        let request = self.client.build(req)?;
2098
2099        // --
2100
2101        let github_response = self.client.fetch(request)?;
2102
2103        // --
2104
2105        if github_response.is_success() {
2106            Ok(())
2107        } else {
2108            match github_response.status_code() {
2109                code => Err(ReactionsDeleteForIssueCommentError::Generic { code }.into()),
2110            }
2111        }
2112    }
2113
2114    /// ---
2115    ///
2116    /// # Delete a pull request comment reaction
2117    ///
2118    /// > [!NOTE]
2119    /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`
2120    /// 
2121    /// Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
2122    ///
2123    /// [GitHub API docs for delete_for_pull_request_comment](https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction)
2124    ///
2125    /// ---
2126    pub async fn delete_for_pull_request_comment_async(&self, owner: &str, repo: &str, comment_id: i64, reaction_id: i32) -> Result<(), AdapterError> {
2127
2128        let request_uri = format!("{}/repos/{}/{}/pulls/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, comment_id, reaction_id);
2129
2130
2131        let req = GitHubRequest {
2132            uri: request_uri,
2133            body: None::<C::Body>,
2134            method: "DELETE",
2135            headers: vec![]
2136        };
2137
2138        let request = self.client.build(req)?;
2139
2140        // --
2141
2142        let github_response = self.client.fetch_async(request).await?;
2143
2144        // --
2145
2146        if github_response.is_success() {
2147            Ok(())
2148        } else {
2149            match github_response.status_code() {
2150                code => Err(ReactionsDeleteForPullRequestCommentError::Generic { code }.into()),
2151            }
2152        }
2153    }
2154
2155    /// ---
2156    ///
2157    /// # Delete a pull request comment reaction
2158    ///
2159    /// > [!NOTE]
2160    /// > You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`
2161    /// 
2162    /// Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
2163    ///
2164    /// [GitHub API docs for delete_for_pull_request_comment](https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction)
2165    ///
2166    /// ---
2167    #[cfg(not(target_arch = "wasm32"))]
2168    pub fn delete_for_pull_request_comment(&self, owner: &str, repo: &str, comment_id: i64, reaction_id: i32) -> Result<(), AdapterError> {
2169
2170        let request_uri = format!("{}/repos/{}/{}/pulls/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, comment_id, reaction_id);
2171
2172
2173        let req = GitHubRequest {
2174            uri: request_uri,
2175            body: None,
2176            method: "DELETE",
2177            headers: vec![]
2178        };
2179
2180        let request = self.client.build(req)?;
2181
2182        // --
2183
2184        let github_response = self.client.fetch(request)?;
2185
2186        // --
2187
2188        if github_response.is_success() {
2189            Ok(())
2190        } else {
2191            match github_response.status_code() {
2192                code => Err(ReactionsDeleteForPullRequestCommentError::Generic { code }.into()),
2193            }
2194        }
2195    }
2196
2197    /// ---
2198    ///
2199    /// # Delete a release reaction
2200    ///
2201    /// > [!NOTE]
2202    /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.
2203    /// 
2204    /// Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
2205    ///
2206    /// [GitHub API docs for delete_for_release](https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction)
2207    ///
2208    /// ---
2209    pub async fn delete_for_release_async(&self, owner: &str, repo: &str, release_id: i32, reaction_id: i32) -> Result<(), AdapterError> {
2210
2211        let request_uri = format!("{}/repos/{}/{}/releases/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, release_id, reaction_id);
2212
2213
2214        let req = GitHubRequest {
2215            uri: request_uri,
2216            body: None::<C::Body>,
2217            method: "DELETE",
2218            headers: vec![]
2219        };
2220
2221        let request = self.client.build(req)?;
2222
2223        // --
2224
2225        let github_response = self.client.fetch_async(request).await?;
2226
2227        // --
2228
2229        if github_response.is_success() {
2230            Ok(())
2231        } else {
2232            match github_response.status_code() {
2233                code => Err(ReactionsDeleteForReleaseError::Generic { code }.into()),
2234            }
2235        }
2236    }
2237
2238    /// ---
2239    ///
2240    /// # Delete a release reaction
2241    ///
2242    /// > [!NOTE]
2243    /// > You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.
2244    /// 
2245    /// Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
2246    ///
2247    /// [GitHub API docs for delete_for_release](https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction)
2248    ///
2249    /// ---
2250    #[cfg(not(target_arch = "wasm32"))]
2251    pub fn delete_for_release(&self, owner: &str, repo: &str, release_id: i32, reaction_id: i32) -> Result<(), AdapterError> {
2252
2253        let request_uri = format!("{}/repos/{}/{}/releases/{}/reactions/{}", super::GITHUB_BASE_API_URL, owner, repo, release_id, reaction_id);
2254
2255
2256        let req = GitHubRequest {
2257            uri: request_uri,
2258            body: None,
2259            method: "DELETE",
2260            headers: vec![]
2261        };
2262
2263        let request = self.client.build(req)?;
2264
2265        // --
2266
2267        let github_response = self.client.fetch(request)?;
2268
2269        // --
2270
2271        if github_response.is_success() {
2272            Ok(())
2273        } else {
2274            match github_response.status_code() {
2275                code => Err(ReactionsDeleteForReleaseError::Generic { code }.into()),
2276            }
2277        }
2278    }
2279
2280    /// ---
2281    ///
2282    /// # Delete team discussion reaction
2283    ///
2284    /// > [!NOTE]
2285    /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.
2286    /// 
2287    /// Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
2288    /// 
2289    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
2290    ///
2291    /// [GitHub API docs for delete_for_team_discussion](https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction)
2292    ///
2293    /// ---
2294    pub async fn delete_for_team_discussion_async(&self, org: &str, team_slug: &str, discussion_number: i32, reaction_id: i32) -> Result<(), AdapterError> {
2295
2296        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/reactions/{}", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, reaction_id);
2297
2298
2299        let req = GitHubRequest {
2300            uri: request_uri,
2301            body: None::<C::Body>,
2302            method: "DELETE",
2303            headers: vec![]
2304        };
2305
2306        let request = self.client.build(req)?;
2307
2308        // --
2309
2310        let github_response = self.client.fetch_async(request).await?;
2311
2312        // --
2313
2314        if github_response.is_success() {
2315            Ok(())
2316        } else {
2317            match github_response.status_code() {
2318                code => Err(ReactionsDeleteForTeamDiscussionError::Generic { code }.into()),
2319            }
2320        }
2321    }
2322
2323    /// ---
2324    ///
2325    /// # Delete team discussion reaction
2326    ///
2327    /// > [!NOTE]
2328    /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.
2329    /// 
2330    /// Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
2331    /// 
2332    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
2333    ///
2334    /// [GitHub API docs for delete_for_team_discussion](https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction)
2335    ///
2336    /// ---
2337    #[cfg(not(target_arch = "wasm32"))]
2338    pub fn delete_for_team_discussion(&self, org: &str, team_slug: &str, discussion_number: i32, reaction_id: i32) -> Result<(), AdapterError> {
2339
2340        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/reactions/{}", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, reaction_id);
2341
2342
2343        let req = GitHubRequest {
2344            uri: request_uri,
2345            body: None,
2346            method: "DELETE",
2347            headers: vec![]
2348        };
2349
2350        let request = self.client.build(req)?;
2351
2352        // --
2353
2354        let github_response = self.client.fetch(request)?;
2355
2356        // --
2357
2358        if github_response.is_success() {
2359            Ok(())
2360        } else {
2361            match github_response.status_code() {
2362                code => Err(ReactionsDeleteForTeamDiscussionError::Generic { code }.into()),
2363            }
2364        }
2365    }
2366
2367    /// ---
2368    ///
2369    /// # Delete team discussion comment reaction
2370    ///
2371    /// > [!NOTE]
2372    /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.
2373    /// 
2374    /// Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
2375    /// 
2376    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
2377    ///
2378    /// [GitHub API docs for delete_for_team_discussion_comment](https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction)
2379    ///
2380    /// ---
2381    pub async fn delete_for_team_discussion_comment_async(&self, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, reaction_id: i32) -> Result<(), AdapterError> {
2382
2383        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, comment_number, reaction_id);
2384
2385
2386        let req = GitHubRequest {
2387            uri: request_uri,
2388            body: None::<C::Body>,
2389            method: "DELETE",
2390            headers: vec![]
2391        };
2392
2393        let request = self.client.build(req)?;
2394
2395        // --
2396
2397        let github_response = self.client.fetch_async(request).await?;
2398
2399        // --
2400
2401        if github_response.is_success() {
2402            Ok(())
2403        } else {
2404            match github_response.status_code() {
2405                code => Err(ReactionsDeleteForTeamDiscussionCommentError::Generic { code }.into()),
2406            }
2407        }
2408    }
2409
2410    /// ---
2411    ///
2412    /// # Delete team discussion comment reaction
2413    ///
2414    /// > [!NOTE]
2415    /// > You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.
2416    /// 
2417    /// Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
2418    /// 
2419    /// OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
2420    ///
2421    /// [GitHub API docs for delete_for_team_discussion_comment](https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction)
2422    ///
2423    /// ---
2424    #[cfg(not(target_arch = "wasm32"))]
2425    pub fn delete_for_team_discussion_comment(&self, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, reaction_id: i32) -> Result<(), AdapterError> {
2426
2427        let request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions/{}", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, comment_number, reaction_id);
2428
2429
2430        let req = GitHubRequest {
2431            uri: request_uri,
2432            body: None,
2433            method: "DELETE",
2434            headers: vec![]
2435        };
2436
2437        let request = self.client.build(req)?;
2438
2439        // --
2440
2441        let github_response = self.client.fetch(request)?;
2442
2443        // --
2444
2445        if github_response.is_success() {
2446            Ok(())
2447        } else {
2448            match github_response.status_code() {
2449                code => Err(ReactionsDeleteForTeamDiscussionCommentError::Generic { code }.into()),
2450            }
2451        }
2452    }
2453
2454    /// ---
2455    ///
2456    /// # List reactions for a commit comment
2457    ///
2458    /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
2459    ///
2460    /// [GitHub API docs for list_for_commit_comment](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment)
2461    ///
2462    /// ---
2463    pub async fn list_for_commit_comment_async(&self, owner: &str, repo: &str, comment_id: i64, query_params: Option<impl Into<ReactionsListForCommitCommentParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2464
2465        let mut request_uri = format!("{}/repos/{}/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
2466
2467        if let Some(params) = query_params {
2468            request_uri.push_str("?");
2469            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2470        }
2471
2472        let req = GitHubRequest {
2473            uri: request_uri,
2474            body: None::<C::Body>,
2475            method: "GET",
2476            headers: vec![]
2477        };
2478
2479        let request = self.client.build(req)?;
2480
2481        // --
2482
2483        let github_response = self.client.fetch_async(request).await?;
2484
2485        // --
2486
2487        if github_response.is_success() {
2488            Ok(github_response.to_json_async().await?)
2489        } else {
2490            match github_response.status_code() {
2491                404 => Err(ReactionsListForCommitCommentError::Status404(github_response.to_json_async().await?).into()),
2492                code => Err(ReactionsListForCommitCommentError::Generic { code }.into()),
2493            }
2494        }
2495    }
2496
2497    /// ---
2498    ///
2499    /// # List reactions for a commit comment
2500    ///
2501    /// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
2502    ///
2503    /// [GitHub API docs for list_for_commit_comment](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment)
2504    ///
2505    /// ---
2506    #[cfg(not(target_arch = "wasm32"))]
2507    pub fn list_for_commit_comment(&self, owner: &str, repo: &str, comment_id: i64, query_params: Option<impl Into<ReactionsListForCommitCommentParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2508
2509        let mut request_uri = format!("{}/repos/{}/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
2510
2511        if let Some(params) = query_params {
2512            request_uri.push_str("?");
2513            let qp: ReactionsListForCommitCommentParams = params.into();
2514            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2515        }
2516
2517        let req = GitHubRequest {
2518            uri: request_uri,
2519            body: None,
2520            method: "GET",
2521            headers: vec![]
2522        };
2523
2524        let request = self.client.build(req)?;
2525
2526        // --
2527
2528        let github_response = self.client.fetch(request)?;
2529
2530        // --
2531
2532        if github_response.is_success() {
2533            Ok(github_response.to_json()?)
2534        } else {
2535            match github_response.status_code() {
2536                404 => Err(ReactionsListForCommitCommentError::Status404(github_response.to_json()?).into()),
2537                code => Err(ReactionsListForCommitCommentError::Generic { code }.into()),
2538            }
2539        }
2540    }
2541
2542    /// ---
2543    ///
2544    /// # List reactions for an issue
2545    ///
2546    /// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
2547    ///
2548    /// [GitHub API docs for list_for_issue](https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue)
2549    ///
2550    /// ---
2551    pub async fn list_for_issue_async(&self, owner: &str, repo: &str, issue_number: i32, query_params: Option<impl Into<ReactionsListForIssueParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2552
2553        let mut request_uri = format!("{}/repos/{}/{}/issues/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, issue_number);
2554
2555        if let Some(params) = query_params {
2556            request_uri.push_str("?");
2557            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2558        }
2559
2560        let req = GitHubRequest {
2561            uri: request_uri,
2562            body: None::<C::Body>,
2563            method: "GET",
2564            headers: vec![]
2565        };
2566
2567        let request = self.client.build(req)?;
2568
2569        // --
2570
2571        let github_response = self.client.fetch_async(request).await?;
2572
2573        // --
2574
2575        if github_response.is_success() {
2576            Ok(github_response.to_json_async().await?)
2577        } else {
2578            match github_response.status_code() {
2579                404 => Err(ReactionsListForIssueError::Status404(github_response.to_json_async().await?).into()),
2580                410 => Err(ReactionsListForIssueError::Status410(github_response.to_json_async().await?).into()),
2581                code => Err(ReactionsListForIssueError::Generic { code }.into()),
2582            }
2583        }
2584    }
2585
2586    /// ---
2587    ///
2588    /// # List reactions for an issue
2589    ///
2590    /// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
2591    ///
2592    /// [GitHub API docs for list_for_issue](https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue)
2593    ///
2594    /// ---
2595    #[cfg(not(target_arch = "wasm32"))]
2596    pub fn list_for_issue(&self, owner: &str, repo: &str, issue_number: i32, query_params: Option<impl Into<ReactionsListForIssueParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2597
2598        let mut request_uri = format!("{}/repos/{}/{}/issues/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, issue_number);
2599
2600        if let Some(params) = query_params {
2601            request_uri.push_str("?");
2602            let qp: ReactionsListForIssueParams = params.into();
2603            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2604        }
2605
2606        let req = GitHubRequest {
2607            uri: request_uri,
2608            body: None,
2609            method: "GET",
2610            headers: vec![]
2611        };
2612
2613        let request = self.client.build(req)?;
2614
2615        // --
2616
2617        let github_response = self.client.fetch(request)?;
2618
2619        // --
2620
2621        if github_response.is_success() {
2622            Ok(github_response.to_json()?)
2623        } else {
2624            match github_response.status_code() {
2625                404 => Err(ReactionsListForIssueError::Status404(github_response.to_json()?).into()),
2626                410 => Err(ReactionsListForIssueError::Status410(github_response.to_json()?).into()),
2627                code => Err(ReactionsListForIssueError::Generic { code }.into()),
2628            }
2629        }
2630    }
2631
2632    /// ---
2633    ///
2634    /// # List reactions for an issue comment
2635    ///
2636    /// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
2637    ///
2638    /// [GitHub API docs for list_for_issue_comment](https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment)
2639    ///
2640    /// ---
2641    pub async fn list_for_issue_comment_async(&self, owner: &str, repo: &str, comment_id: i64, query_params: Option<impl Into<ReactionsListForIssueCommentParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2642
2643        let mut request_uri = format!("{}/repos/{}/{}/issues/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
2644
2645        if let Some(params) = query_params {
2646            request_uri.push_str("?");
2647            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2648        }
2649
2650        let req = GitHubRequest {
2651            uri: request_uri,
2652            body: None::<C::Body>,
2653            method: "GET",
2654            headers: vec![]
2655        };
2656
2657        let request = self.client.build(req)?;
2658
2659        // --
2660
2661        let github_response = self.client.fetch_async(request).await?;
2662
2663        // --
2664
2665        if github_response.is_success() {
2666            Ok(github_response.to_json_async().await?)
2667        } else {
2668            match github_response.status_code() {
2669                404 => Err(ReactionsListForIssueCommentError::Status404(github_response.to_json_async().await?).into()),
2670                code => Err(ReactionsListForIssueCommentError::Generic { code }.into()),
2671            }
2672        }
2673    }
2674
2675    /// ---
2676    ///
2677    /// # List reactions for an issue comment
2678    ///
2679    /// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
2680    ///
2681    /// [GitHub API docs for list_for_issue_comment](https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment)
2682    ///
2683    /// ---
2684    #[cfg(not(target_arch = "wasm32"))]
2685    pub fn list_for_issue_comment(&self, owner: &str, repo: &str, comment_id: i64, query_params: Option<impl Into<ReactionsListForIssueCommentParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2686
2687        let mut request_uri = format!("{}/repos/{}/{}/issues/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
2688
2689        if let Some(params) = query_params {
2690            request_uri.push_str("?");
2691            let qp: ReactionsListForIssueCommentParams = params.into();
2692            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2693        }
2694
2695        let req = GitHubRequest {
2696            uri: request_uri,
2697            body: None,
2698            method: "GET",
2699            headers: vec![]
2700        };
2701
2702        let request = self.client.build(req)?;
2703
2704        // --
2705
2706        let github_response = self.client.fetch(request)?;
2707
2708        // --
2709
2710        if github_response.is_success() {
2711            Ok(github_response.to_json()?)
2712        } else {
2713            match github_response.status_code() {
2714                404 => Err(ReactionsListForIssueCommentError::Status404(github_response.to_json()?).into()),
2715                code => Err(ReactionsListForIssueCommentError::Generic { code }.into()),
2716            }
2717        }
2718    }
2719
2720    /// ---
2721    ///
2722    /// # List reactions for a pull request review comment
2723    ///
2724    /// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
2725    ///
2726    /// [GitHub API docs for list_for_pull_request_review_comment](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment)
2727    ///
2728    /// ---
2729    pub async fn list_for_pull_request_review_comment_async(&self, owner: &str, repo: &str, comment_id: i64, query_params: Option<impl Into<ReactionsListForPullRequestReviewCommentParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2730
2731        let mut request_uri = format!("{}/repos/{}/{}/pulls/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
2732
2733        if let Some(params) = query_params {
2734            request_uri.push_str("?");
2735            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2736        }
2737
2738        let req = GitHubRequest {
2739            uri: request_uri,
2740            body: None::<C::Body>,
2741            method: "GET",
2742            headers: vec![]
2743        };
2744
2745        let request = self.client.build(req)?;
2746
2747        // --
2748
2749        let github_response = self.client.fetch_async(request).await?;
2750
2751        // --
2752
2753        if github_response.is_success() {
2754            Ok(github_response.to_json_async().await?)
2755        } else {
2756            match github_response.status_code() {
2757                404 => Err(ReactionsListForPullRequestReviewCommentError::Status404(github_response.to_json_async().await?).into()),
2758                code => Err(ReactionsListForPullRequestReviewCommentError::Generic { code }.into()),
2759            }
2760        }
2761    }
2762
2763    /// ---
2764    ///
2765    /// # List reactions for a pull request review comment
2766    ///
2767    /// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
2768    ///
2769    /// [GitHub API docs for list_for_pull_request_review_comment](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment)
2770    ///
2771    /// ---
2772    #[cfg(not(target_arch = "wasm32"))]
2773    pub fn list_for_pull_request_review_comment(&self, owner: &str, repo: &str, comment_id: i64, query_params: Option<impl Into<ReactionsListForPullRequestReviewCommentParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2774
2775        let mut request_uri = format!("{}/repos/{}/{}/pulls/comments/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, comment_id);
2776
2777        if let Some(params) = query_params {
2778            request_uri.push_str("?");
2779            let qp: ReactionsListForPullRequestReviewCommentParams = params.into();
2780            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2781        }
2782
2783        let req = GitHubRequest {
2784            uri: request_uri,
2785            body: None,
2786            method: "GET",
2787            headers: vec![]
2788        };
2789
2790        let request = self.client.build(req)?;
2791
2792        // --
2793
2794        let github_response = self.client.fetch(request)?;
2795
2796        // --
2797
2798        if github_response.is_success() {
2799            Ok(github_response.to_json()?)
2800        } else {
2801            match github_response.status_code() {
2802                404 => Err(ReactionsListForPullRequestReviewCommentError::Status404(github_response.to_json()?).into()),
2803                code => Err(ReactionsListForPullRequestReviewCommentError::Generic { code }.into()),
2804            }
2805        }
2806    }
2807
2808    /// ---
2809    ///
2810    /// # List reactions for a release
2811    ///
2812    /// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
2813    ///
2814    /// [GitHub API docs for list_for_release](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release)
2815    ///
2816    /// ---
2817    pub async fn list_for_release_async(&self, owner: &str, repo: &str, release_id: i32, query_params: Option<impl Into<ReactionsListForReleaseParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2818
2819        let mut request_uri = format!("{}/repos/{}/{}/releases/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, release_id);
2820
2821        if let Some(params) = query_params {
2822            request_uri.push_str("?");
2823            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2824        }
2825
2826        let req = GitHubRequest {
2827            uri: request_uri,
2828            body: None::<C::Body>,
2829            method: "GET",
2830            headers: vec![]
2831        };
2832
2833        let request = self.client.build(req)?;
2834
2835        // --
2836
2837        let github_response = self.client.fetch_async(request).await?;
2838
2839        // --
2840
2841        if github_response.is_success() {
2842            Ok(github_response.to_json_async().await?)
2843        } else {
2844            match github_response.status_code() {
2845                404 => Err(ReactionsListForReleaseError::Status404(github_response.to_json_async().await?).into()),
2846                code => Err(ReactionsListForReleaseError::Generic { code }.into()),
2847            }
2848        }
2849    }
2850
2851    /// ---
2852    ///
2853    /// # List reactions for a release
2854    ///
2855    /// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
2856    ///
2857    /// [GitHub API docs for list_for_release](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release)
2858    ///
2859    /// ---
2860    #[cfg(not(target_arch = "wasm32"))]
2861    pub fn list_for_release(&self, owner: &str, repo: &str, release_id: i32, query_params: Option<impl Into<ReactionsListForReleaseParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2862
2863        let mut request_uri = format!("{}/repos/{}/{}/releases/{}/reactions", super::GITHUB_BASE_API_URL, owner, repo, release_id);
2864
2865        if let Some(params) = query_params {
2866            request_uri.push_str("?");
2867            let qp: ReactionsListForReleaseParams = params.into();
2868            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2869        }
2870
2871        let req = GitHubRequest {
2872            uri: request_uri,
2873            body: None,
2874            method: "GET",
2875            headers: vec![]
2876        };
2877
2878        let request = self.client.build(req)?;
2879
2880        // --
2881
2882        let github_response = self.client.fetch(request)?;
2883
2884        // --
2885
2886        if github_response.is_success() {
2887            Ok(github_response.to_json()?)
2888        } else {
2889            match github_response.status_code() {
2890                404 => Err(ReactionsListForReleaseError::Status404(github_response.to_json()?).into()),
2891                code => Err(ReactionsListForReleaseError::Generic { code }.into()),
2892            }
2893        }
2894    }
2895
2896    /// ---
2897    ///
2898    /// # List reactions for a team discussion comment
2899    ///
2900    /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
2901    /// 
2902    /// > [!NOTE]
2903    /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.
2904    /// 
2905    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
2906    ///
2907    /// [GitHub API docs for list_for_team_discussion_comment_in_org](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment)
2908    ///
2909    /// ---
2910    pub async fn list_for_team_discussion_comment_in_org_async(&self, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionCommentInOrgParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2911
2912        let mut request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, comment_number);
2913
2914        if let Some(params) = query_params {
2915            request_uri.push_str("?");
2916            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
2917        }
2918
2919        let req = GitHubRequest {
2920            uri: request_uri,
2921            body: None::<C::Body>,
2922            method: "GET",
2923            headers: vec![]
2924        };
2925
2926        let request = self.client.build(req)?;
2927
2928        // --
2929
2930        let github_response = self.client.fetch_async(request).await?;
2931
2932        // --
2933
2934        if github_response.is_success() {
2935            Ok(github_response.to_json_async().await?)
2936        } else {
2937            match github_response.status_code() {
2938                code => Err(ReactionsListForTeamDiscussionCommentInOrgError::Generic { code }.into()),
2939            }
2940        }
2941    }
2942
2943    /// ---
2944    ///
2945    /// # List reactions for a team discussion comment
2946    ///
2947    /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
2948    /// 
2949    /// > [!NOTE]
2950    /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.
2951    /// 
2952    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
2953    ///
2954    /// [GitHub API docs for list_for_team_discussion_comment_in_org](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment)
2955    ///
2956    /// ---
2957    #[cfg(not(target_arch = "wasm32"))]
2958    pub fn list_for_team_discussion_comment_in_org(&self, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionCommentInOrgParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
2959
2960        let mut request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number, comment_number);
2961
2962        if let Some(params) = query_params {
2963            request_uri.push_str("?");
2964            let qp: ReactionsListForTeamDiscussionCommentInOrgParams = params.into();
2965            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
2966        }
2967
2968        let req = GitHubRequest {
2969            uri: request_uri,
2970            body: None,
2971            method: "GET",
2972            headers: vec![]
2973        };
2974
2975        let request = self.client.build(req)?;
2976
2977        // --
2978
2979        let github_response = self.client.fetch(request)?;
2980
2981        // --
2982
2983        if github_response.is_success() {
2984            Ok(github_response.to_json()?)
2985        } else {
2986            match github_response.status_code() {
2987                code => Err(ReactionsListForTeamDiscussionCommentInOrgError::Generic { code }.into()),
2988            }
2989        }
2990    }
2991
2992    /// ---
2993    ///
2994    /// # List reactions for a team discussion comment (Legacy)
2995    ///
2996    /// > [!WARNING]
2997    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.
2998    /// 
2999    /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
3000    /// 
3001    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
3002    ///
3003    /// [GitHub API docs for list_for_team_discussion_comment_legacy](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy)
3004    ///
3005    /// ---
3006    pub async fn list_for_team_discussion_comment_legacy_async(&self, team_id: i32, discussion_number: i32, comment_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionCommentLegacyParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
3007
3008        let mut request_uri = format!("{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number, comment_number);
3009
3010        if let Some(params) = query_params {
3011            request_uri.push_str("?");
3012            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
3013        }
3014
3015        let req = GitHubRequest {
3016            uri: request_uri,
3017            body: None::<C::Body>,
3018            method: "GET",
3019            headers: vec![]
3020        };
3021
3022        let request = self.client.build(req)?;
3023
3024        // --
3025
3026        let github_response = self.client.fetch_async(request).await?;
3027
3028        // --
3029
3030        if github_response.is_success() {
3031            Ok(github_response.to_json_async().await?)
3032        } else {
3033            match github_response.status_code() {
3034                code => Err(ReactionsListForTeamDiscussionCommentLegacyError::Generic { code }.into()),
3035            }
3036        }
3037    }
3038
3039    /// ---
3040    ///
3041    /// # List reactions for a team discussion comment (Legacy)
3042    ///
3043    /// > [!WARNING]
3044    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.
3045    /// 
3046    /// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).
3047    /// 
3048    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
3049    ///
3050    /// [GitHub API docs for list_for_team_discussion_comment_legacy](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy)
3051    ///
3052    /// ---
3053    #[cfg(not(target_arch = "wasm32"))]
3054    pub fn list_for_team_discussion_comment_legacy(&self, team_id: i32, discussion_number: i32, comment_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionCommentLegacyParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
3055
3056        let mut request_uri = format!("{}/teams/{}/discussions/{}/comments/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number, comment_number);
3057
3058        if let Some(params) = query_params {
3059            request_uri.push_str("?");
3060            let qp: ReactionsListForTeamDiscussionCommentLegacyParams = params.into();
3061            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3062        }
3063
3064        let req = GitHubRequest {
3065            uri: request_uri,
3066            body: None,
3067            method: "GET",
3068            headers: vec![]
3069        };
3070
3071        let request = self.client.build(req)?;
3072
3073        // --
3074
3075        let github_response = self.client.fetch(request)?;
3076
3077        // --
3078
3079        if github_response.is_success() {
3080            Ok(github_response.to_json()?)
3081        } else {
3082            match github_response.status_code() {
3083                code => Err(ReactionsListForTeamDiscussionCommentLegacyError::Generic { code }.into()),
3084            }
3085        }
3086    }
3087
3088    /// ---
3089    ///
3090    /// # List reactions for a team discussion
3091    ///
3092    /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
3093    /// 
3094    /// > [!NOTE]
3095    /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.
3096    /// 
3097    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
3098    ///
3099    /// [GitHub API docs for list_for_team_discussion_in_org](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion)
3100    ///
3101    /// ---
3102    pub async fn list_for_team_discussion_in_org_async(&self, org: &str, team_slug: &str, discussion_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionInOrgParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
3103
3104        let mut request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number);
3105
3106        if let Some(params) = query_params {
3107            request_uri.push_str("?");
3108            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
3109        }
3110
3111        let req = GitHubRequest {
3112            uri: request_uri,
3113            body: None::<C::Body>,
3114            method: "GET",
3115            headers: vec![]
3116        };
3117
3118        let request = self.client.build(req)?;
3119
3120        // --
3121
3122        let github_response = self.client.fetch_async(request).await?;
3123
3124        // --
3125
3126        if github_response.is_success() {
3127            Ok(github_response.to_json_async().await?)
3128        } else {
3129            match github_response.status_code() {
3130                code => Err(ReactionsListForTeamDiscussionInOrgError::Generic { code }.into()),
3131            }
3132        }
3133    }
3134
3135    /// ---
3136    ///
3137    /// # List reactions for a team discussion
3138    ///
3139    /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
3140    /// 
3141    /// > [!NOTE]
3142    /// > You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.
3143    /// 
3144    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
3145    ///
3146    /// [GitHub API docs for list_for_team_discussion_in_org](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion)
3147    ///
3148    /// ---
3149    #[cfg(not(target_arch = "wasm32"))]
3150    pub fn list_for_team_discussion_in_org(&self, org: &str, team_slug: &str, discussion_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionInOrgParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
3151
3152        let mut request_uri = format!("{}/orgs/{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, org, team_slug, discussion_number);
3153
3154        if let Some(params) = query_params {
3155            request_uri.push_str("?");
3156            let qp: ReactionsListForTeamDiscussionInOrgParams = params.into();
3157            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3158        }
3159
3160        let req = GitHubRequest {
3161            uri: request_uri,
3162            body: None,
3163            method: "GET",
3164            headers: vec![]
3165        };
3166
3167        let request = self.client.build(req)?;
3168
3169        // --
3170
3171        let github_response = self.client.fetch(request)?;
3172
3173        // --
3174
3175        if github_response.is_success() {
3176            Ok(github_response.to_json()?)
3177        } else {
3178            match github_response.status_code() {
3179                code => Err(ReactionsListForTeamDiscussionInOrgError::Generic { code }.into()),
3180            }
3181        }
3182    }
3183
3184    /// ---
3185    ///
3186    /// # List reactions for a team discussion (Legacy)
3187    ///
3188    /// > [!WARNING]
3189    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.
3190    /// 
3191    /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
3192    /// 
3193    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
3194    ///
3195    /// [GitHub API docs for list_for_team_discussion_legacy](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy)
3196    ///
3197    /// ---
3198    pub async fn list_for_team_discussion_legacy_async(&self, team_id: i32, discussion_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionLegacyParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
3199
3200        let mut request_uri = format!("{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number);
3201
3202        if let Some(params) = query_params {
3203            request_uri.push_str("?");
3204            request_uri.push_str(&serde_urlencoded::to_string(params.into())?);
3205        }
3206
3207        let req = GitHubRequest {
3208            uri: request_uri,
3209            body: None::<C::Body>,
3210            method: "GET",
3211            headers: vec![]
3212        };
3213
3214        let request = self.client.build(req)?;
3215
3216        // --
3217
3218        let github_response = self.client.fetch_async(request).await?;
3219
3220        // --
3221
3222        if github_response.is_success() {
3223            Ok(github_response.to_json_async().await?)
3224        } else {
3225            match github_response.status_code() {
3226                code => Err(ReactionsListForTeamDiscussionLegacyError::Generic { code }.into()),
3227            }
3228        }
3229    }
3230
3231    /// ---
3232    ///
3233    /// # List reactions for a team discussion (Legacy)
3234    ///
3235    /// > [!WARNING]
3236    /// > **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.
3237    /// 
3238    /// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).
3239    /// 
3240    /// OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
3241    ///
3242    /// [GitHub API docs for list_for_team_discussion_legacy](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy)
3243    ///
3244    /// ---
3245    #[cfg(not(target_arch = "wasm32"))]
3246    pub fn list_for_team_discussion_legacy(&self, team_id: i32, discussion_number: i32, query_params: Option<impl Into<ReactionsListForTeamDiscussionLegacyParams<'api>>>) -> Result<Vec<Reaction>, AdapterError> {
3247
3248        let mut request_uri = format!("{}/teams/{}/discussions/{}/reactions", super::GITHUB_BASE_API_URL, team_id, discussion_number);
3249
3250        if let Some(params) = query_params {
3251            request_uri.push_str("?");
3252            let qp: ReactionsListForTeamDiscussionLegacyParams = params.into();
3253            request_uri.push_str(&serde_urlencoded::to_string(qp)?);
3254        }
3255
3256        let req = GitHubRequest {
3257            uri: request_uri,
3258            body: None,
3259            method: "GET",
3260            headers: vec![]
3261        };
3262
3263        let request = self.client.build(req)?;
3264
3265        // --
3266
3267        let github_response = self.client.fetch(request)?;
3268
3269        // --
3270
3271        if github_response.is_success() {
3272            Ok(github_response.to_json()?)
3273        } else {
3274            match github_response.status_code() {
3275                code => Err(ReactionsListForTeamDiscussionLegacyError::Generic { code }.into()),
3276            }
3277        }
3278    }
3279
3280}