openapi_github/apis/
reactions_api.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`reactions_slash_create_for_commit_comment`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ReactionsSlashCreateForCommitCommentError {
22    Status422(models::ValidationError),
23    UnknownValue(serde_json::Value),
24}
25
26/// struct for typed errors of method [`reactions_slash_create_for_issue`]
27#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum ReactionsSlashCreateForIssueError {
30    Status422(models::ValidationError),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`reactions_slash_create_for_issue_comment`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum ReactionsSlashCreateForIssueCommentError {
38    Status422(models::ValidationError),
39    UnknownValue(serde_json::Value),
40}
41
42/// struct for typed errors of method [`reactions_slash_create_for_pull_request_review_comment`]
43#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum ReactionsSlashCreateForPullRequestReviewCommentError {
46    Status422(models::ValidationError),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`reactions_slash_create_for_release`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum ReactionsSlashCreateForReleaseError {
54    Status422(models::ValidationError),
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`reactions_slash_create_for_team_discussion_comment_in_org`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum ReactionsSlashCreateForTeamDiscussionCommentInOrgError {
62    UnknownValue(serde_json::Value),
63}
64
65/// struct for typed errors of method [`reactions_slash_create_for_team_discussion_comment_legacy`]
66#[derive(Debug, Clone, Serialize, Deserialize)]
67#[serde(untagged)]
68pub enum ReactionsSlashCreateForTeamDiscussionCommentLegacyError {
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`reactions_slash_create_for_team_discussion_in_org`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum ReactionsSlashCreateForTeamDiscussionInOrgError {
76    UnknownValue(serde_json::Value),
77}
78
79/// struct for typed errors of method [`reactions_slash_create_for_team_discussion_legacy`]
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum ReactionsSlashCreateForTeamDiscussionLegacyError {
83    UnknownValue(serde_json::Value),
84}
85
86/// struct for typed errors of method [`reactions_slash_delete_for_commit_comment`]
87#[derive(Debug, Clone, Serialize, Deserialize)]
88#[serde(untagged)]
89pub enum ReactionsSlashDeleteForCommitCommentError {
90    UnknownValue(serde_json::Value),
91}
92
93/// struct for typed errors of method [`reactions_slash_delete_for_issue`]
94#[derive(Debug, Clone, Serialize, Deserialize)]
95#[serde(untagged)]
96pub enum ReactionsSlashDeleteForIssueError {
97    UnknownValue(serde_json::Value),
98}
99
100/// struct for typed errors of method [`reactions_slash_delete_for_issue_comment`]
101#[derive(Debug, Clone, Serialize, Deserialize)]
102#[serde(untagged)]
103pub enum ReactionsSlashDeleteForIssueCommentError {
104    UnknownValue(serde_json::Value),
105}
106
107/// struct for typed errors of method [`reactions_slash_delete_for_pull_request_comment`]
108#[derive(Debug, Clone, Serialize, Deserialize)]
109#[serde(untagged)]
110pub enum ReactionsSlashDeleteForPullRequestCommentError {
111    UnknownValue(serde_json::Value),
112}
113
114/// struct for typed errors of method [`reactions_slash_delete_for_release`]
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum ReactionsSlashDeleteForReleaseError {
118    UnknownValue(serde_json::Value),
119}
120
121/// struct for typed errors of method [`reactions_slash_delete_for_team_discussion`]
122#[derive(Debug, Clone, Serialize, Deserialize)]
123#[serde(untagged)]
124pub enum ReactionsSlashDeleteForTeamDiscussionError {
125    UnknownValue(serde_json::Value),
126}
127
128/// struct for typed errors of method [`reactions_slash_delete_for_team_discussion_comment`]
129#[derive(Debug, Clone, Serialize, Deserialize)]
130#[serde(untagged)]
131pub enum ReactionsSlashDeleteForTeamDiscussionCommentError {
132    UnknownValue(serde_json::Value),
133}
134
135/// struct for typed errors of method [`reactions_slash_list_for_commit_comment`]
136#[derive(Debug, Clone, Serialize, Deserialize)]
137#[serde(untagged)]
138pub enum ReactionsSlashListForCommitCommentError {
139    Status404(models::BasicError),
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method [`reactions_slash_list_for_issue`]
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum ReactionsSlashListForIssueError {
147    Status404(models::BasicError),
148    Status410(models::BasicError),
149    UnknownValue(serde_json::Value),
150}
151
152/// struct for typed errors of method [`reactions_slash_list_for_issue_comment`]
153#[derive(Debug, Clone, Serialize, Deserialize)]
154#[serde(untagged)]
155pub enum ReactionsSlashListForIssueCommentError {
156    Status404(models::BasicError),
157    UnknownValue(serde_json::Value),
158}
159
160/// struct for typed errors of method [`reactions_slash_list_for_pull_request_review_comment`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum ReactionsSlashListForPullRequestReviewCommentError {
164    Status404(models::BasicError),
165    UnknownValue(serde_json::Value),
166}
167
168/// struct for typed errors of method [`reactions_slash_list_for_release`]
169#[derive(Debug, Clone, Serialize, Deserialize)]
170#[serde(untagged)]
171pub enum ReactionsSlashListForReleaseError {
172    Status404(models::BasicError),
173    UnknownValue(serde_json::Value),
174}
175
176/// struct for typed errors of method [`reactions_slash_list_for_team_discussion_comment_in_org`]
177#[derive(Debug, Clone, Serialize, Deserialize)]
178#[serde(untagged)]
179pub enum ReactionsSlashListForTeamDiscussionCommentInOrgError {
180    UnknownValue(serde_json::Value),
181}
182
183/// struct for typed errors of method [`reactions_slash_list_for_team_discussion_comment_legacy`]
184#[derive(Debug, Clone, Serialize, Deserialize)]
185#[serde(untagged)]
186pub enum ReactionsSlashListForTeamDiscussionCommentLegacyError {
187    UnknownValue(serde_json::Value),
188}
189
190/// struct for typed errors of method [`reactions_slash_list_for_team_discussion_in_org`]
191#[derive(Debug, Clone, Serialize, Deserialize)]
192#[serde(untagged)]
193pub enum ReactionsSlashListForTeamDiscussionInOrgError {
194    UnknownValue(serde_json::Value),
195}
196
197/// struct for typed errors of method [`reactions_slash_list_for_team_discussion_legacy`]
198#[derive(Debug, Clone, Serialize, Deserialize)]
199#[serde(untagged)]
200pub enum ReactionsSlashListForTeamDiscussionLegacyError {
201    UnknownValue(serde_json::Value),
202}
203
204
205/// 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.
206pub async fn reactions_slash_create_for_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, reactions_create_for_commit_comment_request: models::ReactionsCreateForCommitCommentRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForCommitCommentError>> {
207    let local_var_configuration = configuration;
208
209    let local_var_client = &local_var_configuration.client;
210
211    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments/{comment_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
212    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
213
214    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
215        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
216    }
217    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_commit_comment_request);
218
219    let local_var_req = local_var_req_builder.build()?;
220    let local_var_resp = local_var_client.execute(local_var_req).await?;
221
222    let local_var_status = local_var_resp.status();
223    let local_var_content = local_var_resp.text().await?;
224
225    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
226        serde_json::from_str(&local_var_content).map_err(Error::from)
227    } else {
228        let local_var_entity: Option<ReactionsSlashCreateForCommitCommentError> = serde_json::from_str(&local_var_content).ok();
229        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
230        Err(Error::ResponseError(local_var_error))
231    }
232}
233
234/// 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.
235pub async fn reactions_slash_create_for_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, reactions_create_for_issue_request: models::ReactionsCreateForIssueRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForIssueError>> {
236    let local_var_configuration = configuration;
237
238    let local_var_client = &local_var_configuration.client;
239
240    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
241    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
242
243    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
244        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
245    }
246    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_issue_request);
247
248    let local_var_req = local_var_req_builder.build()?;
249    let local_var_resp = local_var_client.execute(local_var_req).await?;
250
251    let local_var_status = local_var_resp.status();
252    let local_var_content = local_var_resp.text().await?;
253
254    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
255        serde_json::from_str(&local_var_content).map_err(Error::from)
256    } else {
257        let local_var_entity: Option<ReactionsSlashCreateForIssueError> = serde_json::from_str(&local_var_content).ok();
258        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
259        Err(Error::ResponseError(local_var_error))
260    }
261}
262
263/// 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.
264pub async fn reactions_slash_create_for_issue_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, reactions_create_for_issue_comment_request: models::ReactionsCreateForIssueCommentRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForIssueCommentError>> {
265    let local_var_configuration = configuration;
266
267    let local_var_client = &local_var_configuration.client;
268
269    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
270    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
271
272    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
273        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
274    }
275    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_issue_comment_request);
276
277    let local_var_req = local_var_req_builder.build()?;
278    let local_var_resp = local_var_client.execute(local_var_req).await?;
279
280    let local_var_status = local_var_resp.status();
281    let local_var_content = local_var_resp.text().await?;
282
283    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
284        serde_json::from_str(&local_var_content).map_err(Error::from)
285    } else {
286        let local_var_entity: Option<ReactionsSlashCreateForIssueCommentError> = serde_json::from_str(&local_var_content).ok();
287        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
288        Err(Error::ResponseError(local_var_error))
289    }
290}
291
292/// 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.
293pub async fn reactions_slash_create_for_pull_request_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, reactions_create_for_pull_request_review_comment_request: models::ReactionsCreateForPullRequestReviewCommentRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForPullRequestReviewCommentError>> {
294    let local_var_configuration = configuration;
295
296    let local_var_client = &local_var_configuration.client;
297
298    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
299    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
300
301    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
302        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
303    }
304    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_pull_request_review_comment_request);
305
306    let local_var_req = local_var_req_builder.build()?;
307    let local_var_resp = local_var_client.execute(local_var_req).await?;
308
309    let local_var_status = local_var_resp.status();
310    let local_var_content = local_var_resp.text().await?;
311
312    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
313        serde_json::from_str(&local_var_content).map_err(Error::from)
314    } else {
315        let local_var_entity: Option<ReactionsSlashCreateForPullRequestReviewCommentError> = serde_json::from_str(&local_var_content).ok();
316        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
317        Err(Error::ResponseError(local_var_error))
318    }
319}
320
321/// 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.
322pub async fn reactions_slash_create_for_release(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32, reactions_create_for_release_request: models::ReactionsCreateForReleaseRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForReleaseError>> {
323    let local_var_configuration = configuration;
324
325    let local_var_client = &local_var_configuration.client;
326
327    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
328    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
329
330    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
331        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
332    }
333    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_release_request);
334
335    let local_var_req = local_var_req_builder.build()?;
336    let local_var_resp = local_var_client.execute(local_var_req).await?;
337
338    let local_var_status = local_var_resp.status();
339    let local_var_content = local_var_resp.text().await?;
340
341    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
342        serde_json::from_str(&local_var_content).map_err(Error::from)
343    } else {
344        let local_var_entity: Option<ReactionsSlashCreateForReleaseError> = serde_json::from_str(&local_var_content).ok();
345        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
346        Err(Error::ResponseError(local_var_error))
347    }
348}
349
350/// Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).  A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.  **Note:** 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`.  OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
351pub async fn reactions_slash_create_for_team_discussion_comment_in_org(configuration: &configuration::Configuration, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, reactions_create_for_team_discussion_comment_in_org_request: models::ReactionsCreateForTeamDiscussionCommentInOrgRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForTeamDiscussionCommentInOrgError>> {
352    let local_var_configuration = configuration;
353
354    let local_var_client = &local_var_configuration.client;
355
356    let local_var_uri_str = format!("{}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), discussion_number=discussion_number, comment_number=comment_number);
357    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
358
359    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
360        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
361    }
362    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_team_discussion_comment_in_org_request);
363
364    let local_var_req = local_var_req_builder.build()?;
365    let local_var_resp = local_var_client.execute(local_var_req).await?;
366
367    let local_var_status = local_var_resp.status();
368    let local_var_content = local_var_resp.text().await?;
369
370    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
371        serde_json::from_str(&local_var_content).map_err(Error::from)
372    } else {
373        let local_var_entity: Option<ReactionsSlashCreateForTeamDiscussionCommentInOrgError> = serde_json::from_str(&local_var_content).ok();
374        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
375        Err(Error::ResponseError(local_var_error))
376    }
377}
378
379/// **Deprecation Notice:** This endpoint route is deprecated 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.  Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).  A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.  OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
380pub async fn reactions_slash_create_for_team_discussion_comment_legacy(configuration: &configuration::Configuration, team_id: i32, discussion_number: i32, comment_number: i32, reactions_create_for_team_discussion_comment_in_org_request: models::ReactionsCreateForTeamDiscussionCommentInOrgRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForTeamDiscussionCommentLegacyError>> {
381    let local_var_configuration = configuration;
382
383    let local_var_client = &local_var_configuration.client;
384
385    let local_var_uri_str = format!("{}/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", local_var_configuration.base_path, team_id=team_id, discussion_number=discussion_number, comment_number=comment_number);
386    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
387
388    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
389        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
390    }
391    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_team_discussion_comment_in_org_request);
392
393    let local_var_req = local_var_req_builder.build()?;
394    let local_var_resp = local_var_client.execute(local_var_req).await?;
395
396    let local_var_status = local_var_resp.status();
397    let local_var_content = local_var_resp.text().await?;
398
399    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
400        serde_json::from_str(&local_var_content).map_err(Error::from)
401    } else {
402        let local_var_entity: Option<ReactionsSlashCreateForTeamDiscussionCommentLegacyError> = serde_json::from_str(&local_var_content).ok();
403        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
404        Err(Error::ResponseError(local_var_error))
405    }
406}
407
408/// Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).  A response with an HTTP `200` status means that you already added the reaction type to this team discussion.  **Note:** 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`.  OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
409pub async fn reactions_slash_create_for_team_discussion_in_org(configuration: &configuration::Configuration, org: &str, team_slug: &str, discussion_number: i32, reactions_create_for_team_discussion_in_org_request: models::ReactionsCreateForTeamDiscussionInOrgRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForTeamDiscussionInOrgError>> {
410    let local_var_configuration = configuration;
411
412    let local_var_client = &local_var_configuration.client;
413
414    let local_var_uri_str = format!("{}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), discussion_number=discussion_number);
415    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
416
417    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
418        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
419    }
420    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_team_discussion_in_org_request);
421
422    let local_var_req = local_var_req_builder.build()?;
423    let local_var_resp = local_var_client.execute(local_var_req).await?;
424
425    let local_var_status = local_var_resp.status();
426    let local_var_content = local_var_resp.text().await?;
427
428    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
429        serde_json::from_str(&local_var_content).map_err(Error::from)
430    } else {
431        let local_var_entity: Option<ReactionsSlashCreateForTeamDiscussionInOrgError> = serde_json::from_str(&local_var_content).ok();
432        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
433        Err(Error::ResponseError(local_var_error))
434    }
435}
436
437/// **Deprecation Notice:** This endpoint route is deprecated 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.  Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).  A response with an HTTP `200` status means that you already added the reaction type to this team discussion.  OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
438pub async fn reactions_slash_create_for_team_discussion_legacy(configuration: &configuration::Configuration, team_id: i32, discussion_number: i32, reactions_create_for_team_discussion_in_org_request: models::ReactionsCreateForTeamDiscussionInOrgRequest) -> Result<models::Reaction, Error<ReactionsSlashCreateForTeamDiscussionLegacyError>> {
439    let local_var_configuration = configuration;
440
441    let local_var_client = &local_var_configuration.client;
442
443    let local_var_uri_str = format!("{}/teams/{team_id}/discussions/{discussion_number}/reactions", local_var_configuration.base_path, team_id=team_id, discussion_number=discussion_number);
444    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
445
446    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
447        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
448    }
449    local_var_req_builder = local_var_req_builder.json(&reactions_create_for_team_discussion_in_org_request);
450
451    let local_var_req = local_var_req_builder.build()?;
452    let local_var_resp = local_var_client.execute(local_var_req).await?;
453
454    let local_var_status = local_var_resp.status();
455    let local_var_content = local_var_resp.text().await?;
456
457    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
458        serde_json::from_str(&local_var_content).map_err(Error::from)
459    } else {
460        let local_var_entity: Option<ReactionsSlashCreateForTeamDiscussionLegacyError> = serde_json::from_str(&local_var_content).ok();
461        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
462        Err(Error::ResponseError(local_var_error))
463    }
464}
465
466/// **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.  Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
467pub async fn reactions_slash_delete_for_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForCommitCommentError>> {
468    let local_var_configuration = configuration;
469
470    let local_var_client = &local_var_configuration.client;
471
472    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id, reaction_id=reaction_id);
473    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
474
475    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
476        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
477    }
478
479    let local_var_req = local_var_req_builder.build()?;
480    let local_var_resp = local_var_client.execute(local_var_req).await?;
481
482    let local_var_status = local_var_resp.status();
483    let local_var_content = local_var_resp.text().await?;
484
485    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
486        Ok(())
487    } else {
488        let local_var_entity: Option<ReactionsSlashDeleteForCommitCommentError> = serde_json::from_str(&local_var_content).ok();
489        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
490        Err(Error::ResponseError(local_var_error))
491    }
492}
493
494/// **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.  Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
495pub async fn reactions_slash_delete_for_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForIssueError>> {
496    let local_var_configuration = configuration;
497
498    let local_var_client = &local_var_configuration.client;
499
500    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number, reaction_id=reaction_id);
501    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
502
503    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
504        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
505    }
506
507    let local_var_req = local_var_req_builder.build()?;
508    let local_var_resp = local_var_client.execute(local_var_req).await?;
509
510    let local_var_status = local_var_resp.status();
511    let local_var_content = local_var_resp.text().await?;
512
513    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
514        Ok(())
515    } else {
516        let local_var_entity: Option<ReactionsSlashDeleteForIssueError> = serde_json::from_str(&local_var_content).ok();
517        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
518        Err(Error::ResponseError(local_var_error))
519    }
520}
521
522/// **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.  Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
523pub async fn reactions_slash_delete_for_issue_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForIssueCommentError>> {
524    let local_var_configuration = configuration;
525
526    let local_var_client = &local_var_configuration.client;
527
528    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id, reaction_id=reaction_id);
529    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
530
531    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
532        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
533    }
534
535    let local_var_req = local_var_req_builder.build()?;
536    let local_var_resp = local_var_client.execute(local_var_req).await?;
537
538    let local_var_status = local_var_resp.status();
539    let local_var_content = local_var_resp.text().await?;
540
541    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
542        Ok(())
543    } else {
544        let local_var_entity: Option<ReactionsSlashDeleteForIssueCommentError> = serde_json::from_str(&local_var_content).ok();
545        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
546        Err(Error::ResponseError(local_var_error))
547    }
548}
549
550/// **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`  Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
551pub async fn reactions_slash_delete_for_pull_request_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForPullRequestCommentError>> {
552    let local_var_configuration = configuration;
553
554    let local_var_client = &local_var_configuration.client;
555
556    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id, reaction_id=reaction_id);
557    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
558
559    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
560        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
561    }
562
563    let local_var_req = local_var_req_builder.build()?;
564    let local_var_resp = local_var_client.execute(local_var_req).await?;
565
566    let local_var_status = local_var_resp.status();
567    let local_var_content = local_var_resp.text().await?;
568
569    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
570        Ok(())
571    } else {
572        let local_var_entity: Option<ReactionsSlashDeleteForPullRequestCommentError> = serde_json::from_str(&local_var_content).ok();
573        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
574        Err(Error::ResponseError(local_var_error))
575    }
576}
577
578/// **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.  Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
579pub async fn reactions_slash_delete_for_release(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForReleaseError>> {
580    let local_var_configuration = configuration;
581
582    let local_var_client = &local_var_configuration.client;
583
584    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id, reaction_id=reaction_id);
585    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
586
587    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
588        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
589    }
590
591    let local_var_req = local_var_req_builder.build()?;
592    let local_var_resp = local_var_client.execute(local_var_req).await?;
593
594    let local_var_status = local_var_resp.status();
595    let local_var_content = local_var_resp.text().await?;
596
597    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
598        Ok(())
599    } else {
600        let local_var_entity: Option<ReactionsSlashDeleteForReleaseError> = serde_json::from_str(&local_var_content).ok();
601        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
602        Err(Error::ResponseError(local_var_error))
603    }
604}
605
606/// **Note:** 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`.  Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).  OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
607pub async fn reactions_slash_delete_for_team_discussion(configuration: &configuration::Configuration, org: &str, team_slug: &str, discussion_number: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForTeamDiscussionError>> {
608    let local_var_configuration = configuration;
609
610    let local_var_client = &local_var_configuration.client;
611
612    let local_var_uri_str = format!("{}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), discussion_number=discussion_number, reaction_id=reaction_id);
613    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
614
615    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
616        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
617    }
618
619    let local_var_req = local_var_req_builder.build()?;
620    let local_var_resp = local_var_client.execute(local_var_req).await?;
621
622    let local_var_status = local_var_resp.status();
623    let local_var_content = local_var_resp.text().await?;
624
625    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
626        Ok(())
627    } else {
628        let local_var_entity: Option<ReactionsSlashDeleteForTeamDiscussionError> = serde_json::from_str(&local_var_content).ok();
629        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
630        Err(Error::ResponseError(local_var_error))
631    }
632}
633
634/// **Note:** 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`.  Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).  OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
635pub async fn reactions_slash_delete_for_team_discussion_comment(configuration: &configuration::Configuration, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, reaction_id: i32) -> Result<(), Error<ReactionsSlashDeleteForTeamDiscussionCommentError>> {
636    let local_var_configuration = configuration;
637
638    let local_var_client = &local_var_configuration.client;
639
640    let local_var_uri_str = format!("{}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), discussion_number=discussion_number, comment_number=comment_number, reaction_id=reaction_id);
641    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
642
643    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
644        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
645    }
646
647    let local_var_req = local_var_req_builder.build()?;
648    let local_var_resp = local_var_client.execute(local_var_req).await?;
649
650    let local_var_status = local_var_resp.status();
651    let local_var_content = local_var_resp.text().await?;
652
653    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
654        Ok(())
655    } else {
656        let local_var_entity: Option<ReactionsSlashDeleteForTeamDiscussionCommentError> = serde_json::from_str(&local_var_content).ok();
657        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
658        Err(Error::ResponseError(local_var_error))
659    }
660}
661
662/// List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
663pub async fn reactions_slash_list_for_commit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForCommitCommentError>> {
664    let local_var_configuration = configuration;
665
666    let local_var_client = &local_var_configuration.client;
667
668    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/comments/{comment_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
669    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
670
671    if let Some(ref local_var_str) = content {
672        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
673    }
674    if let Some(ref local_var_str) = per_page {
675        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
676    }
677    if let Some(ref local_var_str) = page {
678        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
679    }
680    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
681        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
682    }
683
684    let local_var_req = local_var_req_builder.build()?;
685    let local_var_resp = local_var_client.execute(local_var_req).await?;
686
687    let local_var_status = local_var_resp.status();
688    let local_var_content = local_var_resp.text().await?;
689
690    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
691        serde_json::from_str(&local_var_content).map_err(Error::from)
692    } else {
693        let local_var_entity: Option<ReactionsSlashListForCommitCommentError> = serde_json::from_str(&local_var_content).ok();
694        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
695        Err(Error::ResponseError(local_var_error))
696    }
697}
698
699/// List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
700pub async fn reactions_slash_list_for_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForIssueError>> {
701    let local_var_configuration = configuration;
702
703    let local_var_client = &local_var_configuration.client;
704
705    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
706    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
707
708    if let Some(ref local_var_str) = content {
709        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
710    }
711    if let Some(ref local_var_str) = per_page {
712        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
713    }
714    if let Some(ref local_var_str) = page {
715        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
716    }
717    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
718        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
719    }
720
721    let local_var_req = local_var_req_builder.build()?;
722    let local_var_resp = local_var_client.execute(local_var_req).await?;
723
724    let local_var_status = local_var_resp.status();
725    let local_var_content = local_var_resp.text().await?;
726
727    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
728        serde_json::from_str(&local_var_content).map_err(Error::from)
729    } else {
730        let local_var_entity: Option<ReactionsSlashListForIssueError> = serde_json::from_str(&local_var_content).ok();
731        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
732        Err(Error::ResponseError(local_var_error))
733    }
734}
735
736/// List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
737pub async fn reactions_slash_list_for_issue_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForIssueCommentError>> {
738    let local_var_configuration = configuration;
739
740    let local_var_client = &local_var_configuration.client;
741
742    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
743    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
744
745    if let Some(ref local_var_str) = content {
746        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
747    }
748    if let Some(ref local_var_str) = per_page {
749        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
750    }
751    if let Some(ref local_var_str) = page {
752        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
753    }
754    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
755        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
756    }
757
758    let local_var_req = local_var_req_builder.build()?;
759    let local_var_resp = local_var_client.execute(local_var_req).await?;
760
761    let local_var_status = local_var_resp.status();
762    let local_var_content = local_var_resp.text().await?;
763
764    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
765        serde_json::from_str(&local_var_content).map_err(Error::from)
766    } else {
767        let local_var_entity: Option<ReactionsSlashListForIssueCommentError> = serde_json::from_str(&local_var_content).ok();
768        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
769        Err(Error::ResponseError(local_var_error))
770    }
771}
772
773/// List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
774pub async fn reactions_slash_list_for_pull_request_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForPullRequestReviewCommentError>> {
775    let local_var_configuration = configuration;
776
777    let local_var_client = &local_var_configuration.client;
778
779    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
780    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
781
782    if let Some(ref local_var_str) = content {
783        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
784    }
785    if let Some(ref local_var_str) = per_page {
786        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
787    }
788    if let Some(ref local_var_str) = page {
789        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
790    }
791    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
792        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
793    }
794
795    let local_var_req = local_var_req_builder.build()?;
796    let local_var_resp = local_var_client.execute(local_var_req).await?;
797
798    let local_var_status = local_var_resp.status();
799    let local_var_content = local_var_resp.text().await?;
800
801    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
802        serde_json::from_str(&local_var_content).map_err(Error::from)
803    } else {
804        let local_var_entity: Option<ReactionsSlashListForPullRequestReviewCommentError> = serde_json::from_str(&local_var_content).ok();
805        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
806        Err(Error::ResponseError(local_var_error))
807    }
808}
809
810/// List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
811pub async fn reactions_slash_list_for_release(configuration: &configuration::Configuration, owner: &str, repo: &str, release_id: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForReleaseError>> {
812    let local_var_configuration = configuration;
813
814    let local_var_client = &local_var_configuration.client;
815
816    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{release_id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), release_id=release_id);
817    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
818
819    if let Some(ref local_var_str) = content {
820        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
821    }
822    if let Some(ref local_var_str) = per_page {
823        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
824    }
825    if let Some(ref local_var_str) = page {
826        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
827    }
828    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
829        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
830    }
831
832    let local_var_req = local_var_req_builder.build()?;
833    let local_var_resp = local_var_client.execute(local_var_req).await?;
834
835    let local_var_status = local_var_resp.status();
836    let local_var_content = local_var_resp.text().await?;
837
838    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
839        serde_json::from_str(&local_var_content).map_err(Error::from)
840    } else {
841        let local_var_entity: Option<ReactionsSlashListForReleaseError> = serde_json::from_str(&local_var_content).ok();
842        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
843        Err(Error::ResponseError(local_var_error))
844    }
845}
846
847/// List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).  **Note:** 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`.  OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
848pub async fn reactions_slash_list_for_team_discussion_comment_in_org(configuration: &configuration::Configuration, org: &str, team_slug: &str, discussion_number: i32, comment_number: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForTeamDiscussionCommentInOrgError>> {
849    let local_var_configuration = configuration;
850
851    let local_var_client = &local_var_configuration.client;
852
853    let local_var_uri_str = format!("{}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), discussion_number=discussion_number, comment_number=comment_number);
854    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
855
856    if let Some(ref local_var_str) = content {
857        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
858    }
859    if let Some(ref local_var_str) = per_page {
860        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
861    }
862    if let Some(ref local_var_str) = page {
863        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
864    }
865    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
866        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
867    }
868
869    let local_var_req = local_var_req_builder.build()?;
870    let local_var_resp = local_var_client.execute(local_var_req).await?;
871
872    let local_var_status = local_var_resp.status();
873    let local_var_content = local_var_resp.text().await?;
874
875    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
876        serde_json::from_str(&local_var_content).map_err(Error::from)
877    } else {
878        let local_var_entity: Option<ReactionsSlashListForTeamDiscussionCommentInOrgError> = serde_json::from_str(&local_var_content).ok();
879        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
880        Err(Error::ResponseError(local_var_error))
881    }
882}
883
884/// **Deprecation Notice:** This endpoint route is deprecated 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.  List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).  OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
885pub async fn reactions_slash_list_for_team_discussion_comment_legacy(configuration: &configuration::Configuration, team_id: i32, discussion_number: i32, comment_number: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForTeamDiscussionCommentLegacyError>> {
886    let local_var_configuration = configuration;
887
888    let local_var_client = &local_var_configuration.client;
889
890    let local_var_uri_str = format!("{}/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", local_var_configuration.base_path, team_id=team_id, discussion_number=discussion_number, comment_number=comment_number);
891    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
892
893    if let Some(ref local_var_str) = content {
894        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
895    }
896    if let Some(ref local_var_str) = per_page {
897        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
898    }
899    if let Some(ref local_var_str) = page {
900        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
901    }
902    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
903        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
904    }
905
906    let local_var_req = local_var_req_builder.build()?;
907    let local_var_resp = local_var_client.execute(local_var_req).await?;
908
909    let local_var_status = local_var_resp.status();
910    let local_var_content = local_var_resp.text().await?;
911
912    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
913        serde_json::from_str(&local_var_content).map_err(Error::from)
914    } else {
915        let local_var_entity: Option<ReactionsSlashListForTeamDiscussionCommentLegacyError> = serde_json::from_str(&local_var_content).ok();
916        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
917        Err(Error::ResponseError(local_var_error))
918    }
919}
920
921/// List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).  **Note:** 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`.  OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
922pub async fn reactions_slash_list_for_team_discussion_in_org(configuration: &configuration::Configuration, org: &str, team_slug: &str, discussion_number: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForTeamDiscussionInOrgError>> {
923    let local_var_configuration = configuration;
924
925    let local_var_client = &local_var_configuration.client;
926
927    let local_var_uri_str = format!("{}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", local_var_configuration.base_path, org=crate::apis::urlencode(org), team_slug=crate::apis::urlencode(team_slug), discussion_number=discussion_number);
928    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
929
930    if let Some(ref local_var_str) = content {
931        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
932    }
933    if let Some(ref local_var_str) = per_page {
934        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
935    }
936    if let Some(ref local_var_str) = page {
937        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
938    }
939    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
940        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
941    }
942
943    let local_var_req = local_var_req_builder.build()?;
944    let local_var_resp = local_var_client.execute(local_var_req).await?;
945
946    let local_var_status = local_var_resp.status();
947    let local_var_content = local_var_resp.text().await?;
948
949    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
950        serde_json::from_str(&local_var_content).map_err(Error::from)
951    } else {
952        let local_var_entity: Option<ReactionsSlashListForTeamDiscussionInOrgError> = serde_json::from_str(&local_var_content).ok();
953        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
954        Err(Error::ResponseError(local_var_error))
955    }
956}
957
958/// **Deprecation Notice:** This endpoint route is deprecated 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.  List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).  OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
959pub async fn reactions_slash_list_for_team_discussion_legacy(configuration: &configuration::Configuration, team_id: i32, discussion_number: i32, content: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Reaction>, Error<ReactionsSlashListForTeamDiscussionLegacyError>> {
960    let local_var_configuration = configuration;
961
962    let local_var_client = &local_var_configuration.client;
963
964    let local_var_uri_str = format!("{}/teams/{team_id}/discussions/{discussion_number}/reactions", local_var_configuration.base_path, team_id=team_id, discussion_number=discussion_number);
965    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
966
967    if let Some(ref local_var_str) = content {
968        local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
969    }
970    if let Some(ref local_var_str) = per_page {
971        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
972    }
973    if let Some(ref local_var_str) = page {
974        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
975    }
976    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
977        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
978    }
979
980    let local_var_req = local_var_req_builder.build()?;
981    let local_var_resp = local_var_client.execute(local_var_req).await?;
982
983    let local_var_status = local_var_resp.status();
984    let local_var_content = local_var_resp.text().await?;
985
986    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
987        serde_json::from_str(&local_var_content).map_err(Error::from)
988    } else {
989        let local_var_entity: Option<ReactionsSlashListForTeamDiscussionLegacyError> = serde_json::from_str(&local_var_content).ok();
990        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
991        Err(Error::ResponseError(local_var_error))
992    }
993}
994